climate_control 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -3
- data/NEWS +3 -0
- data/climate_control.gemspec +0 -1
- data/lib/climate_control/environment.rb +5 -5
- data/lib/climate_control/modifier.rb +7 -3
- data/lib/climate_control/version.rb +1 -1
- data/spec/acceptance/climate_control_spec.rb +1 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d6475362f621520ac9b951ad69a1a908e9043a2
|
4
|
+
data.tar.gz: 2d05f1c2f110479042944de906ca2e77ed9f3674
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e9aeadc9e0a01b5da958d1d2b46144b6972f50dece9d7d71fc32b841a9cdeb5c187574644c5f471110284522f94019f8d0df6ef11db1e6ebce86adef3750cc9
|
7
|
+
data.tar.gz: 207eb3f8c9c71fc4c646a85580a2504bb630a581e29cb464dd8b0fbb38e9fde40421f8e017d6aac10559374b854ec0b5484baaf24e0e2f1ffb1d99728a40f712
|
data/.travis.yml
CHANGED
data/NEWS
CHANGED
data/climate_control.gemspec
CHANGED
@@ -17,7 +17,6 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
19
19
|
|
20
|
-
gem.add_dependency "activesupport", ">= 3.0"
|
21
20
|
gem.add_development_dependency "rspec", "~> 3.1.0"
|
22
21
|
gem.add_development_dependency "rake", "~> 10.3.2"
|
23
22
|
gem.add_development_dependency "simplecov", "~> 0.9.1"
|
@@ -1,19 +1,19 @@
|
|
1
1
|
require "thread"
|
2
|
-
require "
|
2
|
+
require "forwardable"
|
3
3
|
|
4
4
|
module ClimateControl
|
5
5
|
class Environment
|
6
|
+
extend Forwardable
|
7
|
+
|
6
8
|
def initialize
|
7
9
|
@semaphore = Mutex.new
|
8
10
|
end
|
9
11
|
|
10
|
-
|
11
|
-
|
12
|
+
def_delegators :env, :[]=, :to_hash, :[], :delete
|
13
|
+
def_delegator :@semaphore, :synchronize
|
12
14
|
|
13
15
|
private
|
14
16
|
|
15
|
-
attr_reader :semaphore
|
16
|
-
|
17
17
|
def env
|
18
18
|
ENV
|
19
19
|
end
|
@@ -1,9 +1,7 @@
|
|
1
|
-
require "active_support/core_ext/hash/keys"
|
2
|
-
|
3
1
|
module ClimateControl
|
4
2
|
class Modifier
|
5
3
|
def initialize(env, environment_overrides = {}, &block)
|
6
|
-
@environment_overrides = environment_overrides
|
4
|
+
@environment_overrides = stringify_keys(environment_overrides)
|
7
5
|
@block = block
|
8
6
|
@env = env
|
9
7
|
end
|
@@ -70,6 +68,12 @@ module ClimateControl
|
|
70
68
|
@env.to_hash
|
71
69
|
end
|
72
70
|
|
71
|
+
def stringify_keys(env)
|
72
|
+
env.each_with_object({}) do |(key, value), hash|
|
73
|
+
hash[key.to_s] = value
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
73
77
|
class OverlappingKeysWithChangedValues
|
74
78
|
def initialize(hash_1, hash_2)
|
75
79
|
@hash_1 = hash_1 || {}
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: climate_control
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Clayton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: activesupport
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '3.0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '3.0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: rspec
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|