hato 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +23 -26
- data/lib/hato/config.rb +5 -1
- data/lib/hato/version.rb +1 -1
- data/spec/assets/config/test.rb +20 -24
- data/spec/lib/{pigeon → hato}/config_spec.rb +7 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cede082c4d5590b359033a018197adabe7160ef
|
4
|
+
data.tar.gz: 97a83788feb34dce3e3180f98fc4a1a7fec7d84f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f08a21f559fffad23aeb1465b2809cdbbd896809c124c7c928aa80415bc49dd398f822665a4aa9dfaab78f370be3d3731df80ebc343ca7dbec5cec8e4a548f9
|
7
|
+
data.tar.gz: 95b893b89b4604b315692aa576289de2c5ab5ca9d75570fee9e08ed1040790d8468db4e831f5ee61cc5a2fbb6b4688f1659fd6b9a6cac17711cac9b2b90e5283
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Hato [![BuildStatus](https://secure.travis-ci.org/kentaro/hato.png)](http://travis-ci.org/kentaro/hato)
|
2
2
|
|
3
|
-
Hato is a tool to manage notification methods. Once you configure notification methods, you can send
|
3
|
+
Hato is a tool to manage various notification methods. Once you configure notification methods, you can send messages via the methods just by posting them to Hato.
|
4
4
|
|
5
5
|
## Usage
|
6
6
|
|
@@ -24,27 +24,25 @@ e.g. config.rb:
|
|
24
24
|
|
25
25
|
```
|
26
26
|
Hato::Config.define do
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
api_key 'test'
|
28
|
+
host '0.0.0.0'
|
29
|
+
port 9699
|
30
30
|
|
31
31
|
tag 'test' do
|
32
32
|
plugin 'Ikachan' do
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
scheme 'http'
|
34
|
+
host 'irc.example.com'
|
35
|
+
port 4979
|
36
|
+
channel 'hato'
|
37
37
|
end
|
38
38
|
|
39
39
|
plugin 'Mail' do
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
enable_ssl: true,
|
47
|
-
}
|
40
|
+
smtp address: 'smtp.example.com',
|
41
|
+
port: 587,
|
42
|
+
domain: 'example',
|
43
|
+
user_name: 'hato',
|
44
|
+
password: 'password',
|
45
|
+
enable_ssl: true
|
48
46
|
|
49
47
|
subject_template = <<EOS
|
50
48
|
[<%= args[:tag] %>] Notification
|
@@ -55,15 +53,13 @@ You've got a message:
|
|
55
53
|
<%= args[:message] %>
|
56
54
|
EOS
|
57
55
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
body_template: body_template,
|
66
|
-
}
|
56
|
+
message from: 'hato@example.com',
|
57
|
+
to: [
|
58
|
+
'foo@example.com',
|
59
|
+
'bar@example.com',
|
60
|
+
],
|
61
|
+
subject_template: subject_template,
|
62
|
+
body_template: body_template
|
67
63
|
end
|
68
64
|
end
|
69
65
|
end
|
@@ -86,7 +82,7 @@ At first, create a `Gemfile` to manage dependencies:
|
|
86
82
|
source 'https://rubygems.org'
|
87
83
|
|
88
84
|
gem 'hato'
|
89
|
-
gem 'hato
|
85
|
+
gem 'hato-plugin-awesome_plugin'
|
90
86
|
```
|
91
87
|
|
92
88
|
Then, execute `bundle exec hato -c your_config_file`
|
@@ -112,3 +108,4 @@ Or install it yourself as:
|
|
112
108
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
113
109
|
4. Push to the branch (`git push origin my-new-feature`)
|
114
110
|
5. Create new Pull Request
|
111
|
+
|
data/lib/hato/config.rb
CHANGED
data/lib/hato/version.rb
CHANGED
data/spec/assets/config/test.rb
CHANGED
@@ -1,25 +1,23 @@
|
|
1
1
|
Hato::Config.define do
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
api_key 'test'
|
3
|
+
host '0.0.0.0'
|
4
|
+
port 9699
|
5
5
|
|
6
6
|
tag 'test' do
|
7
7
|
plugin 'Ikachan' do
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
scheme 'http'
|
9
|
+
host 'irc.example.com'
|
10
|
+
port 4979
|
11
|
+
channel 'hato'
|
12
12
|
end
|
13
13
|
|
14
14
|
plugin 'Mail' do
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
enable_ssl: true,
|
22
|
-
}
|
15
|
+
smtp address: 'smtp.example.com',
|
16
|
+
port: 587,
|
17
|
+
domain: 'example',
|
18
|
+
user_name: 'hato',
|
19
|
+
password: 'password',
|
20
|
+
enable_ssl: true
|
23
21
|
|
24
22
|
subject_template = <<EOS
|
25
23
|
[<%= args[:tag] %>] Notification
|
@@ -30,15 +28,13 @@ You've got a message:
|
|
30
28
|
<%= args[:message] %>
|
31
29
|
EOS
|
32
30
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
body_template: body_template,
|
41
|
-
}
|
31
|
+
message from: 'hato@example.com',
|
32
|
+
to: [
|
33
|
+
'foo@example.com',
|
34
|
+
'bar@example.com',
|
35
|
+
],
|
36
|
+
subject_template: subject_template,
|
37
|
+
body_template: body_template
|
42
38
|
end
|
43
39
|
end
|
44
40
|
end
|
@@ -46,9 +46,13 @@ describe Hato::Config do
|
|
46
46
|
expect(tag.plugins).to be_an_instance_of Array
|
47
47
|
expect(tag.plugins.size).to be == 2
|
48
48
|
|
49
|
-
|
50
|
-
expect(
|
51
|
-
expect(
|
49
|
+
ikachan = tag.plugins[0]
|
50
|
+
expect(ikachan.name).to be == 'Ikachan'
|
51
|
+
expect(ikachan.host).to be == 'irc.example.com'
|
52
|
+
|
53
|
+
mail = tag.plugins[1]
|
54
|
+
expect(mail.message).to be_an_instance_of Hashie::Mash
|
55
|
+
expect(mail.message['from']).to be == 'hato@example.com'
|
52
56
|
}
|
53
57
|
end
|
54
58
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hato
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kentaro Kuribayashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|
@@ -147,7 +147,7 @@ files:
|
|
147
147
|
- lib/hato/plugin/mail.rb
|
148
148
|
- lib/hato/version.rb
|
149
149
|
- spec/assets/config/test.rb
|
150
|
-
- spec/lib/
|
150
|
+
- spec/lib/hato/config_spec.rb
|
151
151
|
- spec/spec_helper.rb
|
152
152
|
homepage: https://github.com/kentaro/hato
|
153
153
|
licenses:
|
@@ -175,5 +175,5 @@ specification_version: 4
|
|
175
175
|
summary: A Notification Management Tools
|
176
176
|
test_files:
|
177
177
|
- spec/assets/config/test.rb
|
178
|
-
- spec/lib/
|
178
|
+
- spec/lib/hato/config_spec.rb
|
179
179
|
- spec/spec_helper.rb
|