Class: OptimisWorkflow::Commands::StartHotfix

Inherits:
StartCommand show all
Defined in:
lib/optimis-workflow/commands/start_hotfix.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#args

Instance Method Summary collapse

Methods inherited from StartCommand

#remote_stuff, #story_id

Methods inherited from Base

#execute!

Methods included from OptimisWorkflow::Common

#current_dir, #mark_as_started_on_pivotal, #payload, #settings, #settings_file, #start_feature

Constructor Details

#initialize(args) ⇒ StartHotfix

Returns a new instance of StartHotfix.



7
8
9
10
11
12
13
14
# File 'lib/optimis-workflow/commands/start_hotfix.rb', line 7

def initialize(args)
  super(args)
  if args.empty?
    puts "\nError! Please pass in a hotfix story id"
    exit 1
  end
  @stable_branch = args[1] || 'stable'
end

Instance Attribute Details

#stable_branchObject (readonly)

Returns the value of attribute stable_branch.



5
6
7
# File 'lib/optimis-workflow/commands/start_hotfix.rb', line 5

def stable_branch
  @stable_branch
end

Instance Method Details

#help_msgObject



16
17
18
# File 'lib/optimis-workflow/commands/start_hotfix.rb', line 16

def help_msg
  "Syntax: start-hotfix STORYID [stable]"
end

#local_stuffObject



20
21
22
# File 'lib/optimis-workflow/commands/start_hotfix.rb', line 20

def local_stuff
  system "git checkout -b hotfix-#{args[0]} #{stable_branch}"
end