strenv 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 551902e59c197db790faced972427d5b57c19deb
4
- data.tar.gz: d39af32e84d01fe291851af6e6626ef85010ec63
3
+ metadata.gz: 5fbf9227cb1092fc91fe797475429e07c80c2149
4
+ data.tar.gz: 63183ef8a556630f8b1aabb9764782e2d7937663
5
5
  SHA512:
6
- metadata.gz: 3050cea82f79968f5c5c5cf29dcbfcd722dcaee687553331e8838d47fd67808a454a882d763def5a136b39a480506d0e1fdfeffd5aa2e27400600cdab7f88628
7
- data.tar.gz: 73f8ae4d7844219957b245ea85eb92e83a03939b2c5a82179208ca20711680f3ddf89c49edc404e4a34a4fac7597bcf1e250ce29f12a3c2dc7fa204526751cb6
6
+ metadata.gz: 21ca32b282e774be4301ffb118b7ff1e3d0bc14048b1f0b68f1536acacdcdab1a1ad9b955afd3f7afbe759a616aa61c41dff2b3621be763261513e20141dea33
7
+ data.tar.gz: 1358d9261681e97e3be0c1cefd6d258af7cd126ed63a62a4b50fa80e1435c2bb686f8127eeae20f81c71734e073fb8e18ad0af3891ae6c26911913b28df7fad7
@@ -2,7 +2,7 @@
2
2
  # often go together. We avoid an extra item in the namespace
3
3
  # and an extra assignment.
4
4
  module STRICT_ENV
5
- VERSION = '0.0.2'
5
+ VERSION = '0.0.3'
6
6
  MalformedKey = Class.new(RuntimeError)
7
7
  MissingVariable = Class.new(RuntimeError)
8
8
 
@@ -16,6 +16,12 @@ module STRICT_ENV
16
16
  ENV[key]
17
17
  end
18
18
 
19
+ # Tells whether ENV has a given key
20
+ def has_key?(key)
21
+ key_as_str = key.to_s
22
+ ENV.has_key?(key_as_str)
23
+ end
24
+
19
25
  # Run a block protecting the contents of the environment variables. This is especially useful for
20
26
  # tests/specs that excercise methods that depend on environment variable state.
21
27
  # Use this as a wrapper block in "around" aspects. For example, for RSpec:
@@ -23,6 +23,14 @@ describe "STRICT_ENV" do
23
23
  end
24
24
  end
25
25
 
26
+ context 'STRICT_ENV.has_key?' do
27
+ it 'proxies calls to to ENV' do
28
+ ENV.keys.each do | key |
29
+ expect(STRICT_ENV.has_key?(key)).to eq(ENV.has_key?(key))
30
+ end
31
+ end
32
+ end
33
+
26
34
  context 'STRICT_ENV[]' do
27
35
  it 'proxies calls to [] to ENV' do
28
36
  ENV.keys.each do | key |
@@ -2,14 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
+ # stub: strenv 0.0.3 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = "strenv"
8
- s.version = "0.0.2"
9
+ s.version = "0.0.3"
9
10
 
10
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
11
13
  s.authors = ["Julik Tarkhanov"]
12
- s.date = "2014-07-15"
14
+ s.date = "2015-05-08"
13
15
  s.description = "Creates a STRICT_ENV constant that you can query for environment variables and get meaningful exceptions"
14
16
  s.email = "me@julik.nl"
15
17
  s.extra_rdoc_files = [
@@ -30,8 +32,7 @@ Gem::Specification.new do |s|
30
32
  ]
31
33
  s.homepage = "http://github.com/julik/strenv"
32
34
  s.licenses = ["MIT"]
33
- s.require_paths = ["lib"]
34
- s.rubygems_version = "2.0.3"
35
+ s.rubygems_version = "2.2.2"
35
36
  s.summary = "Strict ENV proxy for required environment variables"
36
37
 
37
38
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strenv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julik Tarkhanov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-15 00:00:00.000000000 Z
11
+ date: 2015-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '2.9'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.9'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rdoc
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '3.12'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '3.12'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: jeweler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 2.0.1
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 2.0.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: simplecov
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  description: Creates a STRICT_ENV constant that you can query for environment variables
@@ -89,8 +89,8 @@ extra_rdoc_files:
89
89
  - LICENSE.txt
90
90
  - README.rdoc
91
91
  files:
92
- - .document
93
- - .rspec
92
+ - ".document"
93
+ - ".rspec"
94
94
  - Gemfile
95
95
  - LICENSE.txt
96
96
  - README.rdoc
@@ -109,17 +109,17 @@ require_paths:
109
109
  - lib
110
110
  required_ruby_version: !ruby/object:Gem::Requirement
111
111
  requirements:
112
- - - '>='
112
+ - - ">="
113
113
  - !ruby/object:Gem::Version
114
114
  version: '0'
115
115
  required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - '>='
117
+ - - ">="
118
118
  - !ruby/object:Gem::Version
119
119
  version: '0'
120
120
  requirements: []
121
121
  rubyforge_project:
122
- rubygems_version: 2.0.3
122
+ rubygems_version: 2.2.2
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: Strict ENV proxy for required environment variables