ruby-conf 2.6.5 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/ruby-conf.rb +3 -3
- data/ruby-conf.gemspec +1 -1
- data/spec/lib/ruby-conf_spec.rb +3 -3
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7.0
|
data/lib/ruby-conf.rb
CHANGED
@@ -12,7 +12,7 @@ module RubyConf
|
|
12
12
|
def self.out(*objs) self.puts($stdout, *objs) end
|
13
13
|
|
14
14
|
class Loader < BasicObject
|
15
|
-
EXTENTIONS = %w{\\.rbc \\.rbcnf \\.rconf rbconf rbconfig rubyconf rubyconfig ruby-conf ruby-config}
|
15
|
+
EXTENTIONS = %w{\\.rc \\.rbc \\.rb \\.config \\.conf \\.rbcnf \\.rconf rbconf rbconfig rubyconf rubyconfig ruby-conf ruby-config}
|
16
16
|
|
17
17
|
@@conf = @@path = @@mtime = @@md5 = nil
|
18
18
|
|
@@ -37,8 +37,8 @@ module RubyConf
|
|
37
37
|
__rc_reload
|
38
38
|
if @@conf.nil?
|
39
39
|
Find.find('.') do |path|
|
40
|
-
next unless @@conf.nil? && path =~ /(
|
41
|
-
if path =~ /(?:#{EXTENTIONS.join('|')})$/
|
40
|
+
next unless @@conf.nil? && path =~ /(?:#{EXTENTIONS.join('|')})$/
|
41
|
+
if !!(path =~ /(?:#{EXTENTIONS.join('|')})$/) && !!(File.read(path) =~ /^\s*\#\s*\:\s*ruby-conf\s*(?::.*)?$/mi)
|
42
42
|
break if __rc_load(path)
|
43
43
|
end
|
44
44
|
end
|
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.
|
8
|
+
s.version = "2.7.0"
|
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"]
|
data/spec/lib/ruby-conf_spec.rb
CHANGED
@@ -433,7 +433,7 @@ TEXT
|
|
433
433
|
|
434
434
|
after do
|
435
435
|
dir = Dir["./**/test_conf.rb.tmpl"].first[/^(.*?)\/test_conf.rb.tmpl$/, 1]
|
436
|
-
File.delete("#{dir}/test_conf.
|
436
|
+
File.delete("#{dir}/test_conf.rc") if File.exists?("#{dir}/test_conf.rc")
|
437
437
|
end
|
438
438
|
|
439
439
|
it "will autoload the first ruby-conf that it can find if none is provided" do
|
@@ -441,7 +441,7 @@ TEXT
|
|
441
441
|
dir = Dir["./**/test_conf.rb.tmpl"].first[/^(.*?)\/test_conf.rb.tmpl$/, 1]
|
442
442
|
|
443
443
|
val = Random.rand.to_s
|
444
|
-
File.write("#{dir}/test_conf.
|
444
|
+
File.write("#{dir}/test_conf.rc", File.read("#{dir}/test_conf.rb.tmpl").gsub('{{VALUE}}', val))
|
445
445
|
|
446
446
|
RUBY_CONF.should be_nil
|
447
447
|
RUBY_CONF.ident.should == "FOUND AND LOADED BASIC CONFIG #{val}"
|
@@ -453,7 +453,7 @@ TEXT
|
|
453
453
|
RUBY_CONF.__rc_loaded_conf[:mtime].should == loaded[:mtime]
|
454
454
|
|
455
455
|
val = Random.rand.to_s
|
456
|
-
File.write("#{dir}/test_conf.
|
456
|
+
File.write("#{dir}/test_conf.rc", File.read("#{dir}/test_conf.rb.tmpl").gsub('{{VALUE}}', val))
|
457
457
|
FileUtils.touch(loaded[:path], mtime: 100)
|
458
458
|
RUBY_CONF.ident.should == "FOUND AND LOADED BASIC CONFIG #{val}"
|
459
459
|
RUBY_CONF.__rc_loaded_conf[:mtime].should_not == loaded[:mtime]
|
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.
|
4
|
+
version: 2.7.0
|
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:
|
118
|
+
hash: -4574071964254101626
|
119
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
120
|
none: false
|
121
121
|
requirements:
|