ruby-conf 2.6.1 → 2.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/ruby-conf.rb +20 -6
  3. data/ruby-conf.gemspec +1 -1
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.6.1
1
+ 2.6.2
data/lib/ruby-conf.rb CHANGED
@@ -17,7 +17,6 @@ module RubyConf
17
17
  @@conf = @@path = @@mtime = @@md5 = nil
18
18
 
19
19
  class << self
20
- def nil?() @@conf.nil? end
21
20
  def __rc_loaded_conf() { path:@@path, mtime:@@mtime, md5:@@md5 } end
22
21
  def __rc_conf() @@conf end
23
22
  def __rc_set_conf(conf = nil) @@conf, @@path, @@mtime, @@md5 = conf, nil, nil, nil end
@@ -28,12 +27,14 @@ module RubyConf
28
27
  RubyConf.out "[ruby-conf] Auto-Loaded config at path: #{path}"
29
28
  end
30
29
  end
31
- def method_missing(name, *args, &block)
30
+ def __rc_reload
32
31
  if @@mtime && @@mtime != File.mtime(@@path).to_i && @@md5 != Digest::MD5.hexdigest(File.read(@@path))
33
32
  RubyConf.err "[ruby-conf] Detected change in config file, reloading..."
34
33
  __rc_load(@@path)
35
34
  end
36
-
35
+ end
36
+ def method_missing(name, *args, &block)
37
+ __rc_reload
37
38
  if @@conf.nil?
38
39
  Find.find('.') do |path|
39
40
  next unless @@conf.nil? && path =~ /\.(?:rb|config|conf|#{EXTENTIONS.join('|')})$/
@@ -44,9 +45,22 @@ module RubyConf
44
45
  end
45
46
  @@conf.__send__(name, *args, &block)
46
47
  end
47
- def to_s() @@conf.to_s end
48
- def to_str() @@conf.to_str end
49
- def inspect() @@conf.inspect end
48
+ def to_s()
49
+ __rc_reload
50
+ @@conf.to_s
51
+ end
52
+ def to_str()
53
+ __rc_reload
54
+ @@conf.to_str
55
+ end
56
+ def inspect()
57
+ __rc_reload
58
+ @@conf.inspect
59
+ end
60
+ def nil?()
61
+ __rc_reload
62
+ @@conf.nil?
63
+ end
50
64
  end
51
65
  end
52
66
 
data/ruby-conf.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "ruby-conf"
8
- s.version = "2.6.1"
8
+ s.version = "2.6.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Curtis Schofield & Hollin Wilkins & Mason"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-conf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.1
4
+ version: 2.6.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -115,7 +115,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
115
  version: '0'
116
116
  segments:
117
117
  - 0
118
- hash: -3424616211258386183
118
+ hash: 1471615913494062975
119
119
  required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  none: false
121
121
  requirements: