figaro 1.1.1 → 1.2.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 +5 -5
- data/.github/FUNDING.yml +1 -0
- data/.gitignore +1 -1
- data/.travis.yml +9 -20
- data/CHANGELOG.md +8 -0
- data/Gemfile +4 -5
- data/README.md +73 -25
- data/figaro.gemspec +4 -4
- data/gemfiles/rails52.gemfile +11 -0
- data/gemfiles/rails6.gemfile +11 -0
- data/gemfiles/rails60.gemfile +11 -0
- data/lib/figaro/cli.rb +1 -0
- data/lib/figaro/cli/heroku_set.rb +1 -1
- data/lib/figaro/cli/task.rb +4 -0
- data/spec/figaro/cli/heroku_set_spec.rb +7 -7
- data/spec/figaro/cli/install_spec.rb +13 -13
- data/spec/rails_spec.rb +15 -10
- data/spec/spec_helper.rb +0 -5
- data/spec/support/aruba.rb +2 -3
- metadata +37 -22
- data/gemfiles/rails30.gemfile +0 -12
- data/gemfiles/rails31.gemfile +0 -12
- data/gemfiles/rails32.gemfile +0 -12
- data/gemfiles/rails40.gemfile +0 -12
- data/gemfiles/rails41.gemfile +0 -12
- data/gemfiles/rails42.gemfile +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b1a27ab5ff5cd4f370108899e90aace61d3ff641a6c1fa08240d4884d4c13b99
|
4
|
+
data.tar.gz: 88f024b11dae3709acd91bb630be9f38f009251726745fea02a0247d260d9aa0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a32dbbd19c9825fdba50293d355968a5519d2d024a94122cdd34807e1163cde8c1d788f65c2c74f615c3b655026efbc6755c91243dff90c575d91cda5ef7c425
|
7
|
+
data.tar.gz: 27504e04547f47cdd49bb5e913cda2bbd7c838d7dd224e362dc993039a94144c63d86c0c71b5496b0dfd82c45b4e832e5e63db1fcf28f1e1ddac6d7fdaadeedc
|
data/.github/FUNDING.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
github: [laserlemon]
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -6,29 +6,18 @@ before_script:
|
|
6
6
|
branches:
|
7
7
|
only:
|
8
8
|
- master
|
9
|
-
cache: bundler
|
10
|
-
env:
|
11
|
-
global:
|
12
|
-
secure: | # CODECLIMATE_REPO_TOKEN
|
13
|
-
Pm3j2/BtAzMtqRMP83rFvDtpUNeIAdLMzwH62In+3h/AE8gHDArGYS+jmChw
|
14
|
-
2hKVjwzVUTWZlpSEocqAg/YIDB3BJzWmyc6UP+VA0gji6HsufXYTmKAVPSVY
|
15
|
-
TQ7mPPP7hm95e3SkFbLdLbGkQfLdjIKeMY5lY/knX+QKUCjO52Y=
|
16
9
|
gemfile:
|
17
|
-
- gemfiles/
|
18
|
-
- gemfiles/
|
19
|
-
- gemfiles/
|
20
|
-
|
21
|
-
- gemfiles/rails41.gemfile
|
22
|
-
- gemfiles/rails42.gemfile
|
23
|
-
language: ruby
|
24
|
-
matrix:
|
10
|
+
- gemfiles/rails52.gemfile
|
11
|
+
- gemfiles/rails60.gemfile
|
12
|
+
- gemfiles/rails6.gemfile
|
13
|
+
jobs:
|
25
14
|
allow_failures:
|
26
15
|
- rvm: ruby-head
|
16
|
+
- gemfile: gemfiles/rails6.gemfile
|
17
|
+
language: ruby
|
27
18
|
rvm:
|
28
|
-
-
|
29
|
-
- "2.
|
30
|
-
- "2.
|
31
|
-
- "2.2"
|
19
|
+
- "2.5"
|
20
|
+
- "2.6"
|
21
|
+
- "2.7"
|
32
22
|
- ruby-head
|
33
23
|
script: bundle exec rspec
|
34
|
-
sudo: false
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## 1.2.0 / 2020-05-10
|
2
|
+
|
3
|
+
* [ENHANCEMENT] Drop support for Rubies 1.9.3, 2.0, 2.1, and 2.2
|
4
|
+
* [ENHANCEMENT] Add support for Rubies 2.5, 2.6, and 2.7
|
5
|
+
* [ENHANCEMENT] Drop support for Rails 3 and 4
|
6
|
+
* [ENHANCEMENT] Add support for Rails 5.2 and 6.0
|
7
|
+
* [ENHANCEMENT] Proxy all ENV values via CLI to the "heroku" command
|
8
|
+
|
1
9
|
## 1.1.1 / 2015-04-30
|
2
10
|
|
3
11
|
* [BUGFIX] Fix crash when environment-specific configuration is `nil`
|
data/Gemfile
CHANGED
@@ -2,11 +2,10 @@ source "https://rubygems.org"
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
gem "rails", ">=
|
5
|
+
gem "rails", ">= 5.2.0", "< 6.1"
|
6
6
|
|
7
7
|
group :test do
|
8
|
-
gem "aruba", "~> 0
|
9
|
-
gem "
|
10
|
-
gem "
|
11
|
-
gem "sqlite3", "~> 1.3"
|
8
|
+
gem "aruba", "~> 1.0"
|
9
|
+
gem "rspec", "~> 3.9"
|
10
|
+
gem "sqlite3"
|
12
11
|
end
|
data/README.md
CHANGED
@@ -1,30 +1,41 @@
|
|
1
|
+
## 📢 UPDATE
|
2
|
+
|
3
|
+
Figaro [v2](https://github.com/laserlemon/figaro/tree/v2) development is underway but _stalled_. I need your help! Please consider [sponsoring Figaro's development](https://github.com/sponsors/laserlemon).
|
4
|
+
|
5
|
+
With the constraints of a family and a full-time job, even the _emotional_ support that sponsorship provides is extremely valuable in re-energizing Figaro development. Thank you! 💛
|
6
|
+
|
1
7
|
# 
|
2
8
|
|
3
9
|
Simple, Heroku-friendly Rails app configuration using `ENV` and a single YAML file
|
4
10
|
|
5
|
-
[](https://codeclimate.com/github/laserlemon/figaro)
|
8
|
-
[](https://codeclimate.com/github/laserlemon/figaro)
|
9
|
-
[](https://gemnasium.com/laserlemon/figaro)
|
11
|
+
[](http://badge.fury.io/rb/figaro)
|
12
|
+
[](https://travis-ci.org/laserlemon/figaro)
|
10
13
|
|
11
|
-
**NOTE:** If you're using Figaro 0.7 or prior, please refer to the
|
14
|
+
**NOTE:** If you're using Figaro 0.7 or prior, please refer to the
|
15
|
+
[appropriate documentation](https://github.com/laserlemon/figaro/tree/0-stable#readme)
|
16
|
+
or [upgrade](#how-do-i-upgrade-to-figaro-10) to Figaro 1.0.
|
12
17
|
|
13
18
|
## Why does Figaro exist?
|
14
19
|
|
15
20
|
Figaro was written to make it easy to securely configure Rails applications.
|
16
21
|
|
17
|
-
Configuration values often include sensitive information. Figaro strives to be
|
22
|
+
Configuration values often include sensitive information. Figaro strives to be
|
23
|
+
secure by default by encouraging a convention that keeps configuration out of
|
24
|
+
Git.
|
18
25
|
|
19
26
|
## How does Figaro work?
|
20
27
|
|
21
|
-
Figaro is inspired by the [Twelve-Factor App](http://12factor.net) methodology,
|
28
|
+
Figaro is inspired by the [Twelve-Factor App](http://12factor.net) methodology,
|
29
|
+
which states:
|
22
30
|
|
23
31
|
> The twelve-factor app stores config in environment variables (often shortened to env vars or env). Env vars are easy to change between deploys without changing any code; unlike config files, there is little chance of them being checked into the code repo accidentally; and unlike custom config files, or other config mechanisms such as Java System Properties, they are a language- and OS-agnostic standard.
|
24
32
|
|
25
|
-
This is straightforward in production environments but local development
|
33
|
+
This is straightforward in production environments but local development
|
34
|
+
environments are often shared between multiple applications, requiring multiple
|
35
|
+
configurations.
|
26
36
|
|
27
|
-
Figaro parses a Git-ignored YAML file in your application and loads its values
|
37
|
+
Figaro parses a Git-ignored YAML file in your application and loads its values
|
38
|
+
into `ENV`.
|
28
39
|
|
29
40
|
### Getting Started
|
30
41
|
|
@@ -38,10 +49,11 @@ Figaro installation is easy:
|
|
38
49
|
|
39
50
|
|
40
51
|
```bash
|
41
|
-
$ figaro install
|
52
|
+
$ bundle exec figaro install
|
42
53
|
```
|
43
54
|
|
44
|
-
This creates a commented `config/application.yml` file and adds it to your
|
55
|
+
This creates a commented `config/application.yml` file and adds it to your
|
56
|
+
`.gitignore`. Add your own configuration to this file and you're done!
|
45
57
|
|
46
58
|
### Example
|
47
59
|
|
@@ -65,11 +77,13 @@ Pusher.key = ENV["pusher_key"]
|
|
65
77
|
Pusher.secret = ENV["pusher_secret"]
|
66
78
|
```
|
67
79
|
|
68
|
-
**Please note:** `ENV` is a simple key/value store. All values will be converted
|
80
|
+
**Please note:** `ENV` is a simple key/value store. All values will be converted
|
81
|
+
to strings. Deeply nested configuration structures are not possible.
|
69
82
|
|
70
83
|
### Environment-Specific Configuration
|
71
84
|
|
72
|
-
Oftentimes, local configuration values change depending on Rails environment. In
|
85
|
+
Oftentimes, local configuration values change depending on Rails environment. In
|
86
|
+
such cases, you can add environment-specific values to your configuration file:
|
73
87
|
|
74
88
|
```yaml
|
75
89
|
# config/application.yml
|
@@ -99,7 +113,9 @@ test:
|
|
99
113
|
|
100
114
|
`Figaro.env` is a convenience that acts as a proxy to `ENV`.
|
101
115
|
|
102
|
-
In testing, it is sometimes more convenient to stub and unstub `Figaro.env` than
|
116
|
+
In testing, it is sometimes more convenient to stub and unstub `Figaro.env` than
|
117
|
+
to set and reset `ENV`. Whether your application uses `ENV` or `Figaro.env` is
|
118
|
+
entirely a matter of personal preference.
|
103
119
|
|
104
120
|
```yaml
|
105
121
|
# config/application.yml
|
@@ -121,7 +137,9 @@ Figaro.env.google_analytics_key? # => false
|
|
121
137
|
|
122
138
|
### Required Keys
|
123
139
|
|
124
|
-
If a particular configuration value is required but not set, it's appropriate to
|
140
|
+
If a particular configuration value is required but not set, it's appropriate to
|
141
|
+
raise an error. With Figaro, you can either raise these errors proactively or
|
142
|
+
lazily.
|
125
143
|
|
126
144
|
To proactively require configuration keys:
|
127
145
|
|
@@ -131,9 +149,12 @@ To proactively require configuration keys:
|
|
131
149
|
Figaro.require_keys("pusher_app_id", "pusher_key", "pusher_secret")
|
132
150
|
```
|
133
151
|
|
134
|
-
If any of the configuration keys above are not set, your application will raise
|
152
|
+
If any of the configuration keys above are not set, your application will raise
|
153
|
+
an error during initialization. This method is preferred because it prevents
|
154
|
+
runtime errors in a production application due to improper configuration.
|
135
155
|
|
136
|
-
To require configuration keys lazily, reference the variables via "bang" methods
|
156
|
+
To require configuration keys lazily, reference the variables via "bang" methods
|
157
|
+
on `Figaro.env`:
|
137
158
|
|
138
159
|
```ruby
|
139
160
|
# config/initializers/pusher.rb
|
@@ -145,7 +166,9 @@ Pusher.secret = Figaro.env.pusher_secret!
|
|
145
166
|
|
146
167
|
### Deployment
|
147
168
|
|
148
|
-
Figaro is written with deployment in mind. In fact, [Heroku](https://www.heroku.com)'s
|
169
|
+
Figaro is written with deployment in mind. In fact, [Heroku](https://www.heroku.com)'s
|
170
|
+
use of `ENV` for application configuration was the original inspiration for
|
171
|
+
Figaro.
|
149
172
|
|
150
173
|
#### Heroku
|
151
174
|
|
@@ -155,7 +178,8 @@ Heroku already makes setting application configuration easy:
|
|
155
178
|
$ heroku config:set google_analytics_key=UA-35722661-5
|
156
179
|
```
|
157
180
|
|
158
|
-
Using the `figaro` command, you can set values from your configuration file all
|
181
|
+
Using the `figaro` command, you can set values from your configuration file all
|
182
|
+
at once:
|
159
183
|
|
160
184
|
```bash
|
161
185
|
$ figaro heroku:set -e production
|
@@ -207,13 +231,15 @@ Figaro and dotenv were written around the same time to solve similar problems.
|
|
207
231
|
* Figaro was written with a focus on Rails development and conventions.
|
208
232
|
* Dotenv was written to accommodate any type of Ruby application.
|
209
233
|
|
210
|
-
Either library may suit your configuration needs. It often boils down to
|
234
|
+
Either library may suit your configuration needs. It often boils down to
|
235
|
+
personal preference.
|
211
236
|
|
212
237
|
## Is application.yml like [secrets.yml](https://github.com/rails/rails/blob/v4.1.0/railties/lib/rails/generators/rails/app/templates/config/secrets.yml)?
|
213
238
|
|
214
239
|
Yes. Kind of.
|
215
240
|
|
216
|
-
Rails 4.1 introduced the `secrets.yml` convention for Rails application
|
241
|
+
Rails 4.1 introduced the `secrets.yml` convention for Rails application
|
242
|
+
configuration. Figaro predated the Rails 4.1 release by two years.
|
217
243
|
|
218
244
|
### Similarities
|
219
245
|
|
@@ -239,7 +265,10 @@ Rails 4.1 introduced the `secrets.yml` convention for Rails application configur
|
|
239
265
|
* Figaro is inspired by Twelve-Factor App's concept of proper [configuration](http://12factor.net/config).
|
240
266
|
* Secrets are… not.
|
241
267
|
|
242
|
-
The emergence of a configuration convention for Rails is an important step, but
|
268
|
+
The emergence of a configuration convention for Rails is an important step, but
|
269
|
+
as long as the last three differences above exist, Figaro will continue to be
|
270
|
+
developed as a more secure, more consistent, and more standards-compliant
|
271
|
+
alternative to `secrets.yml`.
|
243
272
|
|
244
273
|
For more information, read the original [The Marriage of Figaro… and Rails](http://www.collectiveidea.com/blog/archives/2013/12/18/the-marriage-of-figaro-and-rails/) blog post.
|
245
274
|
|
@@ -284,14 +313,33 @@ $ figaro help heroku:set
|
|
284
313
|
**NOTE:** The environment option is required for the `heroku:set` command. The
|
285
314
|
Rake task in Figaro 0.7 used the default of "development" if unspecified.
|
286
315
|
|
316
|
+
### Spring Configuration
|
317
|
+
|
318
|
+
If you're using Spring, either [stop](http://collectiveidea.com/blog/archives/2015/02/04/spring-is-dead-to-me)
|
319
|
+
or add `config/application.yml` to the watch list:
|
320
|
+
|
321
|
+
```rb
|
322
|
+
# config/spring.rb
|
323
|
+
|
324
|
+
%w(
|
325
|
+
...
|
326
|
+
config/application.yml
|
327
|
+
).each { |path| Spring.watch(path) }
|
328
|
+
```
|
329
|
+
|
287
330
|
## Who wrote Figaro?
|
288
331
|
|
289
|
-
My name is Steve Richert and I wrote Figaro in March, 2012 with overwhelming
|
332
|
+
My name is Steve Richert and I wrote Figaro in March, 2012 with overwhelming
|
333
|
+
encouragement from my employer, [Collective Idea](http://www.collectiveidea.com).
|
334
|
+
Figaro has improved very much since then, thanks entirely to [inspiration](https://github.com/laserlemon/figaro/issues)
|
335
|
+
and [contribution](https://github.com/laserlemon/figaro/graphs/contributors)
|
336
|
+
from developers everywhere.
|
290
337
|
|
291
338
|
**Thank you!**
|
292
339
|
|
293
340
|
## How can I help?
|
294
341
|
|
295
|
-
Figaro is open source and contributions from the community are encouraged! No
|
342
|
+
Figaro is open source and contributions from the community are encouraged! No
|
343
|
+
contribution is too small.
|
296
344
|
|
297
345
|
See Figaro's [contribution guidelines](CONTRIBUTING.md) for more information.
|
data/figaro.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = "figaro"
|
5
|
-
gem.version = "1.
|
5
|
+
gem.version = "1.2.0"
|
6
6
|
|
7
7
|
gem.author = "Steve Richert"
|
8
8
|
gem.email = "steve.richert@gmail.com"
|
@@ -11,10 +11,10 @@ Gem::Specification.new do |gem|
|
|
11
11
|
gem.homepage = "https://github.com/laserlemon/figaro"
|
12
12
|
gem.license = "MIT"
|
13
13
|
|
14
|
-
gem.add_dependency "thor", "
|
14
|
+
gem.add_dependency "thor", ">= 0.14.0", "< 2"
|
15
15
|
|
16
|
-
gem.add_development_dependency "bundler", "
|
17
|
-
gem.add_development_dependency "rake", "
|
16
|
+
gem.add_development_dependency "bundler", ">= 1.7.0", "< 3"
|
17
|
+
gem.add_development_dependency "rake", ">= 10.4.0", "< 14"
|
18
18
|
|
19
19
|
gem.files = `git ls-files`.split($\)
|
20
20
|
gem.test_files = gem.files.grep(/^spec/)
|
data/lib/figaro/cli.rb
CHANGED
data/lib/figaro/cli/task.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
describe "figaro heroku:set" do
|
2
2
|
before do
|
3
|
-
|
3
|
+
create_directory("example")
|
4
4
|
cd("example")
|
5
5
|
write_file("config/application.yml", "foo: bar")
|
6
6
|
end
|
7
7
|
|
8
8
|
it "sends Figaro configuration to Heroku" do
|
9
|
-
|
9
|
+
run_command_and_stop("figaro heroku:set")
|
10
10
|
|
11
11
|
command = commands.last
|
12
12
|
expect(command.name).to eq("heroku")
|
@@ -16,7 +16,7 @@ describe "figaro heroku:set" do
|
|
16
16
|
it "respects path" do
|
17
17
|
write_file("env.yml", "foo: bar")
|
18
18
|
|
19
|
-
|
19
|
+
run_command_and_stop("figaro heroku:set -p env.yml")
|
20
20
|
|
21
21
|
command = commands.last
|
22
22
|
expect(command.name).to eq("heroku")
|
@@ -30,7 +30,7 @@ test:
|
|
30
30
|
foo: baz
|
31
31
|
EOF
|
32
32
|
|
33
|
-
|
33
|
+
run_command_and_stop("figaro heroku:set -e test")
|
34
34
|
|
35
35
|
command = commands.last
|
36
36
|
expect(command.name).to eq("heroku")
|
@@ -38,7 +38,7 @@ EOF
|
|
38
38
|
end
|
39
39
|
|
40
40
|
it "targets a specific Heroku app" do
|
41
|
-
|
41
|
+
run_command_and_stop("figaro heroku:set -a foo-bar-app")
|
42
42
|
|
43
43
|
command = commands.last
|
44
44
|
expect(command.name).to eq("heroku")
|
@@ -47,7 +47,7 @@ EOF
|
|
47
47
|
end
|
48
48
|
|
49
49
|
it "targets a specific Heroku git remote" do
|
50
|
-
|
50
|
+
run_command_and_stop("figaro heroku:set -r production")
|
51
51
|
|
52
52
|
command = commands.last
|
53
53
|
expect(command.name).to eq("heroku")
|
@@ -58,7 +58,7 @@ EOF
|
|
58
58
|
it "handles values with special characters" do
|
59
59
|
overwrite_file("config/application.yml", "foo: bar baz")
|
60
60
|
|
61
|
-
|
61
|
+
run_command_and_stop("figaro heroku:set")
|
62
62
|
|
63
63
|
command = commands.last
|
64
64
|
expect(command.name).to eq("heroku")
|
@@ -1,19 +1,19 @@
|
|
1
1
|
describe "figaro install" do
|
2
2
|
before do
|
3
|
-
|
3
|
+
create_directory("example")
|
4
4
|
cd("example")
|
5
5
|
end
|
6
6
|
|
7
7
|
it "creates a configuration file" do
|
8
|
-
|
8
|
+
run_command_and_stop("figaro install")
|
9
9
|
|
10
|
-
|
10
|
+
expect("config/application.yml").to be_an_existing_file
|
11
11
|
end
|
12
12
|
|
13
13
|
it "respects path" do
|
14
|
-
|
14
|
+
run_command_and_stop("figaro install -p env.yml")
|
15
15
|
|
16
|
-
|
16
|
+
expect("env.yml").to be_an_existing_file
|
17
17
|
end
|
18
18
|
|
19
19
|
context "with a .gitignore file" do
|
@@ -25,25 +25,25 @@ EOF
|
|
25
25
|
end
|
26
26
|
|
27
27
|
it "Git-ignores the configuration file if applicable" do
|
28
|
-
|
28
|
+
run_command_and_stop("figaro install")
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
expect(".gitignore").to have_file_content(%r(^/foo$))
|
31
|
+
expect(".gitignore").to have_file_content(%r(^/bar$))
|
32
|
+
expect(".gitignore").to have_file_content(%r(^/config/application\.yml$))
|
33
33
|
end
|
34
34
|
|
35
35
|
it "respects path" do
|
36
|
-
|
36
|
+
run_command_and_stop("figaro install -p env.yml")
|
37
37
|
|
38
|
-
|
38
|
+
expect(".gitignore").to have_file_content(%r(^/env\.yml$))
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
42
|
context "without a .gitignore file" do
|
43
43
|
it "doesn't generate a new .gitignore file" do
|
44
|
-
|
44
|
+
run_command_and_stop("figaro install")
|
45
45
|
|
46
|
-
|
46
|
+
expect(".gitignore").not_to be_an_existing_file
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
data/spec/rails_spec.rb
CHANGED
@@ -1,15 +1,20 @@
|
|
1
1
|
describe Figaro::Rails do
|
2
2
|
before do
|
3
|
-
|
3
|
+
run_command_and_stop(<<-CMD)
|
4
4
|
rails new example \
|
5
5
|
--skip-gemfile \
|
6
|
-
--skip-
|
6
|
+
--skip-git \
|
7
7
|
--skip-keeps \
|
8
8
|
--skip-sprockets \
|
9
|
+
--skip-spring \
|
10
|
+
--skip-listen \
|
9
11
|
--skip-javascript \
|
10
|
-
--skip-
|
12
|
+
--skip-turbolinks \
|
13
|
+
--skip-test \
|
14
|
+
--skip-bootsnap \
|
11
15
|
--no-rc \
|
12
|
-
--
|
16
|
+
--skip-bundle \
|
17
|
+
--skip-webpack-install
|
13
18
|
CMD
|
14
19
|
cd("example")
|
15
20
|
end
|
@@ -20,9 +25,9 @@ describe Figaro::Rails do
|
|
20
25
|
end
|
21
26
|
|
22
27
|
it "loads application.yml" do
|
23
|
-
|
28
|
+
run_command_and_stop("rails runner 'puts Figaro.env.foo'")
|
24
29
|
|
25
|
-
|
30
|
+
expect(all_stdout).to include("bar")
|
26
31
|
end
|
27
32
|
|
28
33
|
it "happens before database initialization" do
|
@@ -32,9 +37,9 @@ development:
|
|
32
37
|
database: db/<%= ENV["foo"] %>.sqlite3
|
33
38
|
EOF
|
34
39
|
|
35
|
-
|
40
|
+
run_command_and_stop("rake db:migrate")
|
36
41
|
|
37
|
-
|
42
|
+
expect("db/bar.sqlite3").to be_an_existing_file
|
38
43
|
end
|
39
44
|
|
40
45
|
it "happens before application configuration" do
|
@@ -42,9 +47,9 @@ EOF
|
|
42
47
|
config.foo = ENV["foo"]
|
43
48
|
EOL
|
44
49
|
|
45
|
-
|
50
|
+
run_command_and_stop("rails runner 'puts Rails.application.config.foo'")
|
46
51
|
|
47
|
-
|
52
|
+
expect(all_stdout).to include("bar")
|
48
53
|
end
|
49
54
|
end
|
50
55
|
end
|
data/spec/spec_helper.rb
CHANGED
data/spec/support/aruba.rb
CHANGED
@@ -2,7 +2,7 @@ require "aruba/api"
|
|
2
2
|
|
3
3
|
module ArubaHelpers
|
4
4
|
def insert_into_file_after(file, pattern, addition)
|
5
|
-
content =
|
5
|
+
content = cd(".") { IO.read(file) }
|
6
6
|
content.sub!(pattern, "\\0\n#{addition}")
|
7
7
|
overwrite_file(file, content)
|
8
8
|
end
|
@@ -13,7 +13,6 @@ RSpec.configure do |config|
|
|
13
13
|
config.include(ArubaHelpers)
|
14
14
|
|
15
15
|
config.before do
|
16
|
-
|
17
|
-
FileUtils.rm_rf(current_dir)
|
16
|
+
setup_aruba
|
18
17
|
end
|
19
18
|
end
|
metadata
CHANGED
@@ -1,57 +1,75 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: figaro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Richert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.14.0
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '2'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.14.0
|
30
|
+
- - "<"
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
32
|
+
version: '2'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: bundler
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
|
-
- - "
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 1.7.0
|
40
|
+
- - "<"
|
32
41
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
42
|
+
version: '3'
|
34
43
|
type: :development
|
35
44
|
prerelease: false
|
36
45
|
version_requirements: !ruby/object:Gem::Requirement
|
37
46
|
requirements:
|
38
|
-
- - "
|
47
|
+
- - ">="
|
39
48
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
49
|
+
version: 1.7.0
|
50
|
+
- - "<"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '3'
|
41
53
|
- !ruby/object:Gem::Dependency
|
42
54
|
name: rake
|
43
55
|
requirement: !ruby/object:Gem::Requirement
|
44
56
|
requirements:
|
45
|
-
- - "
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 10.4.0
|
60
|
+
- - "<"
|
46
61
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
62
|
+
version: '14'
|
48
63
|
type: :development
|
49
64
|
prerelease: false
|
50
65
|
version_requirements: !ruby/object:Gem::Requirement
|
51
66
|
requirements:
|
52
|
-
- - "
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 10.4.0
|
70
|
+
- - "<"
|
53
71
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
72
|
+
version: '14'
|
55
73
|
description: Simple, Heroku-friendly Rails app configuration using ENV and a single
|
56
74
|
YAML file
|
57
75
|
email: steve.richert@gmail.com
|
@@ -60,6 +78,7 @@ executables:
|
|
60
78
|
extensions: []
|
61
79
|
extra_rdoc_files: []
|
62
80
|
files:
|
81
|
+
- ".github/FUNDING.yml"
|
63
82
|
- ".gitignore"
|
64
83
|
- ".rspec"
|
65
84
|
- ".travis.yml"
|
@@ -71,12 +90,9 @@ files:
|
|
71
90
|
- Rakefile
|
72
91
|
- bin/figaro
|
73
92
|
- figaro.gemspec
|
74
|
-
- gemfiles/
|
75
|
-
- gemfiles/
|
76
|
-
- gemfiles/
|
77
|
-
- gemfiles/rails40.gemfile
|
78
|
-
- gemfiles/rails41.gemfile
|
79
|
-
- gemfiles/rails42.gemfile
|
93
|
+
- gemfiles/rails52.gemfile
|
94
|
+
- gemfiles/rails6.gemfile
|
95
|
+
- gemfiles/rails60.gemfile
|
80
96
|
- lib/figaro.rb
|
81
97
|
- lib/figaro/application.rb
|
82
98
|
- lib/figaro/cli.rb
|
@@ -122,8 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
138
|
- !ruby/object:Gem::Version
|
123
139
|
version: '0'
|
124
140
|
requirements: []
|
125
|
-
|
126
|
-
rubygems_version: 2.4.6
|
141
|
+
rubygems_version: 3.1.3
|
127
142
|
signing_key:
|
128
143
|
specification_version: 4
|
129
144
|
summary: Simple Rails app configuration
|
data/gemfiles/rails30.gemfile
DELETED
data/gemfiles/rails31.gemfile
DELETED
data/gemfiles/rails32.gemfile
DELETED
data/gemfiles/rails40.gemfile
DELETED
data/gemfiles/rails41.gemfile
DELETED
data/gemfiles/rails42.gemfile
DELETED