class OctoMerge::CLI

Attributes

args[R]

Public Class Methods

new(args) click to toggle source
# File lib/octo_merge/cli.rb, line 11
def initialize(args)
  @args = args
end
run(*args) click to toggle source
# File lib/octo_merge/cli.rb, line 7
def self.run(*args)
  new(*args).run
end

Public Instance Methods

run() click to toggle source
# File lib/octo_merge/cli.rb, line 15
def run
  configure
  execute
end

Private Instance Methods

configure() click to toggle source
# File lib/octo_merge/cli.rb, line 22
def configure
  OctoMerge.configure do |config|
    config.login = options.login
    config.password = options.password
  end
end
execute() click to toggle source
# File lib/octo_merge/cli.rb, line 29
def execute
  OctoMerge.run(
    pull_request_numbers: options.pull_requests,
    repo: options.repo,
    strategy: options.strategy,
    working_directory: options.dir
  )
end
options() click to toggle source
# File lib/octo_merge/cli.rb, line 38
def options
  @options ||= Options.new.tap do |options|
    options.cli_options = Parser.parse(args)
  end
end