ice_age 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ice_age.rb +26 -21
  3. data/lib/ice_age/version.rb +2 -2
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5aef79cd00d3dff9d8ebc088e350e305a24138f1cdc9ac39a5c27e276f5a0f75
4
- data.tar.gz: 0afc51b74ef066ec4825c54d08638057d714efaa9a8e65417ffc871bba41500c
3
+ metadata.gz: bdacf4844a9cf65f3a99c6ece8fa1403c9f3f2a2ebca15c0a8e77fcfed1cf5a8
4
+ data.tar.gz: 1cb1976307736bf8c5ad00796652ad2eed3e0abda36348ff9d4bccb3677909f4
5
5
  SHA512:
6
- metadata.gz: 7156d83c11ee7544b4a129e96a1dc64822ebc16a54cb056e0f96288c48bd0b892f4b83a40bd8759ee9bbd3680225057392e5185c47b87b4c2265ace4ca7fcb1c
7
- data.tar.gz: e578cb717cb0a2147b4d1e93b22222e25fe6f597600bacc03b2dc7358dc09e10e472e2d880c7bee5678e6b063cbe287c3653042256167a9ed1f711ee5ef0de4c
6
+ metadata.gz: e3c508685bc49e270034c7c44a745f8d7b7e7e7dfbf36e1ac4d06af753c266052f63f8b5cd63ee2fec0ba32228df5f3e7ad71ba3b0bc5f200d1b4ad383cf77a7
7
+ data.tar.gz: 6db65ab8e9734cf1a958a64461ec5bd04d01c0a7e0ef27e4c5f1efc2cf42bfa43c9af56ec92b26e0ba2c03a52a9dac409a58cc6834ff3c05b249582813da56f3
data/lib/ice_age.rb CHANGED
@@ -1,36 +1,41 @@
1
1
  require 'ice_age/version'
2
2
  require 'set'
3
3
 
4
- class IceAge
5
- class << self
4
+ module IceAge
5
+ extend self
6
6
 
7
- def freeze
8
- raise 'already frozen' if frozen?
7
+ def freeze
8
+ raise 'already frozen' if frozen?
9
9
 
10
- @env = ENV.to_h.freeze
11
- end
10
+ @env = ENV.to_h.freeze
11
+ end
12
12
 
13
- def frozen?
14
- !!@env
15
- end
13
+ def frozen?
14
+ !!@env
15
+ end
16
16
 
17
- def restore
18
- raise 'not frozen' unless frozen?
17
+ def restore
18
+ raise 'not frozen' unless frozen?
19
19
 
20
- ENV.replace(@env)
21
- end
20
+ ENV.replace(@env)
21
+ end
22
22
 
23
- def endure!
24
- raise 'not frozen' unless frozen?
23
+ def endure!
24
+ raise 'not frozen' unless frozen?
25
25
 
26
- changes = (Set.new(ENV.to_h) - Set.new(@env)).to_h.keys
27
- unless changes.empty?
28
- msg = changes.map {|k| { k => { @env[k] => ENV[k] } }}.to_s
29
- raise 'ENV changed after freeze: ' + msg
30
- end
26
+ changes = (Set.new(ENV.to_h) - Set.new(@env)).to_h.keys - WHITELIST
27
+ unless changes.empty?
28
+ msg = changes.map {|k| { k => { @env[k] => ENV[k] } }}.to_s
29
+ raise 'ENV changed after freeze: ' + msg
31
30
  end
32
-
33
31
  end
32
+
33
+ WHITELIST = [
34
+ 'COLUMNS',
35
+ 'DISABLE_PRY',
36
+ 'LINES',
37
+ ].freeze
38
+ private_constant :WHITELIST
34
39
  end
35
40
 
36
41
  # load framework plugins
@@ -1,3 +1,3 @@
1
- class IceAge
2
- VERSION = '0.1.3'
1
+ module IceAge
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ice_age
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Pepper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-17 00:00:00.000000000 Z
11
+ date: 2021-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: codecov