pifano_config 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pifano/config.rb +9 -4
- data/lib/pifano_config/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fac4c5883861603405e2bf63071cc3a1896a961e1d29a063efae4b562c72d56c
|
4
|
+
data.tar.gz: 0e823fb70099e1410b41f75627531508317ade972a5b42114a736af69634d5a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7300421ecc51cb4010235a5a6db91c2875dcf12e15d1936a660fbbc6b06c3c691ef18453e80158b61a6e5df66db6a370017f3269c9ffa7cc32e7be7ec12831b
|
7
|
+
data.tar.gz: 7dda5b00d1e9cfb674c4532e8d62d492a842c5fd1426ff3cf99a51821e1d73c185c4b771fdfa6030813db3e8fdd71f08e71c43eee760ec66959945e0ead43fc3
|
data/lib/pifano/config.rb
CHANGED
@@ -42,15 +42,20 @@ module Pifano
|
|
42
42
|
# @parameter env_name [Symbol] The environment to get the options.
|
43
43
|
# @yields {...} When a block is given, the block is yielded with the option.
|
44
44
|
#
|
45
|
-
# @returns [Hash] The options.
|
45
|
+
# @returns [Hash] The options if a block is not given.
|
46
46
|
#
|
47
47
|
def environment(env_name)
|
48
48
|
return {} unless @options.key?(env_name)
|
49
49
|
|
50
50
|
@env = env_name
|
51
|
-
|
52
|
-
|
53
|
-
|
51
|
+
if block_given?
|
52
|
+
yield @options[env_name]
|
53
|
+
@env = nil
|
54
|
+
else
|
55
|
+
result = @options[env_name]
|
56
|
+
@env = nil
|
57
|
+
result
|
58
|
+
end
|
54
59
|
end
|
55
60
|
|
56
61
|
# Set the option for a specific environment.
|