hato 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/hato +2 -1
- data/lib/hato.rb +4 -3
- data/lib/hato/httpd.rb +7 -2
- data/lib/hato/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53c6f79540821b1c3b1ec329041188e11c25c615
|
4
|
+
data.tar.gz: 08756fb48fc621f6af758d81aab72b1de82ccd84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da93bf70b724d042a7c3d3b533336340a83ad186487ab5f5338212dd1274c6181baf40d2d5c09140d7736b785f22d6b2823ce00c9c29774c976c987b4444b16a
|
7
|
+
data.tar.gz: ac6335fefa6dc11be76a59e4620998e303abcf223f59a766b0d544417a954df1f904238c67b5fc81279c9760600c0126a8466de7c61b6a70d99db5b119c4f395
|
data/bin/hato
CHANGED
@@ -6,7 +6,8 @@ require 'hato'
|
|
6
6
|
opts = {}
|
7
7
|
|
8
8
|
parser = OptionParser.new
|
9
|
-
parser.on('-c=VAL', '--config=VAL')
|
9
|
+
parser.on('-c=VAL', '--config=VAL') { |v| opts[:config_file] = v }
|
10
|
+
parser.on('-l=VAL', '--log-level=VAL') { |v| opts[:log_level] = v }
|
10
11
|
parser.parse!(ARGV)
|
11
12
|
|
12
13
|
Hato.run(opts)
|
data/lib/hato.rb
CHANGED
@@ -5,9 +5,10 @@ require 'hato/httpd'
|
|
5
5
|
|
6
6
|
module Hato
|
7
7
|
def self.run(opts = {})
|
8
|
-
config
|
9
|
-
|
10
|
-
|
8
|
+
config = Config.load(opts[:config_file])
|
9
|
+
config.log_level = opts[:log_level] || 'info'
|
10
|
+
observer = Observer.new(config)
|
11
|
+
server = Httpd.new(observer, config)
|
11
12
|
|
12
13
|
server.run
|
13
14
|
end
|
data/lib/hato/httpd.rb
CHANGED
@@ -10,8 +10,9 @@ module Hato
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def run
|
13
|
-
App.set(:observer,
|
14
|
-
App.set(:api_key,
|
13
|
+
App.set(:observer, @observer)
|
14
|
+
App.set(:api_key, @config.api_key)
|
15
|
+
App.set(:logger_level, @config.log_level)
|
15
16
|
|
16
17
|
Rack::Handler::WEBrick.run(
|
17
18
|
App.new,
|
@@ -59,6 +60,8 @@ module Hato
|
|
59
60
|
status: :error,
|
60
61
|
message: 'Missing mandatory header: `X-Github-Event`',
|
61
62
|
)
|
63
|
+
logger.info('Missing mandatory header: `X-Github-Event`')
|
64
|
+
logger.debug(request.env)
|
62
65
|
end
|
63
66
|
|
64
67
|
tag = ['webhook', owner, repository].join('.')
|
@@ -69,6 +72,8 @@ module Hato
|
|
69
72
|
status: :error,
|
70
73
|
message: 'Missing mandatory parameter: `payload`',
|
71
74
|
)
|
75
|
+
logger.info('Missing mandatory parameter: `payload`')
|
76
|
+
logger.debug(params)
|
72
77
|
end
|
73
78
|
|
74
79
|
settings.observer.update(
|
data/lib/hato/version.rb
CHANGED