Class: CheckoutTo::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/checkout_to.rb

Class Method Summary collapse

Class Method Details

.start(args) ⇒ Object

Raises:



7
8
9
10
11
12
13
14
# File 'lib/checkout_to.rb', line 7

def self.start(args)
  raise Error, 'Give a name of the brach to checkout' unless args.any?
  
  name = args.compact.map(&:downcase).join('_')
  branch = "#{Time.now.to_i}_#{name}"
  
  `git checkout -b #{branch}`
end