get_env 0.1.1 → 0.2.0.pre2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/get_env.rb +9 -2
- data/lib/get_env/version.rb +5 -0
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e06a707490d36ccf55c909423cdc4185efb98d0018c4a954d302a98b2294131e
|
4
|
+
data.tar.gz: 4d925bb7f635ecf0c830c3ed209a37294b2c7dd41fb9fee5ff1f60c1681cca2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3042f5cc67b26a11118a7eb275fad83be33206bccf8938bc15d561afe83d45f955916e9a529c452e9504f12b97fc582d895e0ab283d58a162a3413b163e27bc3
|
7
|
+
data.tar.gz: '0590900f9eda5c7b8a55fc30b6fab903647cd4bb4fe105811a38d94f56aa675167fff9c1c6436031433d406395e1ee1699e199a1793066f1e6d63a83361a98b3'
|
data/lib/get_env.rb
CHANGED
@@ -1,9 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
|
3
|
+
require 'get_env/version'
|
4
|
+
begin
|
5
|
+
require 'rubocop/cop/lint/no_env'
|
6
|
+
rescue LoadError # rubocop:disable Lint/SuppressedException
|
7
|
+
# no rubocop
|
8
|
+
end
|
3
9
|
|
4
10
|
module GetEnv
|
5
11
|
def self.[](key)
|
6
12
|
return nil if key.nil?
|
13
|
+
|
7
14
|
v = ENV[key].to_i
|
8
15
|
return v if v.to_s == ENV[key]
|
9
16
|
|
@@ -19,7 +26,7 @@ module GetEnv
|
|
19
26
|
def self.fetch(key, default = nil)
|
20
27
|
if ENV.has_key?(key)
|
21
28
|
self[key]
|
22
|
-
elsif default
|
29
|
+
elsif !default.nil?
|
23
30
|
default
|
24
31
|
elsif block_given?
|
25
32
|
yield
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: get_env
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0.pre2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Mathieu
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2020-05-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -68,6 +68,20 @@ dependencies:
|
|
68
68
|
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: rubocop
|
73
|
+
requirement: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
type: :development
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
71
85
|
description: Read values from ENV in a reasonable way
|
72
86
|
email:
|
73
87
|
- bartek@rainforestqa.com
|
@@ -77,6 +91,7 @@ extensions: []
|
|
77
91
|
extra_rdoc_files: []
|
78
92
|
files:
|
79
93
|
- lib/get_env.rb
|
94
|
+
- lib/get_env/version.rb
|
80
95
|
homepage: https://github.com/rainforestapp/get_env
|
81
96
|
licenses:
|
82
97
|
- MIT
|
@@ -92,12 +107,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
92
107
|
version: '0'
|
93
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
109
|
requirements:
|
95
|
-
- - "
|
110
|
+
- - ">"
|
96
111
|
- !ruby/object:Gem::Version
|
97
|
-
version:
|
112
|
+
version: 1.3.1
|
98
113
|
requirements: []
|
99
|
-
|
100
|
-
rubygems_version: 2.7.8
|
114
|
+
rubygems_version: 3.0.3
|
101
115
|
signing_key:
|
102
116
|
specification_version: 4
|
103
117
|
summary: Read values from ENV in a reasonable way
|