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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf96ac2f3fa1d6c8de28dd9e5f4a3e6f97d24def
4
- data.tar.gz: 60a15c63f3728bcc9099ecb086d108015901fb53
3
+ metadata.gz: 53c6f79540821b1c3b1ec329041188e11c25c615
4
+ data.tar.gz: 08756fb48fc621f6af758d81aab72b1de82ccd84
5
5
  SHA512:
6
- metadata.gz: bce2877832adb1b63563b28a2069a208afda82872d42921d40cae2e4147c9bc4e90af0b90bc7799b0b19135b2713fc139ca324d8415d1798bf1b8b5f7ca0abea
7
- data.tar.gz: 4d687794704552bbeb694a48dfa00d1b5fb6330b0630461965fb512c336b3bc557fd3423ddc3be840d9097598f05a3e36bc45f6550f4391a6da97e89d53d6264
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') { |v| opts[:config_file] = v }
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 = Config.load(opts[:config_file])
9
- observer = Observer.new(config)
10
- server = Httpd.new(observer, config)
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, @observer)
14
- App.set(:api_key, @config.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
@@ -1,3 +1,3 @@
1
1
  module Hato
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kentaro Kuribayashi