environment_helpers 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e1df5aabc663c1ed5969c56db3d1be35f6b329272718ce174b30260f4c2f1e8
4
- data.tar.gz: 855f2cf510c568464310ef1bc30fb6115a6dff653618f25472a452fcf901cb77
3
+ metadata.gz: 7210a6ad0407c6441884d1c6d04d5052ee8ab2e77c7c5e541742b8dd0001ad42
4
+ data.tar.gz: 23f1a86a5e58e51463e4dbda465d15e14ee60b4891666c2e6d335a3d6110f177
5
5
  SHA512:
6
- metadata.gz: 2dcccd3be2e778d76ce595521efc58204b680acfbe3328c86e357946574c338e323ee7a4e479e39d768f97a67fb6ecb7bb2c7aad7c68db7ed2d6f30bd761f299
7
- data.tar.gz: 6a9bccc3864329bf295f59c268d64bed2078d072f9eed08ce2ff3063ead716f2e3e5a14b333f710b01b6092ec3be595bb71e74548c83515f230dfb9306e51bd7
6
+ metadata.gz: 2de1d1c87a18b0f81bb3cb4e91a96aa6d7ca8fb2cf68e626efbcf3abd75a6ceddcb3421409158ce2f8b91b00985acd3d22a4fd0b6b524967e77ef8f517029826
7
+ data.tar.gz: 3323cc62c83b0950d595f12885ce6d005730e93dce49f3e17eea7b63b3b2dfd854e605e278ac31a65f136938a9565bce1495c14f03d31586657bbc5bbbf1267b
data/.bundle/config ADDED
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_WITHOUT: "typing"
@@ -6,6 +6,8 @@ permissions: write-all
6
6
  jobs:
7
7
  check:
8
8
  runs-on: ubuntu-latest
9
+ env:
10
+ BUNDLE_GEMFILE: Gemfile.ruby3.3
9
11
  steps:
10
12
  - uses: actions/checkout@v4
11
13
  with:
@@ -18,12 +20,8 @@ jobs:
18
20
  - name: Set up Ruby
19
21
  uses: ruby/setup-ruby@v1
20
22
  with:
21
- ruby-version: 3.2
22
-
23
- - name: Install gems
24
- run: bundle install --jobs 4 --retry 3
23
+ ruby-version: 3.3
24
+ bundler-cache: true
25
25
 
26
26
  - name: Run QuietQuality
27
- run: |
28
- gem install quiet_quality standard rubocop
29
- qq -C .quiet_quality.ci-cd.yml
27
+ run: bundle exec qq -C .quiet_quality.ci-cd.yml
@@ -8,9 +8,10 @@ jobs:
8
8
  strategy:
9
9
  fail-fast: false
10
10
  matrix:
11
- ruby-version: ['2.7', '3.0', '3.1', '3.2', 'head']
11
+ ruby-version: ['2.7', '3.0', '3.1', '3.2', '3.3']
12
12
  env:
13
- NO_STEEP: "Because we need to test on versions that are older than steep supports"
13
+ SIMPLECOV: "enabled"
14
+ BUNDLE_GEMFILE: Gemfile.ruby${{ matrix.ruby-version }}
14
15
 
15
16
  steps:
16
17
  - uses: actions/checkout@v4
@@ -19,17 +20,7 @@ jobs:
19
20
  uses: ruby/setup-ruby@v1
20
21
  with:
21
22
  ruby-version: ${{ matrix.ruby-version }}
22
-
23
- - name: Cache gems
24
- uses: actions/cache@v3
25
- with:
26
- path: vendor/bundle
27
- key: ${{ runner.os }}-rspec-${{ matrix.ruby-version }}-${{ hashFiles('Gemfile.lock') }}
28
- restore-keys:
29
- ${{ runner.os }}-rspec-${{ matrix.ruby-version }}-
30
-
31
- - name: Install gems
32
- run: bundle install --jobs 4 --retry 3
23
+ bundler-cache: true
33
24
 
34
25
  - name: Run RSpec
35
26
  run: bundle exec rspec
data/.gitignore CHANGED
@@ -1,5 +1,4 @@
1
1
  .ruby-version
2
2
  .ruby-gemset
3
- Gemfile.lock
4
3
  *.gem
