figs 2.0.4 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -6
- data/lib/figs/env.rb +11 -9
- data/lib/figs/version.rb +1 -1
- metadata +33 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17038047969d225a8ed05ba661f9cc8ab5c49bc5
|
4
|
+
data.tar.gz: b75123bec6c3a911b4c5a0d6f97876396ba7760c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e89052d37b4dffd157fdc7e84d0d04eb5defe84b1cfec51d83755f791aaa979bbfa488737847f80111e7cd166abcd10f856d5d1b80f750eb35f7e78cf40d0a3
|
7
|
+
data.tar.gz: f8f5b4f88e9a523526c7ae6b22d2672365196f16fe73cfe443c26d8f7c302c8b3c3bd1bfc9269137b7643b99d7ff51dd6067966aa5a164dd41453d2b3cff34c9
|
data/Gemfile
CHANGED
data/lib/figs/env.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
require 'date'
|
2
|
+
require 'time'
|
1
3
|
module Figs
|
2
4
|
module ENV
|
3
5
|
extend self
|
4
|
-
|
6
|
+
|
5
7
|
def env
|
6
8
|
@env ||= ::ENV
|
7
9
|
end
|
@@ -35,25 +37,25 @@ module Figs
|
|
35
37
|
end
|
36
38
|
end
|
37
39
|
end
|
38
|
-
|
40
|
+
|
39
41
|
def [](key)
|
40
42
|
return demarshall(env[key.to_s])
|
41
43
|
end
|
42
|
-
|
44
|
+
|
43
45
|
def []=(key,value)
|
44
46
|
set(key, value)
|
45
47
|
end
|
46
|
-
|
48
|
+
|
47
49
|
def demarshall(value)
|
48
50
|
value.nil? ? nil : YAML::load(value)
|
49
51
|
end
|
50
|
-
|
52
|
+
|
51
53
|
def method_missing(method, *args, &block)
|
52
54
|
if matches_env?(method) then return env.send(method, *args, &block) end
|
53
|
-
|
55
|
+
|
54
56
|
key, punctuation = extract_key_from_method(method)
|
55
57
|
_, value = env.detect { |k, _| k.upcase == key }
|
56
|
-
|
58
|
+
|
57
59
|
value = demarshall(value)
|
58
60
|
|
59
61
|
case punctuation
|
@@ -71,7 +73,7 @@ module Figs
|
|
71
73
|
def missing_key!(key)
|
72
74
|
raise MissingKey.new("Missing required Figaro configuration key #{key.inspect}.")
|
73
75
|
end
|
74
|
-
|
76
|
+
|
75
77
|
def respond_to?(method, *)
|
76
78
|
return true if matches_env?(method)
|
77
79
|
key, punctuation = extract_key_from_method(method)
|
@@ -82,7 +84,7 @@ module Figs
|
|
82
84
|
else super
|
83
85
|
end
|
84
86
|
end
|
85
|
-
|
87
|
+
|
86
88
|
def matches_env?(method)
|
87
89
|
env.respond_to?(method)
|
88
90
|
end
|
data/lib/figs/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: figs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hab278
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -30,14 +30,42 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.2
|
33
|
+
version: '1.2'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.2
|
40
|
+
version: '1.2'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: coveralls
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.7'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.7'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.5'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.5'
|
41
69
|
description: Simple app configuration using ENV and YAML files
|
42
70
|
email: hab278@nyu.edu
|
43
71
|
executables:
|
@@ -80,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
108
|
version: '0'
|
81
109
|
requirements: []
|
82
110
|
rubyforge_project:
|
83
|
-
rubygems_version: 2.
|
111
|
+
rubygems_version: 2.6.8
|
84
112
|
signing_key:
|
85
113
|
specification_version: 4
|
86
114
|
summary: Simple app configuration
|