Sha256: 4b536fcc0b19a7a7a461ef168a96e52eff33e2f88fd8a32aa580f5a701d9b925

Contents?: true

Size: 757 Bytes

Versions: 20

Compression:

Stored size: 757 Bytes

Contents

require 'pivotal-github/command'

class StoryPush < Command

  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

  # Returns a command appropriate for executing at the command line
  def cmd
    c = ['git push']
    c << argument_string(unknown_options) unless unknown_options.empty?
    c << target
    c << story_branch
    c.join(' ')
  end

  def run!
    system cmd
  end

  private

    def target
      options.target || 'origin'
    end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
pivotal-github-0.7.0 lib/pivotal-github/story_push.rb
pivotal-github-0.6.14 lib/pivotal-github/story_push.rb
pivotal-github-0.6.12 lib/pivotal-github/story_push.rb
pivotal-github-0.6.11 lib/pivotal-github/story_push.rb
pivotal-github-0.6.10 lib/pivotal-github/story_push.rb
pivotal-github-0.6.9 lib/pivotal-github/story_push.rb
pivotal-github-0.6.8 lib/pivotal-github/story_push.rb
pivotal-github-0.6.7 lib/pivotal-github/story_push.rb
pivotal-github-0.6.6 lib/pivotal-github/story_push.rb
pivotal-github-0.6.5 lib/pivotal-github/story_push.rb
pivotal-github-0.6.4 lib/pivotal-github/story_push.rb
pivotal-github-0.6.3 lib/pivotal-github/story_push.rb
pivotal-github-0.6.2 lib/pivotal-github/story_push.rb
pivotal-github-0.6.1 lib/pivotal-github/story_push.rb
pivotal-github-0.6.0 lib/pivotal-github/story_push.rb
pivotal-github-0.5.6 lib/pivotal-github/story_push.rb
pivotal-github-0.5.5 lib/pivotal-github/story_push.rb
pivotal-github-0.5.4 lib/pivotal-github/story_push.rb
pivotal-github-0.5.3 lib/pivotal-github/story_push.rb
pivotal-github-0.5.2 lib/pivotal-github/story_push.rb