bocuse 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
data/lib/bocuse/configuration.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'blankslate'
|
2
|
+
|
1
3
|
module Bocuse
|
2
4
|
|
3
5
|
# This is the core class of bocuse.
|
@@ -9,7 +11,10 @@ module Bocuse
|
|
9
11
|
# It will mainly return proxies that will lodge themselves in its internal
|
10
12
|
# hash. The proxies usually represent an internal hash value.
|
11
13
|
#
|
12
|
-
class Configuration
|
14
|
+
class Configuration < BlankSlate
|
15
|
+
|
16
|
+
reveal :respond_to?
|
17
|
+
reveal :send
|
13
18
|
|
14
19
|
attr_reader :store,
|
15
20
|
:unresolved_block
|
@@ -10,7 +10,7 @@ describe "CLI:" do
|
|
10
10
|
compiled = MultiJson.load(`#{project_path('bin/bocuse')} \
|
11
11
|
compile complex.production.example.com`)
|
12
12
|
compiled.size.should == 3
|
13
|
-
compiled['recipes'].should == ['nginx', 'git', 'app::install', 'app::deploy'];
|
13
|
+
compiled['recipes'].should == ['nginx', 'git', 'app::install', 'app::deploy', 'my_service'];
|
14
14
|
compiled['key_location'].should match(%r{spec/files/complex/config/nodes/production/key.txt$})
|
15
15
|
end
|
16
16
|
end
|
@@ -38,21 +38,21 @@ describe Bocuse::Configuration do
|
|
38
38
|
|
39
39
|
configuration.something.to_h.should == 'value' # <= This is the tested getter.
|
40
40
|
end
|
41
|
-
it 'is modifiable in place' do
|
41
|
+
it 'is modifiable in place (#<<)' do
|
42
42
|
something = configuration.something
|
43
43
|
|
44
44
|
something << "hello"
|
45
45
|
|
46
46
|
configuration.something.to_h.should == ["hello"]
|
47
47
|
end
|
48
|
-
it 'is modifiable in place' do
|
48
|
+
it 'is modifiable in place (#[])' do
|
49
49
|
something = configuration.something
|
50
50
|
|
51
51
|
something[:key] = "value"
|
52
52
|
|
53
53
|
configuration.something.to_h.should == { :key => 'value' }
|
54
54
|
end
|
55
|
-
it 'is modifiable in place' do
|
55
|
+
it 'is modifiable in place (#=)' do
|
56
56
|
something = configuration.something
|
57
57
|
|
58
58
|
something[:key] = nil # Explicit nil.
|
@@ -145,4 +145,10 @@ describe Bocuse::Configuration do
|
|
145
145
|
dup[:baz].should == 'this is new'
|
146
146
|
end
|
147
147
|
end
|
148
|
+
describe "method name edge cases" do
|
149
|
+
it "allows #method as a key" do
|
150
|
+
configuration.method :foo
|
151
|
+
configuration.to_h.should == { method: :foo }
|
152
|
+
end
|
153
|
+
end
|
148
154
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bocuse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-09-
|
14
|
+
date: 2012-09-11 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rspec
|
@@ -109,6 +109,22 @@ dependencies:
|
|
109
109
|
- - ~>
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0.15'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: blankslate
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
none: false
|
116
|
+
requirements:
|
117
|
+
- - '='
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: 3.1.2
|
120
|
+
type: :runtime
|
121
|
+
prerelease: false
|
122
|
+
version_requirements: !ruby/object:Gem::Requirement
|
123
|
+
none: false
|
124
|
+
requirements:
|
125
|
+
- - '='
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: 3.1.2
|
112
128
|
description: ! " bocuse teaches chef-solo a few tricks. A strict front-end to chef-solo,
|
113
129
|
\n it reads a configuration syntax that is under source control and \n generates
|
114
130
|
JSON for chef-solo.\n\n This library puts the full power of Ruby at your fingertips
|