git-storyid 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ea0c96c0cc6afc52210c376d0c46ed4e58ce27f4
4
+ data.tar.gz: 958cd9d0871e7a71dd45ae14f3585bcd6c3236d1
5
+ SHA512:
6
+ metadata.gz: 330859df25358888f7f78bf48b003d9abe3003ac291e7c9bbd8ed2c5a0a9eabc2227b8a5c05dd3ba07c828f5fca8d0155fb22ef40b1f037533b59528f28ae098
7
+ data.tar.gz: 49ddd88705a4466a6facf5bf9c48e9bf94e38c1269fe8b5dd5d4466212f7ce26044a4997a0e2368fed1604d02a78fcda0d5b1cc5975fe2a7342250e4c7e5f2d5
data/Gemfile.lock CHANGED
@@ -13,17 +13,17 @@ GEM
13
13
  debugger-ruby_core_source (>= 1.1.1)
14
14
  debugger-ruby_core_source (1.1.4)
15
15
  diff-lcs (1.2.1)
16
- git (1.2.5)
16
+ git (1.2.6)
17
17
  happymapper (0.4.0)
18
18
  libxml-ruby (~> 2.0)
19
19
  hashie (1.2.0)
20
- jeweler (1.8.4)
20
+ jeweler (2.0.1)
21
21
  bundler (~> 1.0)
22
22
  git (>= 1.2.5)
23
23
  rake
24
24
  rdoc
25
- json (1.8.0)
26
- libxml-ruby (2.3.3)
25
+ json (1.8.1)
26
+ libxml-ruby (2.7.0)
27
27
  metaclass (0.0.1)
28
28
  mime-types (1.19)
29
29
  mocha (0.13.2)
@@ -38,8 +38,8 @@ GEM
38
38
  nokogiri (~> 1.4)
39
39
  rest-client (~> 1.6.0)
40
40
  rest-client (~> 1.6.0)
41
- rake (10.1.0)
42
- rdoc (4.0.1)
41
+ rake (10.2.2)
42
+ rdoc (4.1.1)
43
43
  json (~> 1.4)
44
44
  rest-client (1.6.7)
45
45
  mime-types (>= 1.16)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
data/git-storyid.gemspec CHANGED
@@ -2,14 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
+ # stub: git-storyid 0.3.2 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = "git-storyid"
8
- s.version = "0.3.1"
9
+ s.version = "0.3.2"
9
10
 
10
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
11
13
  s.authors = ["Bogdan Gusiev"]
12
- s.date = "2013-07-30"
14
+ s.date = "2014-04-14"
13
15
  s.description = "Helps include pivotal story id and description in commit"
14
16
  s.email = "agresso@gmail.com"
15
17
  s.executables = ["git-storyid"]
@@ -35,12 +37,11 @@ Gem::Specification.new do |s|
35
37
  ]
36
38
  s.homepage = "http://github.com/bogdan/git-storyid"
37
39
  s.licenses = ["MIT"]
38
- s.require_paths = ["lib"]
39
- s.rubygems_version = "1.8.25"
40
+ s.rubygems_version = "2.2.2"
40
41
  s.summary = "Attach commits to pivotal stories"
41
42
 
42
43
  if s.respond_to? :specification_version then
43
- s.specification_version = 3
44
+ s.specification_version = 4
44
45
 
45
46
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
46
47
  s.add_runtime_dependency(%q<pivotal-tracker>, [">= 0"])
data/lib/git_storyid.rb CHANGED
@@ -39,7 +39,7 @@ class GitStoryid
39
39
  if !@stories || @stories.empty?
40
40
  quit_if_no_stories
41
41
  output stories_menu
42
- @stories = readline_story_ids.map do |index|
42
+ @stories = readline_story_ids.map do |index|
43
43
  all_stories[index - 1] || (quit("Story index #{index} not found."))
44
44
  end
45
45
  end
@@ -65,9 +65,15 @@ class GitStoryid
65
65
  end
66
66
 
67
67
  def readline_story_ids
68
- Readline.readline("Indexes(csv): ", true).split(/\s*,\s*/).reject do |string|
69
- string == ""
70
- end.map {|id| id.to_i }
68
+ ids = readline.split(/\s*,\s*/).reject do |string|
69
+ string.empty?
70
+ end
71
+ quit("Cancelling.") if ids.empty?
72
+ ids.map {|id| id.to_i }
73
+ end
74
+
75
+ def readline
76
+ Readline.readline("Indexes(csv): ", true)
71
77
  end
72
78
 
73
79
  def quit(message)
@@ -9,7 +9,20 @@ describe GitStoryid do
9
9
  GitStoryid.run(*args)
10
10
  end
11
11
 
12
+ def should_quit_with(expected)
13
+ actual = nil
14
+ GitStoryid.send(:define_method, :quit) do |message|
15
+ actual = message
16
+ end
17
+ yield
18
+ actual.should_not be_nil
19
+ actual.should == expected
20
+
21
+ end
22
+
23
+
12
24
  before(:each) do
25
+
13
26
  GitStoryid::Configuration.config = {
14
27
  "api_token" => "a2b4e",
15
28
  "use_ssl" => false,
@@ -21,86 +34,99 @@ describe GitStoryid do
21
34
  commands << args
22
35
  ""
23
36
  end
24
-
25
37
  GitStoryid.any_instance.stubs(:ensure_changes_stashed!).returns(true)
26
- GitStoryid.any_instance.stubs(:readline_story_ids).returns([1])
27
- GitStoryid.any_instance.stubs(:output).returns(true)
28
-
29
- GitStoryid::Configuration.stubs(:project).returns(Hashie::Mash.new(
30
- :initial_velocity => 10,
31
- :labels => "bonobos,true&co,website",
32
- :id => 135657,
33
- :week_start_day => "Monday",
34
- :use_https => false,
35
- :iteration_length => 1,
36
- :account => "Allan Grant",
37
- :name => "Curebit Marketing",
38
- :stories => PivotalTracker::Story,
39
- :last_activity_at => DateTime.now,
40
- :velocity_scheme => "Average of 3 iterations",
41
- :current_iteration_number => 122,
42
- :current_velocity => 19,
43
- :point_scale => "0,1,2,3",
44
- :first_iteration_start_time => DateTime.now
45
- ))
46
-
47
- GitStoryid.any_instance.stubs(:all_stories).returns([
48
- Hashie::Mash.new(
49
- :deadline => nil,
50
- :labels => "paypal",
51
- :accepted_at => nil,
52
- :id => 44647731,
53
- :jira_id => nil,
54
- :estimate => 1,
55
- :integration_id => nil,
56
- :owned_by => "Bogdan Gusiev",
57
- :name => "Strip Default paypal credentials",
58
- :created_at => DateTime.now,
59
- :story_type => "feature",
60
- :other_id => nil,
61
- :description => "",
62
- :requested_by => "Dominic Coryell",
63
- :url => "http://www.pivotaltracker.com/story/show/44647731",
64
- :attachments => [],
65
- :project_id => 135657,
66
- :jira_url => nil,
67
- :current_state => "finished"
68
- ),
69
- Hashie::Mash.new(
70
- :deadline => nil,
71
- :labels => "paypal",
72
- :accepted_at => nil,
73
- :id => 44647732,
74
- :jira_id => nil,
75
- :estimate => 1,
76
- :integration_id => nil,
77
- :owned_by => "Bogdan Gusiev",
78
- :name => "Require pro paypal account for mass payments",
79
- :created_at => DateTime.now,
80
- :story_type => "feature",
81
- :other_id => nil,
82
- :description => "",
83
- :requested_by => "Dominic Coryell",
84
- :url => "http://www.pivotaltracker.com/story/show/44647732",
85
- :attachments => [],
86
- :project_id => 135657,
87
- :jira_url => nil,
88
- :current_state => "finished"
89
- )
90
- ])
91
- end
38
+ GitStoryid.any_instance.stubs(:output).returns(true)
92
39
 
93
- it "should commit changes" do
94
- run("-m", 'Hello world')
95
- commands.should include(["git", "commit", "-m", " [#44647731] Hello world\n\nFeature: Strip Default paypal credentials"])
40
+ GitStoryid::Configuration.stubs(:project).returns(Hashie::Mash.new(
41
+ :initial_velocity => 10,
42
+ :labels => "bonobos,true&co,website",
43
+ :id => 135657,
44
+ :week_start_day => "Monday",
45
+ :use_https => false,
46
+ :iteration_length => 1,
47
+ :account => "Allan Grant",
48
+ :name => "Curebit Marketing",
49
+ :stories => PivotalTracker::Story,
50
+ :last_activity_at => DateTime.now,
51
+ :velocity_scheme => "Average of 3 iterations",
52
+ :current_iteration_number => 122,
53
+ :current_velocity => 19,
54
+ :point_scale => "0,1,2,3",
55
+ :first_iteration_start_time => DateTime.now
56
+ ))
57
+
58
+ GitStoryid.any_instance.stubs(:all_stories).returns([
59
+ Hashie::Mash.new(
60
+ :deadline => nil,
61
+ :labels => "paypal",
62
+ :accepted_at => nil,
63
+ :id => 44647731,
64
+ :jira_id => nil,
65
+ :estimate => 1,
66
+ :integration_id => nil,
67
+ :owned_by => "Bogdan Gusiev",
68
+ :name => "Strip Default paypal credentials",
69
+ :created_at => DateTime.now,
70
+ :story_type => "feature",
71
+ :other_id => nil,
72
+ :description => "",
73
+ :requested_by => "Dominic Coryell",
74
+ :url => "http://www.pivotaltracker.com/story/show/44647731",
75
+ :attachments => [],
76
+ :project_id => 135657,
77
+ :jira_url => nil,
78
+ :current_state => "finished"
79
+ ),
80
+ Hashie::Mash.new(
81
+ :deadline => nil,
82
+ :labels => "paypal",
83
+ :accepted_at => nil,
84
+ :id => 44647732,
85
+ :jira_id => nil,
86
+ :estimate => 1,
87
+ :integration_id => nil,
88
+ :owned_by => "Bogdan Gusiev",
89
+ :name => "Require pro paypal account for mass payments",
90
+ :created_at => DateTime.now,
91
+ :story_type => "feature",
92
+ :other_id => nil,
93
+ :description => "",
94
+ :requested_by => "Dominic Coryell",
95
+ :url => "http://www.pivotaltracker.com/story/show/44647732",
96
+ :attachments => [],
97
+ :project_id => 135657,
98
+ :jira_url => nil,
99
+ :current_state => "finished"
100
+ )
101
+ ])
96
102
  end
97
103
 
98
- it "should render stories menu correctly" do
99
- subject.stories_menu.should == <<-EOI
104
+ context "when stories exists" do
105
+
106
+ before(:each) do
107
+
108
+ GitStoryid.any_instance.stubs(:readline).returns('1')
109
+ end
110
+
111
+ it "should commit changes" do
112
+ run("-m", 'Hello world')
113
+ commands.should include(["git", "commit", "-m", " [#44647731] Hello world\n\nFeature: Strip Default paypal credentials"])
114
+ end
115
+
116
+ it "should render stories menu correctly" do
117
+ subject.stories_menu.should == <<-EOI
100
118
  [1] Strip Default paypal credentials
101
119
  [2] Require pro paypal account for mass payments
102
120
 
103
121
  EOI
122
+ end
123
+ end
124
+
125
+ it "should quit if no stories specified" do
126
+ GitStoryid.any_instance.stubs(:readline).returns('')
127
+ should_quit_with('Cancelling.') do
128
+ run
129
+ end
104
130
  end
105
131
 
106
132
 
metadata CHANGED
@@ -1,126 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-storyid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
5
- prerelease:
4
+ version: 0.3.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Bogdan Gusiev
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-07-30 00:00:00.000000000 Z
11
+ date: 2014-04-14 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: pivotal-tracker
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: webmock
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: debugger
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: mocha
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rspec
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - ">="
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - ">="
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: jeweler
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - ">="
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - ">="
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: hashie
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - ">="
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - ">="
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0'
126
111
  description: Helps include pivotal story id and description in commit
@@ -132,8 +117,8 @@ extra_rdoc_files:
132
117
  - LICENSE.txt
133
118
  - README.md
134
119
  files:
135
- - .document
136
- - .rspec
120
+ - ".document"
121
+ - ".rspec"
137
122
  - Gemfile
138
123
  - Gemfile.lock
139
124
  - LICENSE.txt
@@ -149,29 +134,25 @@ files:
149
134
  homepage: http://github.com/bogdan/git-storyid
150
135
  licenses:
151
136
  - MIT
137
+ metadata: {}
152
138
  post_install_message:
153
139
  rdoc_options: []
154
140
  require_paths:
155
141
  - lib
156
142
  required_ruby_version: !ruby/object:Gem::Requirement
157
- none: false
158
143
  requirements:
159
- - - ! '>='
144
+ - - ">="
160
145
  - !ruby/object:Gem::Version
161
146
  version: '0'
162
- segments:
163
- - 0
164
- hash: 882862228106874276
165
147
  required_rubygems_version: !ruby/object:Gem::Requirement
166
- none: false
167
148
  requirements:
168
- - - ! '>='
149
+ - - ">="
169
150
  - !ruby/object:Gem::Version
170
151
  version: '0'
171
152
  requirements: []
172
153
  rubyforge_project:
173
- rubygems_version: 1.8.25
154
+ rubygems_version: 2.2.2
174
155
  signing_key:
175
- specification_version: 3
156
+ specification_version: 4
176
157
  summary: Attach commits to pivotal stories
177
158
  test_files: []