Class: StoryPush

Inherits:
Command show all
Defined in:
lib/pivotal-github/story_push.rb

Instance Attribute Summary

Attributes inherited from Command

#args, #known_options, #options, #unknown_options

Instance Method Summary collapse

Methods inherited from Command

#initialize, #parse, run!, #story_branch, #story_id, #story_ids

Constructor Details

This class inherits a constructor from Command

Instance Method Details

#cmdObject

Returns a command appropriate for executing at the command line



19
20
21
22
23
24
25
# File 'lib/pivotal-github/story_push.rb', line 19

def cmd
  c = ['git push']
  c << argument_string(unknown_options) unless unknown_options.empty?
  c << target
  c << story_branch
  c.join(' ')
end

#parserObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/pivotal-github/story_push.rb', line 5

def parser
  OptionParser.new do |opts|
    opts.banner = "Usage: git story-push [options]"
    opts.on("-t", "--target TARGET",
            "push to a given target (defaults to origin)") do |t|
      self.options.target = t
    end
    opts.on_tail("-h", "--help", "this usage guide") do
      puts opts.to_s; exit 0
    end
  end
end

#run!Object



27
28
29
# File 'lib/pivotal-github/story_push.rb', line 27

def run!
  system cmd
end