5
4
  coverage/
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## Release 1.6.0
4
+
5
+ * Remove steep and the rbs types (#41)
6
+ * Check the default's type in StringHelpers, preventing
7
+ `ENV.string("FOO", default: 5)` (#38 fixes #33)
8
+ * Handle non-numeric values in `ENV.integer` in a more sensible way (#39 fixes #34)
9
+ * Split Gemfile out per supported ruby, and commit all of the resulting lockfiles.
10
+
3
11
  ## Release 1.5.0
4
12
 
5
13
  * Add rbs/steep, and enforce types in CI (.rbs file is exported as part
data/Gemfile CHANGED
@@ -1,7 +1,3 @@
1
1
  source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
-
5
- unless ENV["NO_STEEP"]
6
- gem "steep", "~> 1.6.0"
7
- end
data/Gemfile.lock ADDED
@@ -0,0 +1,137 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ environment_helpers (1.6.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ addressable (2.8.7)
10
+ public_suffix (>= 2.0.2, < 7.0)
11
+ ast (2.4.3)
12
+ chef-utils (18.7.10)
13
+ concurrent-ruby
14
+ coderay (1.1.3)
15
+ concurrent-ruby (1.3.5)
16
+ diff-lcs (1.6.2)
17
+ docile (1.4.1)
18
+ git (1.19.1)
19
+ addressable (~> 2.8)
20
+ rchardet (~> 1.8)
21
+ git_diff_parser (4.0.0)
22
+ json (2.12.2)
23
+ kramdown (2.5.1)
24
+ rexml (>= 3.3.9)
25
+ kramdown-parser-gfm (1.1.0)
26
+ kramdown (~> 2.0)
27
+ language_server-protocol (3.17.0.5)
28
+ lint_roller (1.1.0)
29
+ mdl (0.13.0)
30
+ kramdown (~> 2.3)
31
+ kramdown-parser-gfm (~> 1.1)
32
+ mixlib-cli (~> 2.1, >= 2.1.1)
33
+ mixlib-config (>= 2.2.1, < 4)
34
+ mixlib-shellout
35
+ method_source (1.1.0)
36
+ mixlib-cli (2.1.8)
37
+ mixlib-config (3.0.27)
38
+ tomlrb
39
+ mixlib-shellout (3.3.9)
40
+ chef-utils
41
+ parallel (1.27.0)
42
+ parser (3.3.8.0)
43
+ ast (~> 2.4.1)
44
+ racc
45
+ prism (1.4.0)
46
+ pry (0.15.2)
47
+ coderay (~> 1.1)
48
+ method_source (~> 1.0)
49
+ public_suffix (6.0.2)
50
+ quiet_quality (1.5.2)
51
+ git (>= 1.18)
52
+ git_diff_parser (~> 4)
53
+ racc (1.8.1)
54
+ rainbow (3.1.1)
55
+ rchardet (1.9.0)
56
+ regexp_parser (2.10.0)
57
+ rexml (3.4.1)
58
+ rspec (3.13.1)
59
+ rspec-core (~> 3.13.0)
60
+ rspec-expectations (~> 3.13.0)
61
+ rspec-mocks (~> 3.13.0)
62
+ rspec-core (3.13.5)
63
+ rspec-support (~> 3.13.0)
64
+ rspec-cover_it (0.1.0)
65
+ rspec (~> 3.10)
66
+ rspec-expectations (3.13.5)
67
+ diff-lcs (>= 1.2.0, < 2.0)
68
+ rspec-support (~> 3.13.0)
69
+ rspec-mocks (3.13.5)
70
+ diff-lcs (>= 1.2.0, < 2.0)
71
+ rspec-support (~> 3.13.0)
72
+ rspec-support (3.13.4)
73
+ rubocop (1.64.1)
74
+ json (~> 2.3)
75
+ language_server-protocol (>= 3.17.0)
76
+ parallel (~> 1.10)
77
+ parser (>= 3.3.0.2)
78
+ rainbow (>= 2.2.2, < 4.0)
79
+ regexp_parser (>= 1.8, < 3.0)
80
+ rexml (>= 3.2.5, < 4.0)
81
+ rubocop-ast (>= 1.31.1, < 2.0)
82
+ ruby-progressbar (~> 1.7)
83
+ unicode-display_width (>= 2.4.0, < 3.0)
84
+ rubocop-ast (1.45.1)
85
+ parser (>= 3.3.7.2)
86
+ prism (~> 1.4)
87
+ rubocop-performance (1.23.1)
88
+ rubocop (>= 1.48.1, < 2.0)
89
+ rubocop-ast (>= 1.31.1, < 2.0)
90
+ ruby-progressbar (1.13.0)
91
+ simplecov (0.22.0)
92
+ docile (~> 1.1)
93
+ simplecov-html (~> 0.11)
94
+ simplecov_json_formatter (~> 0.1)
95
+ simplecov-html (0.13.1)
96
+ simplecov_json_formatter (0.1.4)
97
+ standard (1.37.0)
98
+ language_server-protocol (~> 3.17.0.2)
99
+ lint_roller (~> 1.0)
100
+ rubocop (~> 1.64.0)
101
+ standard-custom (~> 1.0.0)
102
+ standard-performance (~> 1.4)
103
+ standard-custom (1.0.2)
104
+ lint_roller (~> 1.0)
105
+ rubocop (~> 1.50)
106
+ standard-performance (1.6.0)
107
+ lint_roller (~> 1.1)
108
+ rubocop-performance (~> 1.23.0)
109
+ tomlrb (2.0.3)
110
+ unicode-display_width (2.6.0)
111
+
112
+ PLATFORMS
113
+ aarch64-linux-gnu
114
+ aarch64-linux-musl
115
+ arm-linux-gnu
116
+ arm-linux-musl
117
+ arm64-darwin
118
+ ruby
119
+ x86-linux-gnu
120
+ x86-linux-musl
121
+ x86_64-darwin
122
+ x86_64-linux-gnu
123
+ x86_64-linux-musl
124
+
125
+ DEPENDENCIES
126
+ environment_helpers!
127
+ mdl (~> 0.13)
128
+ pry (~> 0.15)
129
+ quiet_quality (~> 1.5)
130
+ rspec (~> 3.13)
131
+ rspec-cover_it (~> 0.1.0)
132
+ rubocop (~> 1.63)
133
+ simplecov (~> 0.22.0)
134
+ standard (= 1.37.0)
135
+
136
+ BUNDLED WITH
137
+ 2.4.22
data/Gemfile.ruby2.7 ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
@@ -0,0 +1,128 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ environment_helpers (1.6.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ addressable (2.8.7)
10
+ public_suffix (>= 2.0.2, < 7.0)
11
+ ast (2.4.3)
12
+ chef-utils (18.7.10)
13
+ concurrent-ruby
14
+ coderay (1.1.3)
15
+ concurrent-ruby (1.3.5)
16
+ diff-lcs (1.6.2)
17
+ docile (1.4.1)
18
+ git (1.19.1)
19
+ addressable (~> 2.8)
20
+ rchardet (~> 1.8)
21
+ git_diff_parser (4.0.0)
22
+ json (2.12.2)
23
+ kramdown (2.5.1)
24
+ rexml (>= 3.3.9)
25
+ kramdown-parser-gfm (1.1.0)
26
+ kramdown (~> 2.0)
27
+ language_server-protocol (3.17.0.5)
28
+ lint_roller (1.1.0)
29
+ mdl (0.13.0)
30
+ kramdown (~> 2.3)
31
+ kramdown-parser-gfm (~> 1.1)
32
+ mixlib-cli (~> 2.1, >= 2.1.1)
33
+ mixlib-config (>= 2.2.1, < 4)
34
+ mixlib-shellout
35
+ method_source (1.1.0)
36
+ mixlib-cli (2.1.8)
37
+ mixlib-config (3.0.27)
38
+ tomlrb
39
+ mixlib-shellout (3.3.8)
40
+ chef-utils
41
+ parallel (1.27.0)
42
+ parser (3.3.8.0)
43
+ ast (~> 2.4.1)
44
+ racc
45
+ prism (1.4.0)
46
+ pry (0.15.2)
47
+ coderay (~> 1.1)
48
+ method_source (~> 1.0)
49
+ public_suffix (5.1.1)
50
+ quiet_quality (1.5.2)
51
+ git (>= 1.18)
52
+ git_diff_parser (~> 4)
53
+ racc (1.8.1)
54
+ rainbow (3.1.1)
55
+ rchardet (1.8.0)
56
+ regexp_parser (2.10.0)
57
+ rexml (3.4.1)
58
+ rspec (3.13.1)
59
+ rspec-core (~> 3.13.0)
60
+ rspec-expectations (~> 3.13.0)
61
+ rspec-mocks (~> 3.13.0)
62
+ rspec-core (3.13.5)
63
+ rspec-support (~> 3.13.0)
64
+ rspec-cover_it (0.1.0)
65
+ rspec (~> 3.10)
66
+ rspec-expectations (3.13.5)
67
+ diff-lcs (>= 1.2.0, < 2.0)
68
+ rspec-support (~> 3.13.0)
69
+ rspec-mocks (3.13.5)
70
+ diff-lcs (>= 1.2.0, < 2.0)
71
+ rspec-support (~> 3.13.0)
72
+ rspec-support (3.13.4)
73
+ rubocop (1.64.1)
74
+ json (~> 2.3)
75
+ language_server-protocol (>= 3.17.0)
76
+ parallel (~> 1.10)
77
+ parser (>= 3.3.0.2)
78
+ rainbow (>= 2.2.2, < 4.0)
79
+ regexp_parser (>= 1.8, < 3.0)
80
+ rexml (>= 3.2.5, < 4.0)
81
+ rubocop-ast (>= 1.31.1, < 2.0)
82
+ ruby-progressbar (~> 1.7)
83
+ unicode-display_width (>= 2.4.0, < 3.0)
84
+ rubocop-ast (1.45.1)
85
+ parser (>= 3.3.7.2)
86
+ prism (~> 1.4)
87
+ rubocop-performance (1.21.1)
88
+ rubocop (>= 1.48.1, < 2.0)
89
+ rubocop-ast (>= 1.31.1, < 2.0)
90
+ ruby-progressbar (1.13.0)
91
+ simplecov (0.22.0)
92
+ docile (~> 1.1)
93
+ simplecov-html (~> 0.11)
94
+ simplecov_json_formatter (~> 0.1)
95
+ simplecov-html (0.13.1)
96
+ simplecov_json_formatter (0.1.4)
97
+ standard (1.37.0)
98
+ language_server-protocol (~> 3.17.0.2)
99
+ lint_roller (~> 1.0)
100
+ rubocop (~> 1.64.0)
101
+ standard-custom (~> 1.0.0)
102
+ standard-performance (~> 1.4)
103
+ standard-custom (1.0.2)
104
+ lint_roller (~> 1.0)
105
+ rubocop (~> 1.50)
106
+ standard-performance (1.4.0)
107
+ lint_roller (~> 1.1)
108
+ rubocop-performance (~> 1.21.0)
109
+ tomlrb (2.0.3)
110
+ unicode-display_width (2.6.0)
111
+
112
+ PLATFORMS
113
+ arm64-darwin-23
114
+ x86_64-linux
115
+
116
+ DEPENDENCIES
117
+ environment_helpers!
118
+ mdl (~> 0.13)
119
+ pry (~> 0.15)
120
+ quiet_quality (~> 1.5)
121
+ rspec (~> 3.13)
122
+ rspec-cover_it (~> 0.1.0)
123
+ rubocop (~> 1.63)
124
+ simplecov (~> 0.22.0)
125
+ standard (= 1.37.0)
126
+
127
+ BUNDLED WITH
128
+ 2.4.22
data/Gemfile.ruby3.0 ADDED
@@ -0,0 +1 @@
1
+ Gemfile
@@ -0,0 +1,157 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ environment_helpers (1.6.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ activesupport (7.1.5.1)
10
+ base64
11
+ benchmark (>= 0.3)
12
+ bigdecimal
13
+ concurrent-ruby (~> 1.0, >= 1.0.2)
14
+ connection_pool (>= 2.2.5)
15
+ drb
16
+ i18n (>= 1.6, < 2)
17
+ logger (>= 1.4.2)
18
+ minitest (>= 5.1)
19
+ mutex_m
20
+ securerandom (>= 0.3)
21
+ tzinfo (~> 2.0)
22
+ addressable (2.8.7)
23
+ public_suffix (>= 2.0.2, < 7.0)
24
+ ast (2.4.3)
25
+ base64 (0.3.0)
26
+ benchmark (0.4.1)
27
+ bigdecimal (3.2.2)
28
+ chef-utils (18.7.10)
29
+ concurrent-ruby
30
+ coderay (1.1.3)
31
+ concurrent-ruby (1.3.5)
32
+ connection_pool (2.5.3)
33
+ diff-lcs (1.6.2)
34
+ docile (1.4.1)
35
+ drb (2.2.3)
36
+ git (2.3.3)
37
+ activesupport (>= 5.0)
38
+ addressable (~> 2.8)
39
+ process_executer (~> 1.1)
40
+ rchardet (~> 1.8)
41
+ git_diff_parser (4.0.0)
42
+ i18n (1.14.7)
43
+ concurrent-ruby (~> 1.0)
44
+ json (2.12.2)
45
+ kramdown (2.5.1)
46
+ rexml (>= 3.3.9)
47
+ kramdown-parser-gfm (1.1.0)
48
+ kramdown (~> 2.0)
49
+ language_server-protocol (3.17.0.5)
50
+ lint_roller (1.1.0)
51
+ logger (1.7.0)
52
+ mdl (0.13.0)
53
+ kramdown (~> 2.3)
54
+ kramdown-parser-gfm (~> 1.1)
55
+ mixlib-cli (~> 2.1, >= 2.1.1)
56
+ mixlib-config (>= 2.2.1, < 4)
57
+ mixlib-shellout
58
+ method_source (1.1.0)
59
+ minitest (5.25.5)
60
+ mixlib-cli (2.1.8)
61
+ mixlib-config (3.0.27)
62
+ tomlrb
63
+ mixlib-shellout (3.3.9)
64
+ chef-utils
65
+ mutex_m (0.3.0)
66
+ parallel (1.27.0)
67
+ parser (3.3.8.0)
68
+ ast (~> 2.4.1)
69
+ racc
70
+ prism (1.4.0)
71
+ process_executer (1.1.2)
72
+ pry (0.15.2)
73
+ coderay (~> 1.1)
74
+ method_source (~> 1.0)
75
+ public_suffix (6.0.2)
76
+ quiet_quality (1.5.2)
77
+ git (>= 1.18)
78
+ git_diff_parser (~> 4)
79
+ racc (1.8.1)
80
+ rainbow (3.1.1)
81
+ rchardet (1.9.0)
82
+ regexp_parser (2.10.0)
83
+ rexml (3.4.1)
84
+ rspec (3.13.1)
85
+ rspec-core (~> 3.13.0)
86
+ rspec-expectations (~> 3.13.0)
87
+ rspec-mocks (~> 3.13.0)
88
+ rspec-core (3.13.5)
89
+ rspec-support (~> 3.13.0)
90
+ rspec-cover_it (0.1.0)
91
+ rspec (~> 3.10)
92
+ rspec-expectations (3.13.5)
93
+ diff-lcs (>= 1.2.0, < 2.0)
94
+ rspec-support (~> 3.13.0)
95
+ rspec-mocks (3.13.5)
96
+ diff-lcs (>= 1.2.0, < 2.0)
97
+ rspec-support (~> 3.13.0)
98
+ rspec-support (3.13.4)
99
+ rubocop (1.64.1)
100
+ json (~> 2.3)
101
+ language_server-protocol (>= 3.17.0)
102
+ parallel (~> 1.10)
103
+ parser (>= 3.3.0.2)
104
+ rainbow (>= 2.2.2, < 4.0)
105
+ regexp_parser (>= 1.8, < 3.0)
106
+ rexml (>= 3.2.5, < 4.0)
107
+ rubocop-ast (>= 1.31.1, < 2.0)
108
+ ruby-progressbar (~> 1.7)
109
+ unicode-display_width (>= 2.4.0, < 3.0)
110
+ rubocop-ast (1.45.1)
111
+ parser (>= 3.3.7.2)
112
+ prism (~> 1.4)
113
+ rubocop-performance (1.23.1)
114
+ rubocop (>= 1.48.1, < 2.0)
115
+ rubocop-ast (>= 1.31.1, < 2.0)
116
+ ruby-progressbar (1.13.0)
117
+ securerandom (0.3.2)
118
+ simplecov (0.22.0)
119
+ docile (~> 1.1)
120
+ simplecov-html (~> 0.11)
121
+ simplecov_json_formatter (~> 0.1)
122
+ simplecov-html (0.13.1)
123
+ simplecov_json_formatter (0.1.4)
124
+ standard (1.37.0)
125
+ language_server-protocol (~> 3.17.0.2)
126
+ lint_roller (~> 1.0)
127
+ rubocop (~> 1.64.0)
128
+ standard-custom (~> 1.0.0)
129
+ standard-performance (~> 1.4)
130
+ standard-custom (1.0.2)
131
+ lint_roller (~> 1.0)
132
+ rubocop (~> 1.50)
133
+ standard-performance (1.6.0)
134
+ lint_roller (~> 1.1)
135
+ rubocop-performance (~> 1.23.0)
136
+ tomlrb (2.0.3)
137
+ tzinfo (2.0.6)
138
+ concurrent-ruby (~> 1.0)
139
+ unicode-display_width (2.6.0)
140
+
141
+ PLATFORMS
142
+ arm64-darwin-23
143
+ x86_64-linux
144
+
145
+ DEPENDENCIES
146
+ environment_helpers!
147
+ mdl (~> 0.13)
148
+ pry (~> 0.15)
149
+ quiet_quality (~> 1.5)
150
+ rspec (~> 3.13)
151
+ rspec-cover_it (~> 0.1.0)
152
+ rubocop (~> 1.63)
153
+ simplecov (~> 0.22.0)
154
+ standard (= 1.37.0)
155
+
156
+ BUNDLED WITH
157
+ 2.2.33
data/Gemfile.ruby3.1 ADDED
@@ -0,0 +1 @@
1
+ Gemfile
@@ -0,0 +1,128 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ environment_helpers (1.6.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ addressable (2.8.7)
10
+ public_suffix (>= 2.0.2, < 7.0)
11
+ ast (2.4.3)
12
+ chef-utils (18.7.10)
13
+ concurrent-ruby
14
+ coderay (1.1.3)
15
+ concurrent-ruby (1.3.5)
16
+ diff-lcs (1.6.2)
17
+ docile (1.4.1)
18
+ git (1.19.1)
19
+ addressable (~> 2.8)
20
+ rchardet (~> 1.8)
21
+ git_diff_parser (4.0.0)
22
+ json (2.12.2)
23
+ kramdown (2.5.1)
24
+ rexml (>= 3.3.9)
25
+ kramdown-parser-gfm (1.1.0)
26
+ kramdown (~> 2.0)
27
+ language_server-protocol (3.17.0.5)
28
+ lint_roller (1.1.0)
29
+ mdl (0.13.0)
30
+ kramdown (~> 2.3)
31
+ kramdown-parser-gfm (~> 1.1)
32
+ mixlib-cli (~> 2.1, >= 2.1.1)
33
+ mixlib-config (>= 2.2.1, < 4)
34
+ mixlib-shellout
35
+ method_source (1.1.0)
36
+ mixlib-cli (2.1.8)
37
+ mixlib-config (3.0.27)
38
+ tomlrb
39
+ mixlib-shellout (3.3.9)
40
+ chef-utils
41
+ parallel (1.27.0)
42
+ parser (3.3.8.0)
43
+ ast (~> 2.4.1)
44
+ racc
45
+ prism (1.4.0)
46
+ pry (0.15.2)
47
+ coderay (~> 1.1)
48
+ method_source (~> 1.0)
49
+ public_suffix (6.0.2)
50
+ quiet_quality (1.5.2)
51
+ git (>= 1.18)
52
+ git_diff_parser (~> 4)
53
+ racc (1.8.1)
54
+ rainbow (3.1.1)
55
+ rchardet (1.9.0)
56
+ regexp_parser (2.10.0)
57
+ rexml (3.4.1)
58
+ rspec (3.13.1)
59
+ rspec-core (~> 3.13.0)
60
+ rspec-expectations (~> 3.13.0)
61
+ rspec-mocks (~> 3.13.0)
62
+ rspec-core (3.13.5)
63
+ rspec-support (~> 3.13.0)
64
+ rspec-cover_it (0.1.0)
65
+ rspec (~> 3.10)
66
+ rspec-expectations (3.13.5)
67
+ diff-lcs (>= 1.2.0, < 2.0)
68
+ rspec-support (~> 3.13.0)
69
+ rspec-mocks (3.13.5)
70
+ diff-lcs (>= 1.2.0, < 2.0)
71
+ rspec-support (~> 3.13.0)
72
+ rspec-support (3.13.4)
73
+ rubocop (1.64.1)
74
+ json (~> 2.3)
75
+ language_server-protocol (>= 3.17.0)
76
+ parallel (~> 1.10)
77
+ parser (>= 3.3.0.2)
78
+ rainbow (>= 2.2.2, < 4.0)
79
+ regexp_parser (>= 1.8, < 3.0)
80
+ rexml (>= 3.2.5, < 4.0)
81
+ rubocop-ast (>= 1.31.1, < 2.0)
82
+ ruby-progressbar (~> 1.7)
83
+ unicode-display_width (>= 2.4.0, < 3.0)
84
+ rubocop-ast (1.45.1)
85
+ parser (>= 3.3.7.2)
86
+ prism (~> 1.4)
87
+ rubocop-performance (1.23.1)
88
+ rubocop (>= 1.48.1, < 2.0)
89
+ rubocop-ast (>= 1.31.1, < 2.0)
90
+ ruby-progressbar (1.13.0)
91
+ simplecov (0.22.0)
92
+ docile (~> 1.1)
93
+ simplecov-html (~> 0.11)
94
+ simplecov_json_formatter (~> 0.1)
95
+ simplecov-html (0.13.1)
96
+ simplecov_json_formatter (0.1.4)
97
+ standard (1.37.0)
98
+ language_server-protocol (~> 3.17.0.2)
99
+ lint_roller (~> 1.0)
100
+ rubocop (~> 1.64.0)
101
+ standard-custom (~> 1.0.0)
102
+ standard-performance (~> 1.4)
103
+ standard-custom (1.0.2)
104
+ lint_roller (~> 1.0)
105
+ rubocop (~> 1.50)
106
+ standard-performance (1.6.0)
107
+ lint_roller (~> 1.1)
108
+ rubocop-performance (~> 1.23.0)
109
+ tomlrb (2.0.3)
110
+ unicode-display_width (2.6.0)
111
+
112
+ PLATFORMS
113
+ arm64-darwin-23
114
+ x86_64-linux
115
+
116
+ DEPENDENCIES
117
+ environment_helpers!
118
+ mdl (~> 0.13)
119
+ pry (~> 0.15)
120
+ quiet_quality (~> 1.5)
121
+ rspec (~> 3.13)
122
+ rspec-cover_it (~> 0.1.0)
123
+ rubocop (~> 1.63)
124
+ simplecov (~> 0.22.0)
125
+ standard (= 1.37.0)
126
+
127
+ BUNDLED WITH
128
+ 2.4.22
data/Gemfile.ruby3.2 ADDED
@@ -0,0 +1 @@
1
+ Gemfile
@@ -0,0 +1,169 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ environment_helpers (1.6.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ activesupport (8.0.2)
10
+ base64
11
+ benchmark (>= 0.3)
12
+ bigdecimal
13
+ concurrent-ruby (~> 1.0, >= 1.3.1)
14
+ connection_pool (>= 2.2.5)
15
+ drb
16
+ i18n (>= 1.6, < 2)
17
+ logger (>= 1.4.2)
18
+ minitest (>= 5.1)
19
+ securerandom (>= 0.3)
20
+ tzinfo (~> 2.0, >= 2.0.5)
21
+ uri (>= 0.13.1)
22
+ addressable (2.8.7)
23
+ public_suffix (>= 2.0.2, < 7.0)
24
+ ast (2.4.3)
25
+ base64 (0.3.0)
26
+ benchmark (0.4.1)
27
+ bigdecimal (3.2.2)
28
+ chef-utils (18.7.10)
29
+ concurrent-ruby
30
+ coderay (1.1.3)
31
+ concurrent-ruby (1.3.5)
32
+ connection_pool (2.5.3)
33
+ diff-lcs (1.6.2)
34
+ docile (1.4.1)
35
+ drb (2.2.3)
36
+ git (4.0.1)
37
+ activesupport (>= 5.0)
38
+ addressable (~> 2.8)
39
+ process_executer (~> 4.0)
40
+ rchardet (~> 1.9)
41
+ git_diff_parser (4.0.0)
42
+ i18n (1.14.7)
43
+ concurrent-ruby (~> 1.0)
44
+ json (2.12.2)
45
+ kramdown (2.5.1)
46
+ rexml (>= 3.3.9)
47
+ kramdown-parser-gfm (1.1.0)
48
+ kramdown (~> 2.0)
49
+ language_server-protocol (3.17.0.5)
50
+ lint_roller (1.1.0)
51
+ logger (1.7.0)
52
+ mdl (0.13.0)
53
+ kramdown (~> 2.3)
54
+ kramdown-parser-gfm (~> 1.1)
55
+ mixlib-cli (~> 2.1, >= 2.1.1)
56
+ mixlib-config (>= 2.2.1, < 4)
57
+ mixlib-shellout
58
+ method_source (1.1.0)
59
+ minitest (5.25.5)
60
+ mixlib-cli (2.1.8)
61
+ mixlib-config (3.0.27)
62
+ tomlrb
63
+ mixlib-shellout (3.3.9)
64
+ chef-utils
65
+ parallel (1.27.0)
66
+ parser (3.3.8.0)
67
+ ast (~> 2.4.1)
68
+ racc
69
+ prism (1.4.0)
70
+ process_executer (4.0.0)
71
+ track_open_instances (~> 0.1)
72
+ pry (0.15.2)
73
+ coderay (~> 1.1)
74
+ method_source (~> 1.0)
75
+ public_suffix (6.0.2)
76
+ quiet_quality (1.5.2)
77
+ git (>= 1.18)
78
+ git_diff_parser (~> 4)
79
+ racc (1.8.1)
80
+ rainbow (3.1.1)
81
+ rchardet (1.9.0)
82
+ regexp_parser (2.10.0)
83
+ rexml (3.4.1)
84
+ rspec (3.13.1)
85
+ rspec-core (~> 3.13.0)
86
+ rspec-expectations (~> 3.13.0)
87
+ rspec-mocks (~> 3.13.0)
88
+ rspec-core (3.13.5)
89
+ rspec-support (~> 3.13.0)
90
+ rspec-cover_it (0.1.0)
91
+ rspec (~> 3.10)
92
+ rspec-expectations (3.13.5)
93
+ diff-lcs (>= 1.2.0, < 2.0)
94
+ rspec-support (~> 3.13.0)
95
+ rspec-mocks (3.13.5)
96
+ diff-lcs (>= 1.2.0, < 2.0)
97
+ rspec-support (~> 3.13.0)
98
+ rspec-support (3.13.4)
99
+ rubocop (1.64.1)
100
+ json (~> 2.3)
101
+ language_server-protocol (>= 3.17.0)
102
+ parallel (~> 1.10)
103
+ parser (>= 3.3.0.2)
104
+ rainbow (>= 2.2.2, < 4.0)
105
+ regexp_parser (>= 1.8, < 3.0)
106
+ rexml (>= 3.2.5, < 4.0)
107
+ rubocop-ast (>= 1.31.1, < 2.0)
108
+ ruby-progressbar (~> 1.7)
109
+ unicode-display_width (>= 2.4.0, < 3.0)
110
+ rubocop-ast (1.45.1)
111
+ parser (>= 3.3.7.2)
112
+ prism (~> 1.4)
113
+ rubocop-performance (1.23.1)
114
+ rubocop (>= 1.48.1, < 2.0)
115
+ rubocop-ast (>= 1.31.1, < 2.0)
116
+ ruby-progressbar (1.13.0)
117
+ securerandom (0.4.1)
118
+ simplecov (0.22.0)
119
+ docile (~> 1.1)
120
+ simplecov-html (~> 0.11)
121
+ simplecov_json_formatter (~> 0.1)
122
+ simplecov-html (0.13.1)
123
+ simplecov_json_formatter (0.1.4)
124
+ standard (1.37.0)
125
+ language_server-protocol (~> 3.17.0.2)
126
+ lint_roller (~> 1.0)
127
+ rubocop (~> 1.64.0)
128
+ standard-custom (~> 1.0.0)
129
+ standard-performance (~> 1.4)
130
+ standard-custom (1.0.2)
131
+ lint_roller (~> 1.0)
132
+ rubocop (~> 1.50)
133
+ standard-performance (1.6.0)
134
+ lint_roller (~> 1.1)
135
+ rubocop-performance (~> 1.23.0)
136
+ tomlrb (2.0.3)
137
+ track_open_instances (0.1.15)
138
+ tzinfo (2.0.6)
139
+ concurrent-ruby (~> 1.0)
140
+ unicode-display_width (2.6.0)
141
+ uri (1.0.3)
142
+
143
+ PLATFORMS
144
+ aarch64-linux-gnu
145
+ aarch64-linux-musl
146
+ arm-linux-gnu
147
+ arm-linux-musl
148
+ arm64-darwin
149
+ ruby
150
+ x86-linux-gnu
151
+ x86-linux-musl
152
+ x86_64-darwin
153
+ x86_64-linux
154
+ x86_64-linux-gnu
155
+ x86_64-linux-musl
156
+
157
+ DEPENDENCIES
158
+ environment_helpers!
159
+ mdl (~> 0.13)
160
+ pry (~> 0.15)
161
+ quiet_quality (~> 1.5)
162
+ rspec (~> 3.13)
163
+ rspec-cover_it (~> 0.1.0)
164
+ rubocop (~> 1.63)
165
+ simplecov (~> 0.22.0)
166
+ standard (= 1.37.0)
167
+
168
+ BUNDLED WITH
169
+ 2.4.19
data/Gemfile.ruby3.3 ADDED
@@ -0,0 +1 @@
1
+ Gemfile
@@ -0,0 +1 @@
1
+ Gemfile.lock
data/Steepfile CHANGED
@@ -7,11 +7,3 @@ target :lib do
7
7
  library "pathname"
8
8
  library "date"
9
9
  end
10
-
11
- target :test do
12
- signature "sig"
13
- check "test"
14
- configure_code_diagnostics(D::Ruby.default)
15
- library "pathname"
16
- library "date"
17
- end
@@ -28,12 +28,12 @@ Gem::Specification.new do |spec|
28
28
  spec.executables = []
29
29
  spec.require_paths = ["lib"]
30
30
 
31
- spec.add_development_dependency "rspec", "~> 3.10"
31
+ spec.add_development_dependency "rspec", "~> 3.13"
32
32
  spec.add_development_dependency "simplecov", "~> 0.22.0"
33
33
  spec.add_development_dependency "rspec-cover_it", "~> 0.1.0"
34
- spec.add_development_dependency "pry", "~> 0.14"
35
- spec.add_development_dependency "standard", "~> 1.28"
36
- spec.add_development_dependency "rubocop", "~> 1.50"
37
- spec.add_development_dependency "quiet_quality", "~> 1.3.0"
38
- spec.add_development_dependency "mdl", "~> 0.12"
34
+ spec.add_development_dependency "pry", "~> 0.15"
35
+ spec.add_development_dependency "standard", "= 1.37.0"
36
+ spec.add_development_dependency "rubocop", "~> 1.63"
37
+ spec.add_development_dependency "quiet_quality", "~> 1.5"
38
+ spec.add_development_dependency "mdl", "~> 0.13"
39
39
  end
@@ -2,8 +2,20 @@ module EnvironmentHelpers
2
2
  module NumericHelpers
3
3
  def integer(name, default: nil, required: false)
4
4
  check_default_type(:integer, default, Integer)
5
- text = fetch_value(name, required: required)
5
+ text = fetch_value(name, required: required)&.strip
6
+ text = enforced_format(name: name, text: text, required: required)
6
7
  text&.to_i || default
7
8
  end
9
+
10
+ private
11
+
12
+ def enforced_format(name:, text:, required:)
13
+ return nil unless text
14
+ return text if text.match?(/\A-?\d+\z/)
15
+
16
+ # Not a "correct" integer (we accept only limited forms here)
17
+ return nil unless required
18
+ fail(InvalidIntegerText, "The environment variable '#{name}' contains text that does not look like an integer")
19
+ end
8
20
  end
9
21
  end
@@ -1,6 +1,7 @@
1
1
  module EnvironmentHelpers
2
2
  module StringHelpers
3
3
  def string(name, default: nil, required: false)
4
+ check_default_type(:string, default, String)
4
5
  fetch_value(name, required: required) || default
5
6
  end
6
7
 
@@ -1,3 +1,3 @@
1
1
  module EnvironmentHelpers
2
- VERSION = "1.5.0"
2
+ VERSION = "1.6.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: environment_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Mueller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-14 00:00:00.000000000 Z
11
+ date: 2025-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '3.10'
19
+ version: '3.13'
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
- version: '3.10'
26
+ version: '3.13'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: simplecov
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,70 +58,70 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.14'
61
+ version: '0.15'
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
- version: '0.14'
68
+ version: '0.15'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: standard
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: '1.28'
75
+ version: 1.37.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
- version: '1.28'
82
+ version: 1.37.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rubocop
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '1.50'
89
+ version: '1.63'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '1.50'
96
+ version: '1.63'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: quiet_quality
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 1.3.0
103
+ version: '1.5'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 1.3.0
110
+ version: '1.5'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: mdl
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '0.12'
117
+ version: '0.13'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '0.12'
124
+ version: '0.13'
125
125
  description: |
126
126
  Convenience helpers for more simply accessing data passed to applications through the
127
127
  environment that may have types and/or defaults
@@ -131,9 +131,9 @@ executables: []
131
131
  extensions: []
132
132
  extra_rdoc_files: []
133
133
  files:
134
+ - ".bundle/config"
134
135
  - ".github/workflows/quality.yml"
135
136
  - ".github/workflows/rspec.yml"
136
- - ".github/workflows/type_check.yml"
137
137
  - ".gitignore"
138
138
  - ".mdl_rules.rb"
139
139
  - ".mdlrc"
@@ -143,6 +143,17 @@ files:
143
143
  - ".rubocop.yml"
144
144
  - CHANGELOG.md
145
145
  - Gemfile
146
+ - Gemfile.lock
147
+ - Gemfile.ruby2.7
148
+ - Gemfile.ruby2.7.lock
149
+ - Gemfile.ruby3.0
150
+ - Gemfile.ruby3.0.lock
151
+ - Gemfile.ruby3.1
152
+ - Gemfile.ruby3.1.lock
153
+ - Gemfile.ruby3.2
154
+ - Gemfile.ruby3.2.lock
155
+ - Gemfile.ruby3.3
156
+ - Gemfile.ruby3.3.lock
146
157
  - LICENSE
147
158
  - README.md
148
159
  - Steepfile
@@ -157,7 +168,6 @@ files:
157
168
  - lib/environment_helpers/range_helpers.rb
158
169
  - lib/environment_helpers/string_helpers.rb
159
170
  - lib/environment_helpers/version.rb
160
- - sig/environment_helpers.rbs
161
171
  homepage: https://github.com/nevinera/environment_helpers
162
172
  licenses:
163
173
  - MIT
@@ -179,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
189
  - !ruby/object:Gem::Version
180
190
  version: '0'
181
191
  requirements: []
182
- rubygems_version: 3.4.10
192
+ rubygems_version: 3.5.22
183
193
  signing_key:
184
194
  specification_version: 4
185
195
  summary: A set of convenience methods for accessing environment data
@@ -1,18 +0,0 @@
1
- name: Steep Type Checking
2
-
3
- on: push
4
-
5
- jobs:
6
- check:
7
- runs-on: ubuntu-latest
8
- steps:
9
- - uses: actions/checkout@v4
10
-
11
- - name: Set up ruby
12
- uses: ruby/setup-ruby@v1
13
- with:
14
- ruby-version: 3.3
15
- bundler-cache: true
16
-
17
- - name: Run Steep
18
- run: bundle exec steep check
@@ -1,96 +0,0 @@
1
- module EnvironmentHelpers
2
- VERSION: String
3
-
4
- class Error < StandardError
5
- end
6
-
7
- class MissingVariableError < Error
8
- end
9
-
10
- class BadDefault < Error
11
- end
12
-
13
- class BadFormat < Error
14
- end
15
-
16
- class InvalidType < Error
17
- end
18
-
19
- class InvalidValue < Error
20
- end
21
-
22
- class InvalidBooleanText < InvalidValue
23
- end
24
-
25
- class InvalidRangeText < InvalidValue
26
- end
27
-
28
- class InvalidIntegerText < InvalidValue
29
- end
30
-
31
- class InvalidDateText < InvalidValue
32
- end
33
-
34
- class InvalidDateTimeText < InvalidValue
35
- end
36
-
37
- module AccessHelpers
38
- # (Actually provided by ENV, which these are all extended onto)
39
- def fetch: (String name) -> String?
40
- | (String name, String? default) -> String?
41
-
42
- private def fetch_value: (String name, required: bool) -> String?
43
- private def check_default_type: (String | Symbol context, untyped value, *Class types) -> void
44
- private def check_default_value: (String | Symbol context, untyped value, allow: Enumerable[untyped]) -> void
45
- end
46
-
47
- module FileHelpers : AccessHelpers
48
- def file_path: (String name, default: String?, required: bool) -> Pathname?
49
- end
50
-
51
- module DatetimeHelpers : AccessHelpers
52
- type date_time_result = DateTime? | Time?
53
- def date: (String name, format: String, default: Date?, required: bool) -> Date?
54
- def date_time: (String name, format: String | Symbol, default: date_time_result, required: bool) -> date_time_result
55
- private def parse_date_from: (String? text, format: String) -> Date?
56
- private def parse_date_time_from: (String? text, format: String | Symbol) -> DateTime?
57
- private def iso8601_date_time: (String) -> DateTime?
58
- private def unix_date_time: (String) -> DateTime?
59
- private def strptime_date_time: (String, format: String) -> DateTime?
60
- end
61
-
62
- module NumericHelpers : AccessHelpers
63
- def integer: (String name, default: Integer?, required: bool) -> Integer?
64
- end
65
-
66
- module RangeHelpers : AccessHelpers
67
- def integer_range: (String name, default: Range[Integer]?, required: bool) -> Range[Integer]?
68
- private def check_range_endpoint: (String | Symbol context, untyped value) -> void
69
- private def parse_range_bound_from: (String?) -> Integer?
70
- private def parse_range_from: (String) -> Range[Integer]?
71
- end
72
-
73
- module BooleanHelpers : AccessHelpers
74
- BOOLEAN_VALUES: Set[bool]
75
- def boolean: (String name, default: bool?, required: bool) -> boolish
76
- private def truthy_text?: (String?) -> boolish
77
- private def falsey_text?: (String?) -> boolish
78
- private def truthy_strings: () -> Set[String]
79
- private def falsey_strings: () -> Set[String]
80
- end
81
-
82
- module EnumerableHelpers : AccessHelpers
83
- VALID_TYPES: Array[Symbol]
84
- TYPE_HANDLERS: Hash[Symbol, Symbol]
85
- TYPE_MAP: Hash[Symbol, Class]
86
- type arrayable = Integer | String | Symbol
87
- def array: (String key, of: Symbol, delimiter: String, default: Array[arrayable]?, required: bool) -> Array[arrayable]?
88
- private def check_valid_data_type!: (Symbol) -> void
89
- private def check_default_data_types!: (Array[arrayable]?, Symbol) -> void
90
- end
91
-
92
- module StringHelpers : AccessHelpers
93
- def string: (String name, default: String?, required: bool) -> String?
94
- def symbol: (String name, default: Symbol?, required: bool) -> Symbol?
95
- end
96
- end