abyss 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ .rvmrc
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module Abyss
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -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
- it 'sets its #configurations to an empty OrderedHash' do
29
- subject.configurations.should == ActiveSupport::OrderedHash.new
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.1
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-11 00:00:00.000000000 Z
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: &70310377219460 !ruby/object:Gem::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: *70310377219460
24
+ version_requirements: *70184979232340
25
25
  description: Manage arbitrarily-deep configurations through a friendly DSL.
26
26
  email:
27
27
  - jesseltrimble@gmail.com