build-environment 1.8.0 → 1.9.0
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a8dd61b3a7edbfb082c41dd36b2913a6544cf052febc1886ca6cc365fee3436
|
4
|
+
data.tar.gz: 5e0eb7d7f201065bba835d5b372bd218d0e48ba0ef78b1570c71d8e1a1bdd541
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13d3d8cbc5d9f5ec2f04f1202cd6479acc5d185f7c9d065ee18d8ff438b2f098ec139dfe0c85957c68c42c5f9b5246f2c39cd60cab5068647ba95c896df7787c
|
7
|
+
data.tar.gz: '08c83885b28aa569dd7056eaa219c101642686413e119d8af15e474f98adbdfe6d76f4243d09d73d1ce165d20bb7f8d9a4f206a18d2558e0520093a0e6568726'
|
@@ -53,15 +53,11 @@ module Build
|
|
53
53
|
|
54
54
|
def method_missing(name, *args, **options, &block)
|
55
55
|
if options.empty?
|
56
|
-
if args.empty?
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
else
|
62
|
-
return @environment.fetch(name)
|
63
|
-
end
|
64
|
-
elsif !block_given?
|
56
|
+
if args.empty? and block_given?
|
57
|
+
@environment[name] = block
|
58
|
+
|
59
|
+
return name
|
60
|
+
elsif !args.empty?
|
65
61
|
if args.count == 1
|
66
62
|
@environment[name] = args.first
|
67
63
|
else
|
@@ -31,6 +31,12 @@ RSpec.describe Build::Environment::Constructor do
|
|
31
31
|
expect(environment[:foo]).to be == :bar
|
32
32
|
end
|
33
33
|
|
34
|
+
it "should set value to array" do
|
35
|
+
subject.foo :bar, :baz
|
36
|
+
|
37
|
+
expect(environment[:foo]).to be == [:bar, :baz]
|
38
|
+
end
|
39
|
+
|
34
40
|
it "should set value with block" do
|
35
41
|
subject.foo {:bar}
|
36
42
|
|
@@ -53,12 +59,10 @@ RSpec.describe Build::Environment::Constructor do
|
|
53
59
|
subject.build library: 'bar', &a_block
|
54
60
|
end
|
55
61
|
|
56
|
-
it "
|
62
|
+
it "cannot get values" do
|
57
63
|
subject.foo :bar
|
58
|
-
expect
|
59
|
-
|
60
|
-
|
61
|
-
it "raises error when trying to access non-existant value" do
|
62
|
-
expect{subject.foo}.to raise_error(KeyError)
|
64
|
+
expect do
|
65
|
+
subject.foo
|
66
|
+
end.to raise_error(NoMethodError)
|
63
67
|
end
|
64
68
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: build-environment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: covered
|