site_hook 1.0.9 → 1.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/site_hook/config.rb +6 -46
- data/lib/site_hook/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27d013b10b57b75e8037dc4f58b699a8b312964f140ad616cb8e0c0731e69544
|
4
|
+
data.tar.gz: 41dd918335251618464b892f92d2f49b932fdd23345eb0071a3183f77360e0e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c83770fd4e80fb5283caa9441fdada3e709f17eac683ed5c6cd38d4a84bd28ab8e019515d7c0ce3301a00d6104d311c8216e21dfc944746b3d095eb634a8302d
|
7
|
+
data.tar.gz: 0fbb283cf55858ac873517d79a32db6b29f80d5710e280b3cf97971ba21ea15bc40f061db5c548bc04be6283a50f1626963bca34cef6ca3c4f04ffcc0a059bf9
|
data/lib/site_hook/config.rb
CHANGED
@@ -5,48 +5,7 @@ require "site_hook/prelogger"
|
|
5
5
|
|
6
6
|
module SiteHook
|
7
7
|
class Config
|
8
|
-
|
9
|
-
# def self.validate(config)
|
10
|
-
# config.each do |section, hsh|
|
11
|
-
# case section.to_s
|
12
|
-
# when 'webhook'
|
13
|
-
# if hsh['port']
|
14
|
-
# port_validity = [
|
15
|
-
# hsh['port'].respond_to?(:to_i),
|
16
|
-
# hsh['port'].is_a?(Integer)
|
17
|
-
# ].drop_while(&:!)
|
18
|
-
# SiteHook::PreLogger.debug port_validity
|
19
|
-
# else
|
20
|
-
# raise InvalidConfigError 'webhook', index
|
21
|
-
# end
|
22
|
-
# if hsh['host']
|
23
|
-
# host_validity = [
|
24
|
-
# hsh['host'].respond_to?(:to_s)
|
25
|
-
#
|
26
|
-
# ]
|
27
|
-
# end
|
28
|
-
# [port_validity]
|
29
|
-
# when 'log_levels'
|
30
|
-
#
|
31
|
-
# when 'cli'
|
32
|
-
# when 'projects'
|
33
|
-
# when 'out'
|
34
|
-
# if hsh['out'].keys
|
35
|
-
# hsh['out'].keys.each do |key|
|
36
|
-
# case key
|
37
|
-
# when 'discord'
|
38
|
-
# when 'irc'
|
39
|
-
# else
|
40
|
-
# raise InvalidConfigError 'out', "#{key} is an invalid out service"
|
41
|
-
# end
|
42
|
-
# end
|
43
|
-
# end
|
44
|
-
# else
|
45
|
-
# raise UnknownFieldError section
|
46
|
-
# end
|
47
|
-
# end
|
48
|
-
# end
|
49
|
-
|
8
|
+
|
50
9
|
def inspect
|
51
10
|
meths = %i[webhook log_levels cli projects]
|
52
11
|
sections = {}
|
@@ -73,6 +32,7 @@ module SiteHook
|
|
73
32
|
def initialize
|
74
33
|
@@config = {}
|
75
34
|
@@filename = SiteHook::Paths.default_config
|
35
|
+
puts @@filename
|
76
36
|
begin
|
77
37
|
@@config = YAML.load_file(@@filename)
|
78
38
|
puts @@config
|
@@ -86,22 +46,22 @@ module SiteHook
|
|
86
46
|
|
87
47
|
# @return [Webhook]
|
88
48
|
def self.webhook
|
89
|
-
Webhook.new(@@config[
|
49
|
+
Webhook.new(@@config['webhook'])
|
90
50
|
end
|
91
51
|
|
92
52
|
# @return [Projects]
|
93
53
|
def self.projects
|
94
|
-
Projects.new(@@config[
|
54
|
+
Projects.new(@@config['projects'])
|
95
55
|
end
|
96
56
|
|
97
57
|
# @return [Cli]
|
98
58
|
def self.cli
|
99
|
-
Cli.new(@@config[
|
59
|
+
Cli.new(@@config['cli'])
|
100
60
|
end
|
101
61
|
|
102
62
|
# @return [LogLevels]
|
103
63
|
def self.log_levels
|
104
|
-
LogLevels.new(@@config[
|
64
|
+
LogLevels.new(@@config['log_levels'])
|
105
65
|
end
|
106
66
|
end
|
107
67
|
|
data/lib/site_hook/version.rb
CHANGED