odania 0.0.21 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b671c7072f85953afe30ec8589a8f984cc8a8183
4
- data.tar.gz: e704fd38e458253a9608c2766100891df7c78336
3
+ metadata.gz: b9ffca23df7f0bcf704ee4dfeb787327b6d22513
4
+ data.tar.gz: 1c5ad5ec6aad793ca550ffc6d46ca6f22b8d7aa9
5
5
  SHA512:
6
- metadata.gz: 3a6bd18be224b93924931348883e82bb4a7775359cd210dfab21b1b61dcfbd5f6be0fadccbdab87c609ad65a111e87084c74485fa980457b62cae14988dba64b
7
- data.tar.gz: 1228bdbf0dfc98098ecf36dc071fb612a93226ab19b2aa162709a1f2981cb1ef1c3b06dd627455e0ad3cb13ef1c513df92b00e552a4da09af4e57da1ec28d858
6
+ metadata.gz: 131db8a62b7dea4c0a3536e9058806b0bec5a1fc94c7241d1a33dc3d1c7574b328ef2700a57ff0e2ce1688d4808a8539c5b9755848ef936b9b6135ffd774c653
7
+ data.tar.gz: 491ea63fd9f1c76befb728d332ef9863dbe95da956f7586c6f6df314f52faabc62b7a2cb2572c472c35403b6d977693b63177a5154cee4421fa7533e4bfb005c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- odania (0.0.21)
4
+ odania (0.0.22)
5
5
  deep_merge
6
6
  diplomat
7
7
  erubis
data/lib/odania/plugin.rb CHANGED
@@ -36,16 +36,7 @@ module Odania
36
36
 
37
37
  # Generate a unique number for this instance of the plugin
38
38
  def get_plugin_instance_name(plugin_name)
39
- plugin_instance_name_file = "#{INSTANCE_FILES_PATH}#{plugin_name}"
40
-
41
- plugin_instance_name = nil
42
- plugin_instance_name = File.read plugin_instance_name_file if File.exist? plugin_instance_name_file
43
- return plugin_instance_name unless plugin_instance_name.nil?
44
-
45
- available_instances = @consul.service.get_all_for plugin_name
46
- plugin_instance_name = "#{plugin_name}_#{available_instances.length + 1}"
47
- File.write plugin_instance_name_file, plugin_instance_name
48
- plugin_instance_name
39
+ "#{plugin_name}_#{Socket.gethostname.gsub(/[^0-9a-zA-Z_]/, '_')}"
49
40
  end
50
41
 
51
42
  def plugin_config
@@ -54,20 +54,20 @@ module Odania
54
54
  register_plugin
55
55
  end
56
56
 
57
- def reload_config
58
- puts 'Updating varnish config'
59
- current_number = 0
60
- current_number = File.read('/tmp/current_varnish_config_number').to_i if File.exist? '/tmp/current_varnish_config_number'
61
- current_number += 1
62
- File.write '/tmp/current_varnish_config_number', current_number
63
-
64
- cmd = "varnishadm vcl.load reload#{current_number} /etc/varnish/default.vcl"
65
- puts "CMD: #{cmd}"
66
- puts `#{cmd}`
67
- cmd = "varnishadm vcl.use reload#{current_number}"
68
- puts "CMD: #{cmd}"
69
- puts `#{cmd}`
70
- end
57
+ def reload_config
58
+ puts 'Updating varnish config'
59
+ current_number = 0
60
+ current_number = File.read('/tmp/current_varnish_config_number').to_i if File.exist? '/tmp/current_varnish_config_number'
61
+ current_number += 1
62
+ File.write '/tmp/current_varnish_config_number', current_number
63
+
64
+ cmd = "varnishadm vcl.load reload#{current_number} /etc/varnish/default.vcl"
65
+ puts "CMD: #{cmd}"
66
+ puts `#{cmd}`
67
+ cmd = "varnishadm vcl.use reload#{current_number}"
68
+ puts "CMD: #{cmd}"
69
+ puts `#{cmd}`
70
+ end
71
71
 
72
72
  private
73
73
 
@@ -1,3 +1,3 @@
1
1
  module Odania
2
- VERSION = '0.0.21'
2
+ VERSION = '0.0.22'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: odania
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Petersen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-25 00:00:00.000000000 Z
11
+ date: 2016-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler