breakout commit
This commit is contained in:
30
lib/commit/commander.rb
Normal file
30
lib/commit/commander.rb
Normal file
@@ -0,0 +1,30 @@
|
||||
module Commit
|
||||
|
||||
class Commander
|
||||
attr_reader :argv
|
||||
|
||||
def initialize (argv)
|
||||
@argv = argv
|
||||
end
|
||||
|
||||
def valid?
|
||||
argv.size > 0
|
||||
end
|
||||
|
||||
def help
|
||||
puts
|
||||
puts "USAGE: commit [word....]"
|
||||
puts
|
||||
exit
|
||||
end
|
||||
|
||||
def execute
|
||||
comment = argv.reject { |x| x == '-m' }.join(' ')
|
||||
|
||||
command = "git commit -m \"#{comment}\""
|
||||
exec command
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
@@ -4,7 +4,7 @@ module Feature
|
||||
|
||||
class End < Feature::Base
|
||||
def execute
|
||||
error "USAGE: feature end" unless ARGV.size == 1
|
||||
error "USAGE: feature end" unless argv.size == 1
|
||||
|
||||
parts = parse_branch(current_branch)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user