flowdock-git-hook 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -1,4 +1,3 @@
1
1
  rvm:
2
2
  - 1.8.7
3
3
  - 1.9.3
4
- - jruby
data/Gemfile CHANGED
@@ -8,7 +8,6 @@ group :development do
8
8
  gem "rspec", "~> 2.8"
9
9
  gem "bundler", "~> 1.0"
10
10
  gem "jeweler", "~> 1.6.2"
11
- gem "rcov", ">= 0"
12
11
  gem "webmock", ">= 1.6.4"
13
12
  gem "jruby-openssl", :platforms => :jruby, :require => false
14
13
  end
data/README.rdoc CHANGED
@@ -19,6 +19,20 @@ Configure your Flow API tokens to git configuration
19
19
 
20
20
  After this, you should get updates from your git repo every time you push to it.
21
21
 
22
+ == Commit URLs
23
+
24
+ Commit SHAs links in the Team Inbox of Flowdock can be made clickable to view the change on the web. To configure the URL for viewing commits, configure a <tt>commit-url-pattern</tt>:
25
+
26
+ $ config flowdock.commit-url-pattern "http://example.com/mygitviewer/commits/%s"
27
+
28
+ The <tt>%s</tt> will be replaced with the commit SHA.
29
+
30
+ Example for Redmine:
31
+
32
+ $ git config flowdock.commit-url-pattern "http://developer.example.com/projects/myproject/repository/revisions/%s"
33
+
34
+ Replace 'myproject' with the project the Git repository is associated with.
35
+
22
36
  == Advanced usage
23
37
 
24
38
  The git hook allows Flowdock tags to be attached to push messages. If you only need static tags, e.g. git repo name as tag, this can be configured in git config:
data/Rakefile CHANGED
@@ -30,11 +30,6 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
30
30
  spec.pattern = FileList['spec/**/*_spec.rb']
31
31
  end
32
32
 
33
- RSpec::Core::RakeTask.new(:rcov) do |spec|
34
- spec.pattern = 'spec/**/*_spec.rb'
35
- spec.rcov = true
36
- end
37
-
38
33
  task :default => :spec
39
34
 
40
35
  require 'rdoc/task'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.3.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "flowdock-git-hook"
8
- s.version = "0.2.1"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ville Lautanala"]
12
- s.date = "2012-01-17"
12
+ s.date = "2012-10-18"
13
13
  s.email = "lautis@gmail.com"
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE.txt",
@@ -36,7 +36,7 @@ Gem::Specification.new do |s|
36
36
  s.homepage = "http://github.com/flowdock/flowdock-git-hook"
37
37
  s.licenses = ["MIT"]
38
38
  s.require_paths = ["lib"]
39
- s.rubygems_version = "1.8.10"
39
+ s.rubygems_version = "1.8.23"
40
40
  s.summary = "Git Post-Receive hook for Flowdock"
41
41
 
42
42
  if s.respond_to? :specification_version then
@@ -49,7 +49,6 @@ Gem::Specification.new do |s|
49
49
  s.add_development_dependency(%q<rspec>, ["~> 2.8"])
50
50
  s.add_development_dependency(%q<bundler>, ["~> 1.0"])
51
51
  s.add_development_dependency(%q<jeweler>, ["~> 1.6.2"])
52
- s.add_development_dependency(%q<rcov>, [">= 0"])
53
52
  s.add_development_dependency(%q<webmock>, [">= 1.6.4"])
54
53
  s.add_development_dependency(%q<jruby-openssl>, [">= 0"])
55
54
  else
@@ -59,7 +58,6 @@ Gem::Specification.new do |s|
59
58
  s.add_dependency(%q<rspec>, ["~> 2.8"])
60
59
  s.add_dependency(%q<bundler>, ["~> 1.0"])
61
60
  s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
62
- s.add_dependency(%q<rcov>, [">= 0"])
63
61
  s.add_dependency(%q<webmock>, [">= 1.6.4"])
64
62
  s.add_dependency(%q<jruby-openssl>, [">= 0"])
65
63
  end
@@ -70,7 +68,6 @@ Gem::Specification.new do |s|
70
68
  s.add_dependency(%q<rspec>, ["~> 2.8"])
