Sha256: 9743dc823da351095c7e95aa495e7a79651b290a9567cfcde4354c4a925af0cf

Contents?: true

Size: 491 Bytes

Versions: 1

Compression:

Stored size: 491 Bytes

Contents

require 'straight_line/common/user_error'
require 'straight_line/common/command'

module Feature
  # Creates a new branch for the feature
  class Create
    def initialize(feature_name)
      raise UserError, 'Feature name required' unless feature_name
      raise UserError, "Feature name can't have spaces" if feature_name.match %r[\s]
      @feature_name = feature_name
    end

    def run
      cmd = Command.new 'git', ['checkout', '-b', @feature_name]
      cmd.run
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
straight_line-0.1.1.0 lib/straight_line/common/feature/create.rb