Class: HustleAndFlow::Commands::Start
- Inherits:
-
Object
- Object
- HustleAndFlow::Commands::Start
- Defined in:
- lib/hustle_and_flow/commands/start.rb
Instance Attribute Summary collapse
-
#io ⇒ Object
Returns the value of attribute io.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(io:, **args) ⇒ Start
constructor
A new instance of Start.
Constructor Details
#initialize(io:, **args) ⇒ Start
Returns a new instance of Start.
11 12 13 14 |
# File 'lib/hustle_and_flow/commands/start.rb', line 11 def initialize(io:, **args) self.io = io self. = args end |
Instance Attribute Details
#io ⇒ Object
Returns the value of attribute io.
8 9 10 |
# File 'lib/hustle_and_flow/commands/start.rb', line 8 def io @io end |
#options ⇒ Object
Returns the value of attribute options.
8 9 10 |
# File 'lib/hustle_and_flow/commands/start.rb', line 8 def @options end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/hustle_and_flow/commands/start.rb', line 16 def call repo = VersionControl.new(path: Dir.pwd) issue = IssueTrackers::Commands::Start.call \ io: io, repo: repo, me: repo.user, options: _branch = VersionControls::Commands::Start.call \ io: io, repo: repo, number: issue.number, title: issue.title, branch_template: issue.to_branch_name(version: '*****') rescue Git::GitExecuteError => e io.say 'There was a problem running a git command.' io.say e. end |