git-commit-notifier 0.8.1 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +21 -0
- data/Gemfile.lock +105 -0
- data/README.textile +6 -1
- data/Rakefile +3 -3
- data/VERSION +1 -1
- data/bin/git-commit-notifier +3 -1
- data/config/git-notifier-config.yml.sample +28 -4
- data/git-commit-notifier.gemspec +81 -56
- data/lib/git_commit_notifier.rb +8 -0
- data/lib/git_commit_notifier/commit_hook.rb +130 -0
- data/lib/git_commit_notifier/diff_callback.rb +22 -0
- data/lib/git_commit_notifier/diff_to_html.rb +471 -0
- data/lib/{emailer.rb → git_commit_notifier/emailer.rb} +47 -31
- data/lib/git_commit_notifier/escape_helper.rb +5 -0
- data/lib/{git.rb → git_commit_notifier/git.rb} +1 -1
- data/lib/{logger.rb → git_commit_notifier/logger.rb} +1 -1
- data/lib/git_commit_notifier/result_processor.rb +131 -0
- data/spec/fixtures/git-notifier-with-branch-restrictions.yml +22 -0
- data/spec/lib/{commit_hook_spec.rb → git_commit_notifier/commit_hook_spec.rb} +37 -11
- data/spec/lib/{diff_to_html_spec.rb → git_commit_notifier/diff_to_html_spec.rb} +94 -16
- data/spec/lib/{emailer_spec.rb → git_commit_notifier/emailer_spec.rb} +9 -20
- data/spec/lib/{git_spec.rb → git_commit_notifier/git_spec.rb} +4 -6
- data/spec/lib/{logger_spec.rb → git_commit_notifier/logger_spec.rb} +4 -7
- data/spec/lib/{result_processor_spec.rb → git_commit_notifier/result_processor_spec.rb} +4 -2
- data/template/email.html.erb +1 -1
- metadata +150 -50
- data/.gitignore +0 -21
- data/lib/commit_hook.rb +0 -129
- data/lib/diff_to_html.rb +0 -449
- data/lib/result_processor.rb +0 -126
@@ -1,10 +1,10 @@
|
|
1
|
-
require File.expand_path('
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
2
|
|
3
|
-
require '
|
4
|
-
require 'emailer'
|
3
|
+
require 'git_commit_notifier'
|
5
4
|
|
6
|
-
|
5
|
+
include GitCommitNotifier
|
7
6
|
|
7
|
+
describe Emailer do
|
8
8
|
describe :new do
|
9
9
|
it "should assign config if given" do
|
10
10
|
Emailer.new({:a => :b}).config[:a].should == :b
|
@@ -16,13 +16,6 @@ describe Emailer do
|
|
16
16
|
cfg.should be_empty
|
17
17
|
end
|
18
18
|
|
19
|
-
it "should not generate message from template" do
|
20
|
-
any_instance_of(Emailer) do |emailer|
|
21
|
-
dont_allow(emailer).generate_message
|
22
|
-
end
|
23
|
-
Emailer.new({})
|
24
|
-
end
|
25
|
-
|
26
19
|
it "should assign parameters from options" do
|
27
20
|
options = {}
|
28
21
|
Emailer::PARAMETERS.each do |name|
|
@@ -50,15 +43,14 @@ describe Emailer do
|
|
50
43
|
end
|
51
44
|
end
|
52
45
|
|
53
|
-
describe :
|
54
|
-
it "should
|
46
|
+
describe :mail_html_message do
|
47
|
+
it "should form inline html" do
|
55
48
|
options = {}
|
56
49
|
Emailer::PARAMETERS.each do |name|
|
57
50
|
options[name.to_sym] = Faker::Lorem.sentence
|
58
51
|
end
|
59
52
|
emailer = Emailer.new({}, options)
|
60
|
-
emailer.
|
61
|
-
emailer.instance_variable_get(:@html).should match(/html/)
|
53
|
+
emailer.mail_html_message.should match(/html/)
|
62
54
|
end
|
63
55
|
end
|
64
56
|
|
@@ -88,15 +80,12 @@ describe Emailer do
|
|
88
80
|
end
|
89
81
|
|
90
82
|
it "should return ERB template unless Erubis installed" do
|
83
|
+
require 'erb'
|
91
84
|
mock(Emailer).require('erubis') { raise LoadError.new('erubis') }
|
92
85
|
mock(Emailer).require('erb')
|
93
86
|
mock.proxy(ERB).new('erb')
|
87
|
+
|
94
88
|
Emailer.template.should be_kind_of(ERB)
|
95
89
|
end
|
96
90
|
end
|
97
91
|
end
|
98
|
-
|
99
|
-
__END__
|
100
|
-
|
101
|
-
vim: tabstop=2 expandtab shiftwidth=2
|
102
|
-
|
@@ -1,5 +1,7 @@
|
|
1
|
-
require File.expand_path('
|
2
|
-
require '
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
require 'git_commit_notifier'
|
3
|
+
|
4
|
+
include GitCommitNotifier
|
3
5
|
|
4
6
|
describe Git do
|
5
7
|
SAMPLE_REV = '51b986619d88f7ba98be7d271188785cbbb541a0'.freeze
|
@@ -87,7 +89,3 @@ describe Git do
|
|
87
89
|
end
|
88
90
|
|
89
91
|
end
|
90
|
-
|
91
|
-
__END__
|
92
|
-
|
93
|
-
vim: tabstop=2 expandtab shiftwidth=2
|
@@ -1,8 +1,9 @@
|
|
1
|
-
require File.expand_path('
|
2
|
-
require '
|
1
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
2
|
+
require 'git_commit_notifier'
|
3
3
|
|
4
|
-
|
4
|
+
include GitCommitNotifier
|
5
5
|
|
6
|
+
describe Logger do
|
6
7
|
describe :debug? do
|
7
8
|
it "should be false unless debug section exists" do
|
8
9
|
logger = Logger.new({})
|
@@ -57,7 +58,3 @@ describe Logger do
|
|
57
58
|
end
|
58
59
|
end
|
59
60
|
end
|
60
|
-
|
61
|
-
__END__
|
62
|
-
|
63
|
-
vim: tabstop=2 expandtab shiftwidth=2
|
@@ -1,7 +1,9 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
require File.expand_path('
|
4
|
-
require '
|
3
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
4
|
+
require 'git_commit_notifier'
|
5
|
+
|
6
|
+
include GitCommitNotifier
|
5
7
|
|
6
8
|
describe ResultProcessor do
|
7
9
|
before(:all) do
|
data/template/email.html.erb
CHANGED
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
7
|
+
- 9
|
8
|
+
- 0
|
9
|
+
version: 0.9.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Bodo Tasche
|
@@ -14,12 +14,11 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2011-04-04 00:00:00 +02:00
|
18
18
|
default_executable: git-commit-notifier
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: diff-lcs
|
22
|
-
prerelease: false
|
23
22
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
23
|
none: false
|
25
24
|
requirements:
|
@@ -29,10 +28,10 @@ dependencies:
|
|
29
28
|
- 0
|
30
29
|
version: "0"
|
31
30
|
type: :runtime
|
31
|
+
prerelease: false
|
32
32
|
version_requirements: *id001
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
35
|
-
prerelease: false
|
34
|
+
name: nntp
|
36
35
|
requirement: &id002 !ruby/object:Gem::Requirement
|
37
36
|
none: false
|
38
37
|
requirements:
|
@@ -42,23 +41,25 @@ dependencies:
|
|
42
41
|
- 0
|
43
42
|
version: "0"
|
44
43
|
type: :runtime
|
44
|
+
prerelease: false
|
45
45
|
version_requirements: *id002
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
|
-
name:
|
48
|
-
prerelease: false
|
47
|
+
name: premailer
|
49
48
|
requirement: &id003 !ruby/object:Gem::Requirement
|
50
49
|
none: false
|
51
50
|
requirements:
|
52
|
-
- -
|
51
|
+
- - ~>
|
53
52
|
- !ruby/object:Gem::Version
|
54
53
|
segments:
|
55
|
-
-
|
56
|
-
|
54
|
+
- 1
|
55
|
+
- 7
|
56
|
+
- 1
|
57
|
+
version: 1.7.1
|
57
58
|
type: :runtime
|
59
|
+
prerelease: false
|
58
60
|
version_requirements: *id003
|
59
61
|
- !ruby/object:Gem::Dependency
|
60
|
-
name:
|
61
|
-
prerelease: false
|
62
|
+
name: nokogiri
|
62
63
|
requirement: &id004 !ruby/object:Gem::Requirement
|
63
64
|
none: false
|
64
65
|
requirements:
|
@@ -68,10 +69,10 @@ dependencies:
|
|
68
69
|
- 0
|
69
70
|
version: "0"
|
70
71
|
type: :runtime
|
72
|
+
prerelease: false
|
71
73
|
version_requirements: *id004
|
72
74
|
- !ruby/object:Gem::Dependency
|
73
|
-
name:
|
74
|
-
prerelease: false
|
75
|
+
name: jeweler
|
75
76
|
requirement: &id005 !ruby/object:Gem::Requirement
|
76
77
|
none: false
|
77
78
|
requirements:
|
@@ -81,10 +82,10 @@ dependencies:
|
|
81
82
|
- 0
|
82
83
|
version: "0"
|
83
84
|
type: :development
|
85
|
+
prerelease: false
|
84
86
|
version_requirements: *id005
|
85
87
|
- !ruby/object:Gem::Dependency
|
86
|
-
name:
|
87
|
-
prerelease: false
|
88
|
+
name: code-cleaner
|
88
89
|
requirement: &id006 !ruby/object:Gem::Requirement
|
89
90
|
none: false
|
90
91
|
requirements:
|
@@ -94,10 +95,10 @@ dependencies:
|
|
94
95
|
- 0
|
95
96
|
version: "0"
|
96
97
|
type: :development
|
98
|
+
prerelease: false
|
97
99
|
version_requirements: *id006
|
98
100
|
- !ruby/object:Gem::Dependency
|
99
|
-
name:
|
100
|
-
prerelease: false
|
101
|
+
name: metric_fu
|
101
102
|
requirement: &id007 !ruby/object:Gem::Requirement
|
102
103
|
none: false
|
103
104
|
requirements:
|
@@ -107,10 +108,10 @@ dependencies:
|
|
107
108
|
- 0
|
108
109
|
version: "0"
|
109
110
|
type: :development
|
111
|
+
prerelease: false
|
110
112
|
version_requirements: *id007
|
111
113
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
113
|
-
prerelease: false
|
114
|
+
name: diff-lcs
|
114
115
|
requirement: &id008 !ruby/object:Gem::Requirement
|
115
116
|
none: false
|
116
117
|
requirements:
|
@@ -119,11 +120,11 @@ dependencies:
|
|
119
120
|
segments:
|
120
121
|
- 0
|
121
122
|
version: "0"
|
122
|
-
type: :
|
123
|
+
type: :runtime
|
124
|
+
prerelease: false
|
123
125
|
version_requirements: *id008
|
124
126
|
- !ruby/object:Gem::Dependency
|
125
|
-
name:
|
126
|
-
prerelease: false
|
127
|
+
name: nntp
|
127
128
|
requirement: &id009 !ruby/object:Gem::Requirement
|
128
129
|
none: false
|
129
130
|
requirements:
|
@@ -132,12 +133,40 @@ dependencies:
|
|
132
133
|
segments:
|
133
134
|
- 0
|
134
135
|
version: "0"
|
135
|
-
type: :
|
136
|
+
type: :runtime
|
137
|
+
prerelease: false
|
136
138
|
version_requirements: *id009
|
137
139
|
- !ruby/object:Gem::Dependency
|
138
|
-
name:
|
139
|
-
prerelease: false
|
140
|
+
name: premailer
|
140
141
|
requirement: &id010 !ruby/object:Gem::Requirement
|
142
|
+
none: false
|
143
|
+
requirements:
|
144
|
+
- - ~>
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
segments:
|
147
|
+
- 1
|
148
|
+
- 7
|
149
|
+
- 1
|
150
|
+
version: 1.7.1
|
151
|
+
type: :runtime
|
152
|
+
prerelease: false
|
153
|
+
version_requirements: *id010
|
154
|
+
- !ruby/object:Gem::Dependency
|
155
|
+
name: nokogiri
|
156
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
157
|
+
none: false
|
158
|
+
requirements:
|
159
|
+
- - ">="
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
segments:
|
162
|
+
- 0
|
163
|
+
version: "0"
|
164
|
+
type: :runtime
|
165
|
+
prerelease: false
|
166
|
+
version_requirements: *id011
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: rspec-core
|
169
|
+
requirement: &id012 !ruby/object:Gem::Requirement
|
141
170
|
none: false
|
142
171
|
requirements:
|
143
172
|
- - ">="
|
@@ -146,7 +175,73 @@ dependencies:
|
|
146
175
|
- 0
|
147
176
|
version: "0"
|
148
177
|
type: :development
|
149
|
-
|
178
|
+
prerelease: false
|
179
|
+
version_requirements: *id012
|
180
|
+
- !ruby/object:Gem::Dependency
|
181
|
+
name: rspec-expectations
|
182
|
+
requirement: &id013 !ruby/object:Gem::Requirement
|
183
|
+
none: false
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
segments:
|
188
|
+
- 0
|
189
|
+
version: "0"
|
190
|
+
type: :development
|
191
|
+
prerelease: false
|
192
|
+
version_requirements: *id013
|
193
|
+
- !ruby/object:Gem::Dependency
|
194
|
+
name: rr
|
195
|
+
requirement: &id014 !ruby/object:Gem::Requirement
|
196
|
+
none: false
|
197
|
+
requirements:
|
198
|
+
- - ">="
|
199
|
+
- !ruby/object:Gem::Version
|
200
|
+
segments:
|
201
|
+
- 0
|
202
|
+
version: "0"
|
203
|
+
type: :development
|
204
|
+
prerelease: false
|
205
|
+
version_requirements: *id014
|
206
|
+
- !ruby/object:Gem::Dependency
|
207
|
+
name: faker
|
208
|
+
requirement: &id015 !ruby/object:Gem::Requirement
|
209
|
+
none: false
|
210
|
+
requirements:
|
211
|
+
- - ">="
|
212
|
+
- !ruby/object:Gem::Version
|
213
|
+
segments:
|
214
|
+
- 0
|
215
|
+
version: "0"
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: *id015
|
219
|
+
- !ruby/object:Gem::Dependency
|
220
|
+
name: rcov
|
221
|
+
requirement: &id016 !ruby/object:Gem::Requirement
|
222
|
+
none: false
|
223
|
+
requirements:
|
224
|
+
- - ">="
|
225
|
+
- !ruby/object:Gem::Version
|
226
|
+
segments:
|
227
|
+
- 0
|
228
|
+
version: "0"
|
229
|
+
type: :development
|
230
|
+
prerelease: false
|
231
|
+
version_requirements: *id016
|
232
|
+
- !ruby/object:Gem::Dependency
|
233
|
+
name: metric_fu
|
234
|
+
requirement: &id017 !ruby/object:Gem::Requirement
|
235
|
+
none: false
|
236
|
+
requirements:
|
237
|
+
- - ">="
|
238
|
+
- !ruby/object:Gem::Version
|
239
|
+
segments:
|
240
|
+
- 0
|
241
|
+
version: "0"
|
242
|
+
type: :development
|
243
|
+
prerelease: false
|
244
|
+
version_requirements: *id017
|
150
245
|
description: This git commit notifier sends html mails with nice diffs for every changed file.
|
151
246
|
email: bodo@bitboxer.de
|
152
247
|
executables:
|
@@ -158,7 +253,8 @@ extra_rdoc_files:
|
|
158
253
|
- README.textile
|
159
254
|
files:
|
160
255
|
- .document
|
161
|
-
-
|
256
|
+
- Gemfile
|
257
|
+
- Gemfile.lock
|
162
258
|
- LICENSE
|
163
259
|
- README.textile
|
164
260
|
- Rakefile
|
@@ -166,15 +262,19 @@ files:
|
|
166
262
|
- bin/git-commit-notifier
|
167
263
|
- config/git-notifier-config.yml.sample
|
168
264
|
- git-commit-notifier.gemspec
|
169
|
-
- lib/
|
170
|
-
- lib/
|
171
|
-
- lib/
|
172
|
-
- lib/
|
173
|
-
- lib/
|
174
|
-
- lib/
|
265
|
+
- lib/git_commit_notifier.rb
|
266
|
+
- lib/git_commit_notifier/commit_hook.rb
|
267
|
+
- lib/git_commit_notifier/diff_callback.rb
|
268
|
+
- lib/git_commit_notifier/diff_to_html.rb
|
269
|
+
- lib/git_commit_notifier/emailer.rb
|
270
|
+
- lib/git_commit_notifier/escape_helper.rb
|
271
|
+
- lib/git_commit_notifier/git.rb
|
272
|
+
- lib/git_commit_notifier/logger.rb
|
273
|
+
- lib/git_commit_notifier/result_processor.rb
|
175
274
|
- spec/fixtures/existing_file_one_line.txt
|
176
275
|
- spec/fixtures/git-notifier-group-email-by-push.yml
|
177
276
|
- spec/fixtures/git-notifier-ignore-merge.yml
|
277
|
+
- spec/fixtures/git-notifier-with-branch-restrictions.yml
|
178
278
|
- spec/fixtures/git-notifier-with-merge.yml
|
179
279
|
- spec/fixtures/git_log
|
180
280
|
- spec/fixtures/git_show_055850e7d925110322b8db4e17c3b840d76e144c
|
@@ -184,12 +284,12 @@ files:
|
|
184
284
|
- spec/fixtures/git_show_e28ad77bba0574241e6eb64dfd0c1291b221effe
|
185
285
|
- spec/fixtures/git_show_ff037a73fc1094455e7bbf506171a3f3cf873ae6
|
186
286
|
- spec/fixtures/new_file_one_line.txt
|
187
|
-
- spec/lib/commit_hook_spec.rb
|
188
|
-
- spec/lib/diff_to_html_spec.rb
|
189
|
-
- spec/lib/emailer_spec.rb
|
190
|
-
- spec/lib/git_spec.rb
|
191
|
-
- spec/lib/logger_spec.rb
|
192
|
-
- spec/lib/result_processor_spec.rb
|
287
|
+
- spec/lib/git_commit_notifier/commit_hook_spec.rb
|
288
|
+
- spec/lib/git_commit_notifier/diff_to_html_spec.rb
|
289
|
+
- spec/lib/git_commit_notifier/emailer_spec.rb
|
290
|
+
- spec/lib/git_commit_notifier/git_spec.rb
|
291
|
+
- spec/lib/git_commit_notifier/logger_spec.rb
|
292
|
+
- spec/lib/git_commit_notifier/result_processor_spec.rb
|
193
293
|
- spec/spec_helper.rb
|
194
294
|
- template/email.html.erb
|
195
295
|
- template/styles.css
|
@@ -198,8 +298,8 @@ homepage: http://github.com/bitboxer/git-commit-notifier
|
|
198
298
|
licenses: []
|
199
299
|
|
200
300
|
post_install_message:
|
201
|
-
rdoc_options:
|
202
|
-
|
301
|
+
rdoc_options: []
|
302
|
+
|
203
303
|
require_paths:
|
204
304
|
- lib
|
205
305
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -226,10 +326,10 @@ signing_key:
|
|
226
326
|
specification_version: 3
|
227
327
|
summary: Sends git commit messages with diffs
|
228
328
|
test_files:
|
229
|
-
- spec/lib/commit_hook_spec.rb
|
230
|
-
- spec/lib/diff_to_html_spec.rb
|
231
|
-
- spec/lib/emailer_spec.rb
|
232
|
-
- spec/lib/git_spec.rb
|
233
|
-
- spec/lib/logger_spec.rb
|
234
|
-
- spec/lib/result_processor_spec.rb
|
329
|
+
- spec/lib/git_commit_notifier/commit_hook_spec.rb
|
330
|
+
- spec/lib/git_commit_notifier/diff_to_html_spec.rb
|
331
|
+
- spec/lib/git_commit_notifier/emailer_spec.rb
|
332
|
+
- spec/lib/git_commit_notifier/git_spec.rb
|
333
|
+
- spec/lib/git_commit_notifier/logger_spec.rb
|
334
|
+
- spec/lib/git_commit_notifier/result_processor_spec.rb
|
235
335
|
- spec/spec_helper.rb
|