pivotal-slacker 1.7.0 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/pivotal-slacker +12 -4
  2. metadata +1 -1
data/bin/pivotal-slacker CHANGED
@@ -45,6 +45,15 @@ program :description, "Pivotal Tracker command line client."
45
45
  # ----------------------------------------------------------
46
46
  # Support functionality
47
47
 
48
+ def init_new_shell_loop
49
+ # Commander doesn't act right when you try to run the same command more than once,
50
+ # so we have to redefine them after we use them.
51
+ define_commands
52
+
53
+ # Don't let the Pivotal Tracker API client cache projects or stories.
54
+ $project = PivotalTracker::Project.find $config.project
55
+ end
56
+
48
57
  # Supports looking up a story ID from $menu_story_mapping. If no mapping is found there, defaults
49
58
  # to `id` as passed in.
50
59
  def normalize_story_id id
@@ -143,7 +152,8 @@ def define_commands
143
152
  c.description = "Open a specific Pivotal Tracker story in the browser."
144
153
  c.example "Open a story with ID 123", "pivotal-slacker open 123"
145
154
  c.action do |args, options|
146
- story = $project.stories.find(args[0].to_i)
155
+ story_id = normalize_story_id(args[0].to_i)
156
+ story = $project.stories.find(story_id)
147
157
  Launchy.open story.url
148
158
  end
149
159
  end
@@ -327,9 +337,7 @@ command :shell do |c|
327
337
 
328
338
  command.run *argv
329
339
 
330
- # Commander doesn't act right when you try to run the same command more than once,
331
- # so we have to redefine them after we use them.
332
- define_commands
340
+ init_new_shell_loop
333
341
  end
334
342
  end
335
343
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pivotal-slacker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: