git-storyid 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/git-storyid.gemspec +9 -8
  3. data/lib/git_storyid.rb +24 -17
  4. metadata +75 -62
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
data/git-storyid.gemspec CHANGED
@@ -4,14 +4,15 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = "git-storyid"
8
- s.version = "0.2.0"
7
+ s.name = %q{git-storyid}
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Bogdan Gusiev"]
12
- s.date = "2013-02-09"
13
- s.description = "Helps include pivotal story id and description in commit"
14
- s.email = "agresso@gmail.com"
12
+ s.date = %q{2013-02-19}
13
+ s.default_executable = %q{git-storyid}
14
+ s.description = %q{Helps include pivotal story id and description in commit}
15
+ s.email = %q{agresso@gmail.com}
15
16
  s.executables = ["git-storyid"]
16
17
  s.extra_rdoc_files = [
17
18
  "LICENSE.txt",
@@ -33,11 +34,11 @@ Gem::Specification.new do |s|
33
34
  "spec/git_storyid_spec.rb",
34
35
  "spec/spec_helper.rb"
35
36
  ]
36
- s.homepage = "http://github.com/bogdan/git-storyid"
37
+ s.homepage = %q{http://github.com/bogdan/git-storyid}
37
38
  s.licenses = ["MIT"]
38
39
  s.require_paths = ["lib"]
39
- s.rubygems_version = "1.8.24"
40
- s.summary = "Attach commits to pivotal stories"
40
+ s.rubygems_version = %q{1.6.0}
41
+ s.summary = %q{Attach commits to pivotal stories}
41
42
 
42
43
  if s.respond_to? :specification_version then
43
44
  s.specification_version = 3
data/lib/git_storyid.rb CHANGED
@@ -34,28 +34,35 @@ class GitStoryid
34
34
  )
35
35
  end
36
36
 
37
- def run
38
- if execute("git", "diff", "--staged").empty?
39
- puts "No changes staged to commit."
40
- exit 1
37
+ def readline_stories_if_not_present
38
+ return if @stories
39
+ if all_stories.empty?
40
+ quit "No stories started and owned by you."
41
+ end
42
+ all_stories.each_with_index do |story, index|
43
+ puts "[#{index + 1}] #{story.name}"
41
44
  end
45
+ puts ""
46
+ @stories = Readline.readline("Indexes(csv): ", true).split(/\s*,\s*/).reject do |string|
47
+ string == ""
48
+ end.map do |string|
49
+ index = string.to_i
50
+ all_stories[index - 1] || (quit("Story index #{index} not found."))
51
+ end
52
+ end
42
53
 
43
- unless @stories
44
- unless all_stories.empty?
45
- all_stories.each_with_index do |story, index|
46
- puts "[#{index + 1}] #{story.name}"
47
- end
48
- puts ""
49
- @stories = Readline.readline("Indexes(csv): ", true).split(/\s*,\s*/).reject do |string|
50
- string == ""
51
- end.map do |string|
52
- index = string.to_i
53
- all_stories[index - 1] || (return puts("Story index #{index} not found."))
54
- end
54
+ def quit(message)
55
+ puts message
56
+ exit 1
57
+ end
55
58
 
56
- end
59
+ def run
60
+ if execute("git", "diff", "--staged").empty?
61
+ quit "No changes staged to commit."
57
62
  end
58
63
 
