confstruct 1.0.2 → 1.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.
- checksums.yaml +5 -5
- data/README.md +1 -0
- data/confstruct.gemspec +4 -4
- data/lib/confstruct.rb +1 -1
- data/spec/confstruct/configuration_spec.rb +1 -1
- data/spec/confstruct/hash_with_struct_access_spec.rb +2 -2
- data/spec/confstruct/utils_spec.rb +6 -6
- data/spec/spec_helper.rb +4 -2
- metadata +16 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 35f23c8e46e8ee4785cc5d2dfc24fa3ad8a4696173a63710ffe2fe2688418fe6
|
4
|
+
data.tar.gz: 86ce4d82f5292fc6df1d0b49b428736581142fa07a18276da4fc1a6cde11882d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64ae4f94a212550920be917636f8e46820ed6b001a2f9129d40187c10322d7643fecfecdea382f5618f9a1427228a6cec84fb0e675d6efc4c61570e2fb0db4bb
|
7
|
+
data.tar.gz: e5171bcaa5b36469d5ca8303996d5702ae2f422ca140d24f99e1f0566d88ceaead7793dd40b8f66a225649299bf8eba53fccab63e3f322c08b7e0126eb9e127a
|
data/README.md
CHANGED
@@ -198,6 +198,7 @@ The pattern `add_$key!` can be used to add to or create an array.
|
|
198
198
|
- <b>v0.2.7</b> - Remove ActiveSupport for Ruby >= 1.9
|
199
199
|
- <b>v1.0.0</b> - [YANKED] Refactor to use Hashie instead of reinventing all the Hash access stuff
|
200
200
|
- <b>v1.0.1</b> - Switch back to symbolized keys internally
|
201
|
+
- <b>v1.1.0</b> - Include support for Hashie 4, Rspec 3, and Ruby 2.7
|
201
202
|
|
202
203
|
## Contributing to confstruct
|
203
204
|
|
data/confstruct.gemspec
CHANGED
@@ -20,12 +20,12 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.add_development_dependency 'active_support'
|
21
21
|
end
|
22
22
|
|
23
|
-
s.add_dependency "hashie", "
|
24
|
-
|
23
|
+
s.add_dependency "hashie", ">= 3.3", "< 5"
|
24
|
+
|
25
25
|
s.add_development_dependency "rake", ">=0.8.7"
|
26
26
|
s.add_development_dependency "simplecov"
|
27
27
|
s.add_development_dependency "rdoc"
|
28
|
-
s.add_development_dependency "rspec", "~>
|
28
|
+
s.add_development_dependency "rspec", "~> 3.0"
|
29
29
|
s.add_development_dependency "yard"
|
30
|
-
|
30
|
+
|
31
31
|
end
|
data/lib/confstruct.rb
CHANGED
@@ -138,7 +138,7 @@ describe Confstruct::Configuration do
|
|
138
138
|
|
139
139
|
it "should call #after_config! when configuration is complete" do
|
140
140
|
postconfigurator = double('after_config!')
|
141
|
-
postconfigurator.
|
141
|
+
expect(postconfigurator).to receive(:configured!).once.with(@config)
|
142
142
|
def @config.after_config! obj
|
143
143
|
obj.project.should == 'other-project'
|
144
144
|
obj.mock.configured!(obj)
|
@@ -241,8 +241,8 @@ describe Confstruct::HashWithStructAccess do
|
|
241
241
|
it "should handle i18n translations" do
|
242
242
|
t = Time.now
|
243
243
|
I18n = RSpec::Mocks::Double.new('I18n')
|
244
|
-
I18n.
|
245
|
-
I18n.
|
244
|
+
expect(I18n).to receive(:translate).with('Hello, World!').at_least(:once).and_return('Bonjour, Monde!')
|
245
|
+
expect(I18n).to receive(:localize).with(t).at_least(:once).and_return('French Time!')
|
246
246
|
@hwsa.github do
|
247
247
|
hello 'Hello, World!'
|
248
248
|
time t
|
@@ -6,20 +6,20 @@ describe "Kernel.eval_or_yield" do
|
|
6
6
|
end
|
7
7
|
|
8
8
|
it "should instance_eval when the block takes no params" do
|
9
|
-
@obj.
|
10
|
-
eval_or_yield(@obj) {
|
9
|
+
expect(@obj).to receive(:test_method).and_return('OK')
|
10
|
+
eval_or_yield(@obj) {
|
11
11
|
self.should_not == @obj
|
12
|
-
self.
|
12
|
+
self.test_method.should == 'OK'
|
13
13
|
}
|
14
14
|
end
|
15
15
|
|
16
16
|
it "should yield when the block takes a param" do
|
17
|
-
@obj.
|
17
|
+
expect(@obj).to receive(:test_method).and_return('OK')
|
18
18
|
eval_or_yield(@obj) { |o|
|
19
19
|
self.should_not == @obj
|
20
20
|
o.should == @obj
|
21
|
-
lambda { self.
|
22
|
-
o.
|
21
|
+
lambda { self.test_method }.should raise_error(NoMethodError)
|
22
|
+
o.test_method.should == 'OK'
|
23
23
|
}
|
24
24
|
end
|
25
25
|
|
data/spec/spec_helper.rb
CHANGED
@@ -3,7 +3,6 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
3
3
|
|
4
4
|
require 'bundler/setup'
|
5
5
|
require 'rspec'
|
6
|
-
require 'rspec/autorun'
|
7
6
|
|
8
7
|
require 'rubygems'
|
9
8
|
require 'confstruct'
|
@@ -12,7 +11,10 @@ require 'simplecov'
|
|
12
11
|
SimpleCov.start
|
13
12
|
|
14
13
|
RSpec.configure do |config|
|
15
|
-
|
14
|
+
config.expect_with :rspec do |expectations|
|
15
|
+
# our specs written a long time ago still use :should syntax
|
16
|
+
expectations.syntax = [:should, :expect]
|
17
|
+
end
|
16
18
|
end
|
17
19
|
|
18
20
|
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: confstruct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Klein
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '3.3'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '5'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '3.3'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '5'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rake
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +78,14 @@ dependencies:
|
|
72
78
|
requirements:
|
73
79
|
- - "~>"
|
74
80
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
81
|
+
version: '3.0'
|
76
82
|
type: :development
|
77
83
|
prerelease: false
|
78
84
|
version_requirements: !ruby/object:Gem::Requirement
|
79
85
|
requirements:
|
80
86
|
- - "~>"
|
81
87
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
88
|
+
version: '3.0'
|
83
89
|
- !ruby/object:Gem::Dependency
|
84
90
|
name: yard
|
85
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,7 +126,7 @@ files:
|
|
120
126
|
homepage: ''
|
121
127
|
licenses: []
|
122
128
|
metadata: {}
|
123
|
-
post_install_message:
|
129
|
+
post_install_message:
|
124
130
|
rdoc_options: []
|
125
131
|
require_paths:
|
126
132
|
- lib
|
@@ -135,9 +141,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
141
|
- !ruby/object:Gem::Version
|
136
142
|
version: '0'
|
137
143
|
requirements: []
|
138
|
-
|
139
|
-
|
140
|
-
signing_key:
|
144
|
+
rubygems_version: 3.0.3
|
145
|
+
signing_key:
|
141
146
|
specification_version: 4
|
142
147
|
summary: A simple, hash/struct-based configuration object
|
143
148
|
test_files:
|
@@ -145,4 +150,3 @@ test_files:
|
|
145
150
|
- spec/confstruct/hash_with_struct_access_spec.rb
|
146
151
|
- spec/confstruct/utils_spec.rb
|
147
152
|
- spec/spec_helper.rb
|
148
|
-
has_rdoc:
|