class Octofart::Workflow
Private Class Methods
_init()
click to toggle source
# File lib/octofart/workflow.rb, line 9 def _init @tasks = [] @repositories = {} @pull_request = {} @organization = nil nil end
_run()
click to toggle source
# File lib/octofart/workflow.rb, line 46 def _run Octofart::TaskRunner.run metadata, [ Octofart::Tasks::DataMapping.new, Octofart::Tasks::BranchMapping.new, Octofart::Tasks::CreateBranch.new, Octofart::Tasks::UpdateFile.new, Octofart::Tasks::Commits.new, Octofart::Tasks::PullRequest.new ] end
metadata()
click to toggle source
# File lib/octofart/workflow.rb, line 37 def metadata @metadata ||= { tasks: @tasks, organization: @organization, repositories: @repositories, pull_request: @pull_request } end
organization(org)
click to toggle source
# File lib/octofart/workflow.rb, line 26 def organization(org) @organization = org end
pull_request(title:, body:, branch_name: nil)
click to toggle source
# File lib/octofart/workflow.rb, line 30 def pull_request(title:, body:, branch_name: nil) @pull_request[:title] = title @pull_request[:body] = body @pull_request[:branch_name] = branch_name if branch_name @pull_request end
task(find:, replace:, message:)
click to toggle source
# File lib/octofart/workflow.rb, line 22 def task(find:, replace:, message:) @tasks << { id: task_id, find: find, replace: replace, message: message } end
task_id()
click to toggle source
# File lib/octofart/workflow.rb, line 18 def task_id @tasks.size + 1 end