64
+ readline_stories_if_not_present
65
+
59
66
  message = ("[#{@stories.map { |s| "\##{s.id}"}.join(", ")}]").rjust 12
60
67
  message += ' '
61
68
  if @message && !@message.empty?
metadata CHANGED
@@ -1,73 +1,79 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: git-storyid
3
- version: !ruby/object:Gem::Version
4
- version: 0.2.0
3
+ version: !ruby/object:Gem::Version
4
+ hash: 21
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - 1
10
+ version: 0.2.1
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Bogdan Gusiev
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2013-02-09 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: pivotal-tracker
16
- requirement: !ruby/object:Gem::Requirement
17
+
18
+ date: 2013-02-19 00:00:00 +02:00
19
+ default_executable: git-storyid
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ requirement: &id001 !ruby/object:Gem::Requirement
17
23
  none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :runtime
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ hash: 3
28
+ segments:
29
+ - 0
30
+ version: "0"
31
+ version_requirements: *id001
23
32
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
30
- - !ruby/object:Gem::Dependency
31
- name: rspec
32
- requirement: !ruby/object:Gem::Requirement
33
+ name: pivotal-tracker
34
+ type: :runtime
35
+ - !ruby/object:Gem::Dependency
36
+ requirement: &id002 !ruby/object:Gem::Requirement
33
37
  none: false
34
- requirements:
38
+ requirements:
35
39
  - - ~>
36
- - !ruby/object:Gem::Version
40
+ - !ruby/object:Gem::Version
41
+ hash: 47
42
+ segments:
43
+ - 2
44
+ - 8
45
+ - 0
37
46
  version: 2.8.0
38
- type: :development
47
+ version_requirements: *id002
39
48
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
45
- version: 2.8.0
46
- - !ruby/object:Gem::Dependency
47
- name: jeweler
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ~>
52
- - !ruby/object:Gem::Version
53
- version: 1.8.3
49
+ name: rspec
54
50
  type: :development
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
51
+ - !ruby/object:Gem::Dependency
52
+ requirement: &id003 !ruby/object:Gem::Requirement
57
53
  none: false
58
- requirements:
54
+ requirements:
59
55
  - - ~>
60
- - !ruby/object:Gem::Version
56
+ - !ruby/object:Gem::Version
57
+ hash: 49
58
+ segments:
59
+ - 1
60
+ - 8
61
+ - 3
61
62
  version: 1.8.3
63
+ version_requirements: *id003
64
+ prerelease: false
65
+ name: jeweler
66
+ type: :development
62
67
  description: Helps include pivotal story id and description in commit
63
68
  email: agresso@gmail.com
64
- executables:
69
+ executables:
65
70
  - git-storyid
66
71
  extensions: []
67
- extra_rdoc_files:
72
+
73
+ extra_rdoc_files:
68
74
  - LICENSE.txt
69
75
  - README.md
70
- files:
76
+ files:
71
77
  - .document
72
78
  - .rspec
73
79
  - Gemfile
@@ -82,32 +88,39 @@ files:
82
88
  - lib/git_storyid.rb
83
89
  - spec/git_storyid_spec.rb
84
90
  - spec/spec_helper.rb
91
+ has_rdoc: true
85
92
  homepage: http://github.com/bogdan/git-storyid
86
- licenses:
93
+ licenses:
87
94
  - MIT
88
95
  post_install_message:
89
96
  rdoc_options: []
90
- require_paths:
97
+
98
+ require_paths:
91
99
  - lib
92
- required_ruby_version: !ruby/object:Gem::Requirement
100
+ required_ruby_version: !ruby/object:Gem::Requirement
93
101
  none: false
94
- requirements:
95
- - - ! '>='
96
- - !ruby/object:Gem::Version
97
- version: '0'
98
- segments:
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ hash: 3
106
+ segments:
99
107
  - 0
100
- hash: -1277588774395316013
101
- required_rubygems_version: !ruby/object:Gem::Requirement
108
+ version: "0"
109
+ required_rubygems_version: !ruby/object:Gem::Requirement
102
110
  none: false
103
- requirements:
104
- - - ! '>='
105
- - !ruby/object:Gem::Version
106
- version: '0'
111
+ requirements:
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ hash: 3
115
+ segments:
116
+ - 0
117
+ version: "0"
107
118
  requirements: []
119
+
108
120
  rubyforge_project:
109
- rubygems_version: 1.8.24
121
+ rubygems_version: 1.6.0
110
122
  signing_key:
111
123
  specification_version: 3
112
124
  summary: Attach commits to pivotal stories
113
125
  test_files: []
126
+