71
69
  s.add_dependency(%q<bundler>, ["~> 1.0"])
72
70
  s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
73
- s.add_dependency(%q<rcov>, [">= 0"])
74
71
  s.add_dependency(%q<webmock>, [">= 1.6.4"])
75
72
  s.add_dependency(%q<jruby-openssl>, [">= 0"])
76
73
  end
data/lib/flowdock/git.rb CHANGED
@@ -24,13 +24,22 @@ module Flowdock
24
24
  def initialize(options = {})
25
25
  @options = options
26
26
  @token = options[:token] || config["flowdock.token"] || raise(TokenError.new("Flowdock API token not found"))
27
+ @commit_url = config["flowdock.commit-url-pattern"] || nil
27
28
  end
28
29
 
29
30
  # Send git push notification to Flowdock
30
31
  def post(data)
31
32
  uri = URI.parse("#{API_ENDPOINT}/#{([@token] + tags).join('+')}")
32
33
  req = Net::HTTP::Post.new(uri.path)
33
- req.set_form_data(:payload => MultiJson.encode(data.to_hash))
34
+
35
+ payload_hash = data.to_hash
36
+ if @commit_url
37
+ payload_hash[:commits].each do |commit|
38
+ commit[:url] = @commit_url % commit[:id]
39
+ end
40
+ end
41
+
42
+ req.set_form_data(:payload => MultiJson.encode(payload_hash))
34
43
  http = Net::HTTP.new(uri.host, uri.port)
35
44
 
36
45
  if uri.scheme == 'https'
metadata CHANGED
@@ -1,168 +1,152 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: flowdock-git-hook
3
- version: !ruby/object:Gem::Version
4
- hash: 21
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 1
10
- version: 0.2.1
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Ville Lautanala
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-01-17 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- version_requirements: &id001 !ruby/object:Gem::Requirement
22
- none: false
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- hash: 29
27
- segments:
28
- - 2
29
- - 4
30
- - 1
31
- version: 2.4.1
12
+ date: 2012-10-18 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
32
15
  name: grit
33
- prerelease: false
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 2.4.1
34
22
  type: :runtime
35
- requirement: *id001
36
- - !ruby/object:Gem::Dependency
37
- version_requirements: &id002 !ruby/object:Gem::Requirement
38
- none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 3
43
- segments:
44
- - 0
45
- version: "0"
46
- name: multi_json
47
23
  prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 2.4.1
30
+ - !ruby/object:Gem::Dependency
31
+ name: multi_json
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
48
38
  type: :runtime
49
- requirement: *id002
50
- - !ruby/object:Gem::Dependency
51
- version_requirements: &id003 !ruby/object:Gem::Requirement
52
- none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- hash: 27
57
- segments:
58
- - 2
59
- - 4
60
- - 2
61
- version: 2.4.2
62
- name: rdoc
63
39
  prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rdoc
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: 2.4.2
64
54
  type: :development
65
- requirement: *id003
66
- - !ruby/object:Gem::Dependency
67
- version_requirements: &id004 !ruby/object:Gem::Requirement
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
68
57
  none: false
69
- requirements:
70
- - - ~>
71
- - !ruby/object:Gem::Version
72
- hash: 19
73
- segments:
74
- - 2
75
- - 8
76
- version: "2.8"
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 2.4.2
62
+ - !ruby/object:Gem::Dependency
77
63
  name: rspec
78
- prerelease: false
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: '2.8'
79
70
  type: :development
80
- requirement: *id004
81
- - !ruby/object:Gem::Dependency
82
- version_requirements: &id005 !ruby/object:Gem::Requirement
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
83
73
  none: false
84
- requirements:
74
+ requirements:
85
75
  - - ~>
86
- - !ruby/object:Gem::Version
87
- hash: 15
88
- segments:
89
- - 1
90
- - 0
91
- version: "1.0"
76
+ - !ruby/object:Gem::Version
77
+ version: '2.8'
78
+ - !ruby/object:Gem::Dependency
92
79
  name: bundler
93
- prerelease: false
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: '1.0'
94
86
  type: :development
95
- requirement: *id005
96
- - !ruby/object:Gem::Dependency
97
- version_requirements: &id006 !ruby/object:Gem::Requirement
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
98
89
  none: false
