abyss 0.0.1 → 0.1.0
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.
- data/.gitignore +1 -0
- data/lib/abyss/deep_store.rb +4 -3
- data/lib/abyss/version.rb +1 -1
- data/spec/abyss/deep_store_spec.rb +7 -3
- metadata +4 -4
data/.gitignore
CHANGED
data/lib/abyss/deep_store.rb
CHANGED
@@ -38,10 +38,11 @@ module Abyss
|
|
38
38
|
#
|
39
39
|
class DeepStore
|
40
40
|
|
41
|
-
attr_accessor :configurations
|
41
|
+
attr_accessor :configurations, :name
|
42
42
|
|
43
|
-
def initialize #:nodoc:
|
43
|
+
def initialize(name=nil) #:nodoc:
|
44
44
|
@configurations = ActiveSupport::OrderedHash.new {}
|
45
|
+
@name = name
|
45
46
|
end
|
46
47
|
|
47
48
|
# If a block is passed, add a configuration group named `method_name`
|
@@ -57,7 +58,7 @@ module Abyss
|
|
57
58
|
raise ArgumentError.new("Can't supply both a method argument and a block.") if block_given? && args.size > 0
|
58
59
|
|
59
60
|
if block_given?
|
60
|
-
@configurations[method_name] ||= self.class.new
|
61
|
+
@configurations[method_name] ||= self.class.new(method_name)
|
61
62
|
@configurations[method_name].instance_eval &block
|
62
63
|
end
|
63
64
|
|
data/lib/abyss/version.rb
CHANGED
@@ -21,12 +21,16 @@ module Abyss
|
|
21
21
|
|
22
22
|
context "when dealing directly with an instance of DeepStore" do
|
23
23
|
|
24
|
-
subject { DeepStore.new }
|
24
|
+
subject { DeepStore.new("some_name") }
|
25
25
|
|
26
26
|
describe "#initialize" do
|
27
27
|
|
28
|
-
|
29
|
-
|
28
|
+
its(:configurations) { should == ActiveSupport::OrderedHash.new }
|
29
|
+
its(:name) { should == "some_name" }
|
30
|
+
|
31
|
+
context "when not specifying a name in the constructor" do
|
32
|
+
subject { DeepStore.new }
|
33
|
+
its(:name) { should be_nil }
|
30
34
|
end
|
31
35
|
|
32
36
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: abyss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
|
-
requirement: &
|
16
|
+
requirement: &70184979232340 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 3.2.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70184979232340
|
25
25
|
description: Manage arbitrarily-deep configurations through a friendly DSL.
|
26
26
|
email:
|
27
27
|
- jesseltrimble@gmail.com
|