github-pivotal-flow 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -140,7 +140,7 @@ module GithubPivotalFlow
140
140
  end
141
141
 
142
142
  def github_project
143
- @github_project ||= Project.from_url(URI(Git.get_config("remote.#{Git.get_remote}.url")))
143
+ @github_project ||= Project.from_url(Git.get_config("remote.#{Git.get_remote}.url"))
144
144
  end
145
145
 
146
146
  def github_username(host)
@@ -1,8 +1,16 @@
1
1
  module GithubPivotalFlow
2
2
  class Project < Struct.new(:owner, :name, :host)
3
3
  def self.from_url(url)
4
- _, owner, name = url.path.split('/', 4)
5
- self.new(owner, name.sub(/\.git$/, ''), url.host)
4
+ if (matchdata = /^git@([a-z0-9\._-]+):([a-z0-9_-]+)\/([a-z0-9_-]+)(\.git)?$/.match(url.strip))
5
+ host = matchdata[1]
6
+ owner = matchdata[2]
7
+ name = matchdata[3]
8
+ else
9
+ url = URI(url) if !url.is_a?(URI)
10
+ _, owner, name = url.path.split('/', 4)
11
+ host = url.host
12
+ end
13
+ self.new(owner, name.sub(/\.git$/, ''), host)
6
14
  end
7
15
 
8
16
  def initialize(*args)
@@ -66,5 +66,15 @@ module GithubPivotalFlow
66
66
 
67
67
  expect(result).to be_a(Story)
68
68
  end
69
+
70
+ describe 'github_project' do
71
+ it 'supports working with git urls from the configuration' do
72
+ Git.should_receive(:get_remote).and_return('origin')
73
+ Git.should_receive(:get_config).with('remote.origin.url').and_return('git@github.com:roomorama/github-pivotal-flow.git')
74
+ github_project = @configuration.github_project
75
+ expect(github_project.owner).to eq('roomorama')
76
+ expect(github_project.name).to eq('github-pivotal-flow')
77
+ end
78
+ end
69
79
  end
70
80
  end
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-pivotal-flow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Donald Piret
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-01-17 00:00:00.000000000 Z
12
+ date: 2014-01-20 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: highline
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ~>
25
28
  - !ruby/object:Gem::Version
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: pivotal-tracker
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ~>
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ~>
39
44
  - !ruby/object:Gem::Version
@@ -41,6 +46,7 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: bundler
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ~>
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - ~>
53
60
  - !ruby/object:Gem::Version
@@ -55,6 +62,7 @@ dependencies:
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: rake
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
67
  - - ~>
60
68
  - !ruby/object:Gem::Version
@@ -62,6 +70,7 @@ dependencies:
62
70
  type: :development
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
75
  - - ~>
67
76
  - !ruby/object:Gem::Version
@@ -69,6 +78,7 @@ dependencies:
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: redcarpet
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
83
  - - ~>
74
84
  - !ruby/object:Gem::Version
@@ -76,6 +86,7 @@ dependencies:
76
86
  type: :development
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
91
  - - ~>
81
92
  - !ruby/object:Gem::Version
@@ -83,6 +94,7 @@ dependencies:
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: rspec
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
99
  - - ~>
88
100
  - !ruby/object:Gem::Version
@@ -90,6 +102,7 @@ dependencies:
90
102
  type: :development
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
107
  - - ~>
95
108
  - !ruby/object:Gem::Version
@@ -97,6 +110,7 @@ dependencies:
97
110
  - !ruby/object:Gem::Dependency
98
111
  name: simplecov
99
112
  requirement: !ruby/object:Gem::Requirement
113
+ none: false
100
114
  requirements:
101
115
  - - ~>
102
116
  - !ruby/object:Gem::Version
@@ -104,6 +118,7 @@ dependencies:
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
107
122
  requirements:
108
123
  - - ~>
109
124
  - !ruby/object:Gem::Version
@@ -111,6 +126,7 @@ dependencies:
111
126
  - !ruby/object:Gem::Dependency
112
127
  name: yard
113
128
  requirement: !ruby/object:Gem::Requirement
129
+ none: false
114
130
  requirements:
115
131
  - - ~>
116
132
  - !ruby/object:Gem::Version
@@ -118,6 +134,7 @@ dependencies:
118
134
  type: :development
119
135
  prerelease: false
120
136
  version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
121
138
  requirements:
122
139
  - - ~>
123
140
  - !ruby/object:Gem::Version
@@ -156,26 +173,27 @@ files:
156
173
  homepage: https://github.com/roomorama/github-pivotal-flow
157
174
  licenses:
158
175
  - MIT
159
- metadata: {}
160
176
  post_install_message:
161
177
  rdoc_options: []
162
178
  require_paths:
163
179
  - lib
164
180
  required_ruby_version: !ruby/object:Gem::Requirement
181
+ none: false
165
182
  requirements:
166
- - - '>='
183
+ - - ! '>='
167
184
  - !ruby/object:Gem::Version
168
185
  version: 1.8.7
169
186
  required_rubygems_version: !ruby/object:Gem::Requirement
187
+ none: false
170
188
  requirements:
171
- - - '>='
189
+ - - ! '>='
172
190
  - !ruby/object:Gem::Version
173
191
  version: '0'
174
192
  requirements: []
175
193
  rubyforge_project:
176
- rubygems_version: 2.0.14
194
+ rubygems_version: 1.8.23
177
195
  signing_key:
178
- specification_version: 4
196
+ specification_version: 3
179
197
  summary: Git commands for integration with Pivotal Tracker and Github pull requests
180
198
  test_files:
181
199
  - spec/github_pivotal_flow/configuration_spec.rb
@@ -184,3 +202,4 @@ test_files:
184
202
  - spec/github_pivotal_flow/shell_spec.rb
185
203
  - spec/github_pivotal_flow/start_spec.rb
186
204
  - spec/github_pivotal_flow/story_spec.rb
205
+ has_rdoc:
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 9b38470cff4557c6afa68bb23f45635b62cb6fe8
4
- data.tar.gz: e42db2d90262c0013ab7f38c3ec8d715c0c70c56
5
- SHA512:
6
- metadata.gz: 3242d0eeefb277fb4a59beb100e1611d865b549376beb2eb7a49011ffe5326d28bdd1e91612bb3a757c092c122709234550cb01651b6e4974f2f4a44be9b6340
7
- data.tar.gz: 17c35d793ac6f5f3077b191c40444deff07a0e31361064caae1dc113ff9d4942011d89b982041a405d406c77483a46c52c470bfe8d1a498a0e28519347b8fa33