Class: RubocopPr::CLI
- Inherits:
-
Object
- Object
- RubocopPr::CLI
- Defined in:
- lib/rubocop_pr/cli.rb,
lib/rubocop_pr/cli/process_cop.rb
Overview
Cunner from CLI interface
Defined Under Namespace
Classes: ProcessCop
Instance Attribute Summary collapse
-
#git ⇒ Object
readonly
Returns the value of attribute git.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#rubocop ⇒ Object
readonly
Returns the value of attribute rubocop.
Instance Method Summary collapse
-
#initialize(argv = []) ⇒ CLI
constructor
A new instance of CLI.
- #run! ⇒ Object
Constructor Details
#initialize(argv = []) ⇒ CLI
Returns a new instance of CLI.
8 9 10 11 12 13 |
# File 'lib/rubocop_pr/cli.rb', line 8 def initialize(argv = []) = Options.new(argv).parse @git = Git.new(post_checkout: .post_checkout, origin: .git_origin) @repository = Repository.all.fetch(.repository) @rubocop = RubocopPr::Rubocop.new(branch: .rubocop_todo_branch, git: @git) end |
Instance Attribute Details
#git ⇒ Object (readonly)
Returns the value of attribute git.
6 7 8 |
# File 'lib/rubocop_pr/cli.rb', line 6 def git @git end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/rubocop_pr/cli.rb', line 6 def end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
6 7 8 |
# File 'lib/rubocop_pr/cli.rb', line 6 def repository @repository end |
#rubocop ⇒ Object (readonly)
Returns the value of attribute rubocop.
6 7 8 |
# File 'lib/rubocop_pr/cli.rb', line 6 def rubocop @rubocop end |
Instance Method Details
#run! ⇒ Object
15 16 17 18 19 20 |
# File 'lib/rubocop_pr/cli.rb', line 15 def run! EnvironmentChecker.call(repository, ) run git.checkout Rubocop::TODO_FILENAME git.checkout(.master_branch) end |