Skip to content
Browse files

Start command takes an optional basename

  • Loading branch information...
1 parent eb23bbd commit 4e6e6ce3231cf86b7604912abd3733b0fd8ec437 @tpope tpope committed Nov 30, 2008
Showing with 16 additions and 9 deletions.
  1. +4 −2 README.rdoc
  2. +3 −7 lib/pickler.rb
  3. +5 −0 lib/pickler/feature.rb
  4. +4 −0 lib/pickler/tracker/story.rb
View
6 README.rdoc
@@ -35,9 +35,11 @@ List all stories matching the given query.
Show details for the story referenced by the id.
- pickler start <id>
+ pickler start <id> [basename]
-Pull a given feature and change its state to started.
+Pull a given feature and change its state to started. If basename is given
+and no local file exists, features/basename.feature will be created in lieu
+of features/id.feature.
pickler finish <id>
View
10 lib/pickler.rb
@@ -40,7 +40,7 @@ def self.run(argv)
when 'pull'
pickler.pull(*argv)
when 'start'
- pickler.start(argv.first)
+ pickler.start(argv.first,argv[1])
when 'finish'
pickler.finish(argv.first)
when 'help', '--help', '-h', '', nil
@@ -140,12 +140,8 @@ def pull(*args)
end
end
- def start(*args)
- args.each do |arg|
- story = story(arg)
- story.transition!("started") if %w(unstarted rejected).include?(story.current_state)
- end
- pull(*args)
+ def start(arg, default = nil)
+ feature(arg).start(default)
end
def push(*args)
View
5 lib/pickler/feature.rb
@@ -54,6 +54,11 @@ def pull(default = nil)
@filename = filename
end
+ def start(default = nil)
+ story.transition!("started") if story.startable?
+ pull(default)
+ end
+
def push
return if story.to_s == local_body.to_s
story.to_s = local_body
View
4 lib/pickler/tracker/story.rb
@@ -30,6 +30,10 @@ def complete?
%w(finished delivered accepted).include?(current_state)
end
+ def startable?
+ %w(unstarted rejected).include?(current_state)
+ end
+
def tracker
project.tracker
end

0 comments on commit 4e6e6ce

Please sign in to comment.
Something went wrong with that request. Please try again.