zabbix_vhost 0.6.0 → 0.6.3

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: '0283375e8a145accff8dcd461653f9db7543b8d0'
4
- data.tar.gz: 6866a7046dc830e8eea1de8bf30ca9811a21e4c7
3
+ metadata.gz: 7e140ffbb7a8e7bdd27f7f2f62d5527a6ed74bee
4
+ data.tar.gz: a08706add8285bb358f9fdae5b65bd432010d994
5
5
  SHA512:
6
- metadata.gz: 92ba9dbc887a713f185c47099524022a6245743e6c2e57fe77925f0248d730ba5d5d921afe6c0430fdcb708da05f2cc17e25c9e25676149d3afbe1b63b88df76
7
- data.tar.gz: b5e1ea7af69edd3f93591a72726e368d64d5d00864c55cf7daa37743960a3e54b2a1469dd4fbc1ea1293bfa1730972433608cae3fec87f632af2c888c0ce9734
6
+ metadata.gz: 20bd8ad27db30629a997f34d0b94cbe356c2b234a406e84ba09f0d24a7ae9d3b3c09933dbb97fbcca17b0efbbe4fc9d910e8b4682456a378b239f22466952e5f
7
+ data.tar.gz: 53f5070c150af561ec94df7ffca46338e0d047cdd77dd2d3e2a12cc8536caeb08054128c1a7753196f8bbe366c491165977e4428bbd9a4d326f69c6399992b96
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zabbix_vhost (0.2.0)
4
+ zabbix_vhost (0.6.2)
5
5
  thor
6
6
 
7
7
  GEM
@@ -14,11 +14,14 @@ module ZabbixVhost
14
14
 
15
15
 
16
16
  data = configurations.collect do |c|
17
- {
18
- "{#DOMAIN}" => c.server_name,
19
- "{#CONFIG_FILE}" => c.file_path
20
- }
21
- end
17
+
18
+ unless c.server_name.nil?
19
+ {
20
+ "{#DOMAIN}" => c.server_name,
21
+ "{#CONFIG_FILE}" => c.file_path
22
+ }
23
+ end
24
+ end.compact
22
25
 
23
26
  print JSON.generate({data: data})
24
27
 
@@ -19,10 +19,10 @@ module ZabbixVhost
19
19
  @config_content = File.read(@file_path)
20
20
  ## Controlliamo se siamo in apache
21
21
  if_apache do
22
- @server_name = @config_content.match(/^\s?ServerName (?<server_name>.*)/)[:server_name]
22
+ @server_name = @config_content.match(/^\s*ServerName (?<server_name>.*)/)[:server_name]
23
23
 
24
- if @config_content.match(/^\s?ServerAlias/)
25
- @server_alias = @config_content.match(/^\s?ServerAlias (?<names>.*)/)[:names].split(" ")
24
+ if @config_content.match(/^\s*ServerAlias/)
25
+ @server_alias = @config_content.match(/^\s*ServerAlias (?<names>.*)/)[:names].split(" ")
26
26
  end
27
27
 
28
28
  @ssl_active = !@config_content.match(/443/).nil?
@@ -78,7 +78,7 @@ module ZabbixVhost
78
78
  private
79
79
 
80
80
  def if_apache
81
- if @config_content.match(/^\s?ServerName/)
81
+ if @config_content.match(/^\s*ServerName/)
82
82
  yield
83
83
  end
84
84
  end
@@ -1,3 +1,3 @@
1
1
  module ZabbixVhost
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zabbix_vhost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marino Bonetti