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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5fe3e66d94387bfb241134543a24c6e6a04fe96b7ac3e033e979c23015376816
4
- data.tar.gz: 4d04a9bf0c0a07f56000536272c9ce5b72fd32cfec655115d4b760858071c3a6
3
+ metadata.gz: 27d013b10b57b75e8037dc4f58b699a8b312964f140ad616cb8e0c0731e69544
4
+ data.tar.gz: 41dd918335251618464b892f92d2f49b932fdd23345eb0071a3183f77360e0e1
5
5
  SHA512:
6
- metadata.gz: 1cb1739028e9368e311c207cee044cf6f391014a40c6d3f6360fa0f63742c61e11bd780a2c211b08c46088dc7c19661dd7211568a67d3fc226111b91c2ba543d
7
- data.tar.gz: 9a5e9132b40ee84f5358e979068586921033b81a458847d007155d1260f6ce8ba0d624cb1d6ad9538ff88edc00613215315d97abe7d518c153b93386ec75ca55
6
+ metadata.gz: c83770fd4e80fb5283caa9441fdada3e709f17eac683ed5c6cd38d4a84bd28ab8e019515d7c0ce3301a00d6104d311c8216e21dfc944746b3d095eb634a8302d
7
+ data.tar.gz: 0fbb283cf55858ac873517d79a32db6b29f80d5710e280b3cf97971ba21ea15bc40f061db5c548bc04be6283a50f1626963bca34cef6ca3c4f04ffcc0a059bf9
@@ -5,48 +5,7 @@ require "site_hook/prelogger"
5
5
 
6
6
  module SiteHook
7
7
  class Config
8
- @@config = {}
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[:webhook])
49
+ Webhook.new(@@config['webhook'])
90
50
  end
91
51
 
92
52
  # @return [Projects]
93
53
  def self.projects
94
- Projects.new(@@config[:projects])
54
+ Projects.new(@@config['projects'])
95
55
  end
96
56
 
97
57
  # @return [Cli]
98
58
  def self.cli
99
- Cli.new(@@config[:cli])
59
+ Cli.new(@@config['cli'])
100
60
  end
101
61
 
102
62
  # @return [LogLevels]
103
63
  def self.log_levels
104
- LogLevels.new(@@config[:log_levels])
64
+ LogLevels.new(@@config['log_levels'])
105
65
  end
106
66
  end
107
67
 
@@ -1,3 +1,3 @@
1
1
  module SiteHook
2
- VERSION = '1.0.9'
2
+ VERSION = '1.0.10'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: site_hook
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Spencer