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.
- checksums.yaml +4 -4
- data/lib/ice_age.rb +26 -21
- data/lib/ice_age/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdacf4844a9cf65f3a99c6ece8fa1403c9f3f2a2ebca15c0a8e77fcfed1cf5a8
|
4
|
+
data.tar.gz: 1cb1976307736bf8c5ad00796652ad2eed3e0abda36348ff9d4bccb3677909f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
5
|
-
|
4
|
+
module IceAge
|
5
|
+
extend self
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
def freeze
|
8
|
+
raise 'already frozen' if frozen?
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
@env = ENV.to_h.freeze
|
11
|
+
end
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
def frozen?
|
14
|
+
!!@env
|
15
|
+
end
|
16
16
|
|
17
|
-
|
18
|
-
|
17
|
+
def restore
|
18
|
+
raise 'not frozen' unless frozen?
|
19
19
|
|
20
|
-
|
21
|
-
|
20
|
+
ENV.replace(@env)
|
21
|
+
end
|
22
22
|
|
23
|
-
|
24
|
-
|
23
|
+
def endure!
|
24
|
+
raise 'not frozen' unless frozen?
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
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
|
data/lib/ice_age/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
VERSION = '0.
|
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.
|
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:
|
11
|
+
date: 2021-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: codecov
|