configatron 3.0.0 → 3.0.1
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 +4 -4
- data/lib/configatron.rb +5 -9
- data/lib/configatron/kernel.rb +21 -0
- data/lib/configatron/rails.rb +1 -1
- data/lib/configatron/version.rb +1 -1
- data/test/configatron/kernel_test.rb +24 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 111c25975fa2e46933d3277f8436d74c7fc75ef6
|
4
|
+
data.tar.gz: 17dec094ef90a2aca25ff5b2425c069eb6c06606
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c116250616e87548b30e5d393f1ee9ae82dda344000a3173f600c3756b597961b22ddc497ec5fe73ea498a727c02a6ba15be6c424b3008e1e4ec465d91225070
|
7
|
+
data.tar.gz: c1659257b6bc8c2115e173efa1e35e0caca91868452440d76b72aa84a10ec869be6bc7970d38fc4ec931d9fcc810ff199b5fc81e2c741e3b7f6429e58acd5094
|
data/lib/configatron.rb
CHANGED
@@ -1,9 +1,5 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
|
5
|
-
|
6
|
-
def configatron
|
7
|
-
@__configatron ||= Configatron::Store.new
|
8
|
-
end
|
9
|
-
end
|
1
|
+
require 'singleton'
|
2
|
+
require 'configatron/version'
|
3
|
+
require 'configatron/kernel'
|
4
|
+
require 'configatron/core'
|
5
|
+
require 'configatron/rails'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'singleton'
|
2
|
+
class Configatron::KernelStore < BasicObject
|
3
|
+
include ::Singleton
|
4
|
+
|
5
|
+
attr_reader :store
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
@store = ::Configatron::Store.new
|
9
|
+
end
|
10
|
+
|
11
|
+
def method_missing(name, *args, &block)
|
12
|
+
store.send(name, *args, &block)
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
module Kernel
|
18
|
+
def configatron
|
19
|
+
Configatron::KernelStore.instance
|
20
|
+
end
|
21
|
+
end
|
data/lib/configatron/rails.rb
CHANGED
data/lib/configatron/version.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
describe Configatron::KernelStore do
|
4
|
+
|
5
|
+
let(:store) { Configatron::KernelStore.instance }
|
6
|
+
|
7
|
+
it 'passes on to Configatron::Store' do
|
8
|
+
configatron.a.b.c.d = 'D'
|
9
|
+
configatron.a.b.c.d.must_equal 'D'
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
|
14
|
+
describe Kernel do
|
15
|
+
|
16
|
+
describe 'configatron' do
|
17
|
+
|
18
|
+
it 'returns an instance of Configatron::Store' do
|
19
|
+
configatron.kind_of?(Configatron::Store).must_equal true
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: configatron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Bates
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -46,6 +46,7 @@ files:
|
|
46
46
|
- lib/configatron/core.rb
|
47
47
|
- lib/configatron/deep_clone.rb
|
48
48
|
- lib/configatron/errors.rb
|
49
|
+
- lib/configatron/kernel.rb
|
49
50
|
- lib/configatron/rails.rb
|
50
51
|
- lib/configatron/store.rb
|
51
52
|
- lib/configatron/version.rb
|
@@ -55,6 +56,7 @@ files:
|
|
55
56
|
- lib/generators/configatron/install/templates/configatron/production.rb
|
56
57
|
- lib/generators/configatron/install/templates/configatron/test.rb
|
57
58
|
- lib/generators/configatron/install/templates/initializers/configatron.rb
|
59
|
+
- test/configatron/kernel_test.rb
|
58
60
|
- test/configatron/store_test.rb
|
59
61
|
- test/configatron_test.rb
|
60
62
|
- test/test_helper.rb
|
@@ -83,6 +85,7 @@ signing_key:
|
|
83
85
|
specification_version: 4
|
84
86
|
summary: A powerful Ruby configuration system.
|
85
87
|
test_files:
|
88
|
+
- test/configatron/kernel_test.rb
|
86
89
|
- test/configatron/store_test.rb
|
87
90
|
- test/configatron_test.rb
|
88
91
|
- test/test_helper.rb
|