99
- requirements:
90
+ requirements:
100
91
  - - ~>
101
- - !ruby/object:Gem::Version
102
- hash: 11
103
- segments:
104
- - 1
105
- - 6
106
- - 2
107
- version: 1.6.2
92
+ - !ruby/object:Gem::Version
93
+ version: '1.0'
94
+ - !ruby/object:Gem::Dependency
108
95
  name: jeweler
109
- prerelease: false
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ~>
100
+ - !ruby/object:Gem::Version
101
+ version: 1.6.2
110
102
  type: :development
111
- requirement: *id006
112
- - !ruby/object:Gem::Dependency
113
- version_requirements: &id007 !ruby/object:Gem::Requirement
114
- none: false
115
- requirements:
116
- - - ">="
117
- - !ruby/object:Gem::Version
118
- hash: 3
119
- segments:
120
- - 0
121
- version: "0"
122
- name: rcov
123
103
  prerelease: false
124
- type: :development
125
- requirement: *id007
126
- - !ruby/object:Gem::Dependency
127
- version_requirements: &id008 !ruby/object:Gem::Requirement
128
- none: false
129
- requirements:
130
- - - ">="
131
- - !ruby/object:Gem::Version
132
- hash: 7
133
- segments:
134
- - 1
135
- - 6
136
- - 4
137
- version: 1.6.4
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 1.6.2
110
+ - !ruby/object:Gem::Dependency
138
111
  name: webmock
139
- prerelease: false
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: 1.6.4
140
118
  type: :development
141
- requirement: *id008
142
- - !ruby/object:Gem::Dependency
143
- version_requirements: &id009 !ruby/object:Gem::Requirement
144
- none: false
145
- requirements:
146
- - - ">="
147
- - !ruby/object:Gem::Version
148
- hash: 3
149
- segments:
150
- - 0
151
- version: "0"
152
- name: jruby-openssl
153
119
  prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: 1.6.4
126
+ - !ruby/object:Gem::Dependency
127
+ name: jruby-openssl
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
154
134
  type: :development
155
- requirement: *id009
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
156
142
  description:
157
143
  email: lautis@gmail.com
158
144
  executables: []
159
-
160
145
  extensions: []
161
-
162
- extra_rdoc_files:
146
+ extra_rdoc_files:
163
147
  - LICENSE.txt
164
148
  - README.rdoc
165
- files:
149
+ files:
166
150
  - .document
167
151
  - .rspec
168
152
  - .travis.yml
@@ -180,37 +164,31 @@ files:
180
164
  - spec/flowdock_git_spec.rb
181
165
  - spec/spec_helper.rb
182
166
  homepage: http://github.com/flowdock/flowdock-git-hook
183
- licenses:
167
+ licenses:
184
168
  - MIT
185
169
  post_install_message:
186
170
  rdoc_options: []
187
-
188
- require_paths:
171
+ require_paths:
189
172
  - lib
190
- required_ruby_version: !ruby/object:Gem::Requirement
173
+ required_ruby_version: !ruby/object:Gem::Requirement
191
174
  none: false
192
- requirements:
193
- - - ">="
194
- - !ruby/object:Gem::Version
195
- hash: 3
196
- segments:
175
+ requirements:
176
+ - - ! '>='
177
+ - !ruby/object:Gem::Version
178
+ version: '0'
179
+ segments:
197
180
  - 0
198
- version: "0"
199
- required_rubygems_version: !ruby/object:Gem::Requirement
181
+ hash: 3361873183891229684
182
+ required_rubygems_version: !ruby/object:Gem::Requirement
200
183
  none: false
201
- requirements:
202
- - - ">="
203
- - !ruby/object:Gem::Version
204
- hash: 3
205
- segments:
206
- - 0
207
- version: "0"
184
+ requirements:
185
+ - - ! '>='
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
208
188
  requirements: []
209
-
210
189
  rubyforge_project:
211
- rubygems_version: 1.8.10
190
+ rubygems_version: 1.8.23
212
191
  signing_key:
213
192
  specification_version: 3
214
193
  summary: Git Post-Receive hook for Flowdock
215
194
  test_files: []
216
-