multi_notifier 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -0
- data/README.md +3 -3
- data/lib/multi_notifier/builder.rb +1 -1
- data/lib/multi_notifier/middlewares/travis.rb +2 -2
- data/lib/multi_notifier/version.rb +1 -1
- data/spec/multi_notifier/builder_spec.rb +4 -3
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7373c4ca1c8ca29fbdf531e1ea10b26014894b59
|
4
|
+
data.tar.gz: 8837ce5546ca70a55051921d57ffeca29226bac3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75b253c1810c9392afb6e374ff849bd7fee4b135628b8843b8bee36377672fcf1a329bc2d6f214fb05619588133f958fa92e3d44ece997fd76f1d04ed9efcf0b
|
7
|
+
data.tar.gz: 2df23091c755bfb34fa2a37c4ff696a28e929f7f43159210928eb04eb11b2428ad44ca85a50f6b35e372e7b0842f3b37556058efae608ea7841f5779f88c9e1c
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -38,8 +38,8 @@ builder.adapter :mail,
|
|
38
38
|
:method => Rails.configuration.action_mailer.delivery_method, # delivery method
|
39
39
|
:settings => Rails.configuration.action_mailer.send("#{Rails.configuration.action_mailer.delivery_method}_settings") # deivery settings
|
40
40
|
},
|
41
|
-
:from => "
|
42
|
-
:to => "
|
41
|
+
:from => "from@owenou.com", # from email
|
42
|
+
:to => "to@owenou.com", # to email
|
43
43
|
:subject => "subject", # email subject
|
44
44
|
:text_body => mail_text_body, # email body in text
|
45
45
|
:html_body => mail_html_body # email body in html
|
@@ -47,7 +47,7 @@ builder.adapter :mail,
|
|
47
47
|
|
48
48
|
### Travis
|
49
49
|
|
50
|
-
The [travis middleware](https://github.com/jingweno/multi_notifier/blob/master/lib/multi_notifier/middlewares/travis.rb)
|
50
|
+
The [travis middleware](https://github.com/jingweno/multi_notifier/blob/master/lib/multi_notifier/middlewares/travis.rb) restarts the latest build with the provided repo.
|
51
51
|
|
52
52
|
```ruby
|
53
53
|
builder.adapter :travis,
|
@@ -10,7 +10,7 @@ module MultiNotifier
|
|
10
10
|
|
11
11
|
def use(type, configs = {})
|
12
12
|
require "multi_notifier/middlewares/#{type}"
|
13
|
-
adapter = "MultiNotifier::Middlewares::#{type.to_s.
|
13
|
+
adapter = "MultiNotifier::Middlewares::#{type.to_s.titleize.gsub(' ', '')}".constantize
|
14
14
|
adapters << adapter.new(configs)
|
15
15
|
|
16
16
|
adapter
|
@@ -11,8 +11,8 @@ module MultiNotifier
|
|
11
11
|
def notify
|
12
12
|
host = travis_pro? ? ::Travis::Client::PRO_URI : ::Travis::Client::ORG_URI
|
13
13
|
client = travis_client(host, access_token)
|
14
|
-
|
15
|
-
|
14
|
+
r = client.repo(repo)
|
15
|
+
r.last_build.restart
|
16
16
|
end
|
17
17
|
|
18
18
|
def travis_pro?
|
@@ -4,9 +4,10 @@ describe MultiNotifier::Builder do
|
|
4
4
|
it "builds adapter by types" do
|
5
5
|
builder = described_class.new
|
6
6
|
builder.use :mail
|
7
|
+
builder.use :travis
|
7
8
|
|
8
|
-
builder.adapters.size.should ==
|
9
|
-
|
10
|
-
|
9
|
+
builder.adapters.size.should == 2
|
10
|
+
builder.adapters.first.class.name.should == "MultiNotifier::Middlewares::Mail"
|
11
|
+
builder.adapters.last.class.name.should == "MultiNotifier::Middlewares::Travis"
|
11
12
|
end
|
12
13
|
end
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multi_notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jingwen Owen Ou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 3.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 3.0.0
|
27
27
|
description: Simple and flexbile library for sending notifications
|
@@ -31,7 +31,8 @@ executables: []
|
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
|
-
- .gitignore
|
34
|
+
- ".gitignore"
|
35
|
+
- ".travis.yml"
|
35
36
|
- Gemfile
|
36
37
|
- LICENSE.txt
|
37
38
|
- README.md
|
@@ -58,17 +59,17 @@ require_paths:
|
|
58
59
|
- lib
|
59
60
|
required_ruby_version: !ruby/object:Gem::Requirement
|
60
61
|
requirements:
|
61
|
-
- -
|
62
|
+
- - ">="
|
62
63
|
- !ruby/object:Gem::Version
|
63
64
|
version: '0'
|
64
65
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
66
|
requirements:
|
66
|
-
- -
|
67
|
+
- - ">="
|
67
68
|
- !ruby/object:Gem::Version
|
68
69
|
version: '0'
|
69
70
|
requirements: []
|
70
71
|
rubyforge_project:
|
71
|
-
rubygems_version: 2.0
|
72
|
+
rubygems_version: 2.2.0
|
72
73
|
signing_key:
|
73
74
|
specification_version: 4
|
74
75
|
summary: Simple and flexbile library for sending notifications
|