dee 0.0.1 → 0.0.2

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: 9d68d4d9e4c3ab4b19f235b85cfdd23d940bfbd8
4
- data.tar.gz: 86fd1cdf1c5aa29d6bb0d0d5915e41ca599015ee
3
+ metadata.gz: ebf4d1e618915d470ad7ab66de4d4a163387d422
4
+ data.tar.gz: 8ca777da8c73e146d8aad7d0bb9da23daccd90c2
5
5
  SHA512:
6
- metadata.gz: 78b788b43f08281345baf27b58a765ee4963b68c3706e3e7da7ca5e90695d890f7affe5c8db01bbf927c990500f5042f277377aaaa19b88d7669219de28eccb1
7
- data.tar.gz: 2d70a6a7eed1ef5f07043824392478e06cad970ec632a58c852e7dcf773ae0fdadc030ab83bd36847885b9c7c415ba769f8d0633d20d41c6411223638a10bcf4
6
+ metadata.gz: 22c8eff59f13d7e59864f8ccaea3c67af280855f3eb96b57a55df7b1d1a42d85f02b3f8de3c887c2d2e5ac6b39574de610fafd2756600ca6974ed559000645a4
7
+ data.tar.gz: a6e7de81407f18a8b8319b73eb386c1bbf606055c1c47e57b938c1febc065d0c9734590f31b490f51ca68177547be16506917624cc5747fe615cf913bf0ac03c
@@ -1,6 +1,11 @@
1
1
  ChangeLog of Dee
2
2
  ================
3
3
 
4
+ 0.0.2 released 2013-12-31
5
+ -------------------------
6
+
7
+ - Fix error message
8
+
4
9
  0.0.1 released 2013-12-08
5
10
  -------------------------
6
11
 
data/README.md CHANGED
@@ -18,7 +18,31 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- TODO: Write usage instructions here
21
+ ```ruby
22
+ container = Dee::Container.new
23
+
24
+ # Define a value
25
+ container['foo.name'] = 'FOO'
26
+
27
+ # Define a factory
28
+ container.factory do 'foo'
29
+ Foo.new(self['foo.name'])
30
+ end
31
+
32
+ # Define a singleton factory
33
+ container.singleton do 'foo.singleton' do
34
+ Foo.new(self['foo.name'])
35
+ end
36
+
37
+ # Create Foo object
38
+ # This creates Foo object everytime
39
+ foo = container['foo']
40
+
41
+ # Create singleton Foo object
42
+ # This creates Foo object only at the first time
43
+ # And it returns same object after the creation
44
+ foo = container['foo.singleton']
45
+ ```
22
46
 
23
47
  ## Contributing
24
48
 
@@ -35,7 +35,7 @@ module Dee
35
35
  end
36
36
 
37
37
  def [](key)
38
- raise "'%s' is not defined in container" unless @values.key? key
38
+ raise "'%s' is not defined in container" % key unless @values.key? key
39
39
 
40
40
  value = @values[key]
41
41
 
@@ -1,3 +1,3 @@
1
1
  module Dee
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -3,7 +3,7 @@ describe Dee::Container do
3
3
 
4
4
  describe '#[]' do
5
5
  it 'raises error when no defined key is specified' do
6
- expect { container['no_defined_key'] }.to raise_error
6
+ expect { container['no_defined_key'] }.to raise_error "'no_defined_key' is not defined in container"
7
7
  end
8
8
  end
9
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuya Takeyama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-08 00:00:00.000000000 Z
11
+ date: 2013-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  version: '0'
110
110
  requirements: []
111
111
  rubyforge_project:
112
- rubygems_version: 2.1.11
112
+ rubygems_version: 2.2.0
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: Simple DI Container/Service Locater for Ruby