figs 2.0.4 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -6
  3. data/lib/figs/env.rb +11 -9
  4. data/lib/figs/version.rb +1 -1
  5. metadata +33 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3aebc79fde7580f3af76285d3325321bc0a7be81
4
- data.tar.gz: 6bc6d0df7c6b2d93323047904d13667bf95edaa9
3
+ metadata.gz: 17038047969d225a8ed05ba661f9cc8ab5c49bc5
4
+ data.tar.gz: b75123bec6c3a911b4c5a0d6f97876396ba7760c
5
5
  SHA512:
6
- metadata.gz: c90457641c6a8d1756e40be5b9ad8858fc75988496cc36242fe2f33832c56307cd9725f5c6b49b404b2e5ecf5af9422dbbd8b0df4dea414995a4b71dd5eae86a
7
- data.tar.gz: db0e187a3d5157e37df5644f4cb03e5549ef6b37765d6d01d689243aeec0604ba4107fb5ee35acb501ec9f9e236f046c028cd0bf72f4ed1fb7a38458f7dcffae
6
+ metadata.gz: 1e89052d37b4dffd157fdc7e84d0d04eb5defe84b1cfec51d83755f791aaa979bbfa488737847f80111e7cd166abcd10f856d5d1b80f750eb35f7e78cf40d0a3
7
+ data.tar.gz: f8f5b4f88e9a523526c7ae6b22d2672365196f16fe73cfe443c26d8f7c302c8b3c3bd1bfc9269137b7643b99d7ff51dd6067966aa5a164dd41453d2b3cff34c9
data/Gemfile CHANGED
@@ -1,9 +1,3 @@
1
1
  source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
-
5
- group :test do
6
- gem "coveralls", "~> 0.7", require: false
7
- gem "rspec", "~> 2.14"
8
- end
9
- gem 'git'
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Figs
2
- VERSION = "2.0.4"
2
+ VERSION = "2.1.1"
3
3
  end
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.0.4
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-01-31 00:00:00.000000000 Z
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.6
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.6
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.2.2
111
+ rubygems_version: 2.6.8
84
112
  signing_key:
85
113
  specification_version: 4
86
114
  summary: Simple app configuration