configatron 3.0.0 → 3.0.1

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: 78c1def4386f46080300328b0c2eb32dee8f6a8c
4
- data.tar.gz: 4e112ec1cb48863fec4f85350757c76bc8e0e6d5
3
+ metadata.gz: 111c25975fa2e46933d3277f8436d74c7fc75ef6
4
+ data.tar.gz: 17dec094ef90a2aca25ff5b2425c069eb6c06606
5
5
  SHA512:
6
- metadata.gz: 174e714558c8165b50b4042431c9151c14ca8c91258b4b5beb6fe316d29d745fff6c79dac228f06ba98c653ec1a02035bc74a7b230eb5569d7a648648f4083ad
7
- data.tar.gz: af1b47b5978452f605c3a37dc8176f1b940bbb9e0314a4c4cedc2677c42d8cee96b25e772e9cf71a9201202b63743cc39fdb0103ce597cc0843e99c2f1ebe525
6
+ metadata.gz: c116250616e87548b30e5d393f1ee9ae82dda344000a3173f600c3756b597961b22ddc497ec5fe73ea498a727c02a6ba15be6c424b3008e1e4ec465d91225070
7
+ data.tar.gz: c1659257b6bc8c2115e173efa1e35e0caca91868452440d76b72aa84a10ec869be6bc7970d38fc4ec931d9fcc810ff199b5fc81e2c741e3b7f6429e58acd5094
data/lib/configatron.rb CHANGED
@@ -1,9 +1,5 @@
1
- require "configatron/version"
2
- require "configatron/core"
3
- require "configatron/rails"
4
-
5
- module Kernel
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
@@ -50,4 +50,4 @@ class Configatron
50
50
  end
51
51
 
52
52
  end # Rails
53
- end # Configatron
53
+ end # Configatron
@@ -1,3 +1,3 @@
1
1
  class Configatron
2
- VERSION = "3.0.0"
2
+ VERSION = "3.0.1"
3
3
  end
@@ -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.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-01-28 00:00:00.000000000 Z
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