breakout feature into parts

This commit is contained in:
rkiel
2015-06-06 06:43:34 -04:00
parent d928791be0
commit 71f7a91065
7 changed files with 184 additions and 152 deletions

23
lib/feature/start.rb Normal file
View File

@@ -0,0 +1,23 @@
require_relative './base'
module Feature
class Start < Feature::Base
def execute
error "USAGE: feature start feature_name" unless argv.size == 2
feature = argv[1]
feature_branch = "#{ENV['USER']}-#{current_branch}-#{feature}"
error "invalid base branch: #{current_branch}" unless standard_branches.include? current_branch
error "invalid feature branch: #{featureh}" if standard_branches.include? feature
run_cmd "git pull origin #{current_branch}"
run_cmd "git checkout -b #{feature_branch}"
run_cmd "git push origin #{feature_branch}"
end
end
end