giga-pure-mod 0.0.1

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.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/figaro-1.3.0/CHANGELOG.md +129 -0
  3. data/figaro-1.3.0/CONTRIBUTING.md +48 -0
  4. data/figaro-1.3.0/Gemfile +12 -0
  5. data/figaro-1.3.0/LICENSE.txt +22 -0
  6. data/figaro-1.3.0/README.md +351 -0
  7. data/figaro-1.3.0/Rakefile +6 -0
  8. data/figaro-1.3.0/bin/figaro +5 -0
  9. data/figaro-1.3.0/figaro.gemspec +25 -0
  10. data/figaro-1.3.0/gemfiles/rails52.gemfile +11 -0
  11. data/figaro-1.3.0/gemfiles/rails60.gemfile +14 -0
  12. data/figaro-1.3.0/gemfiles/rails61.gemfile +14 -0
  13. data/figaro-1.3.0/gemfiles/rails70.gemfile +14 -0
  14. data/figaro-1.3.0/gemfiles/rails71.gemfile +11 -0
  15. data/figaro-1.3.0/gemfiles/rails72.gemfile +11 -0
  16. data/figaro-1.3.0/gemfiles/rails80.gemfile +11 -0
  17. data/figaro-1.3.0/lib/figaro/application.rb +91 -0
  18. data/figaro-1.3.0/lib/figaro/cli/heroku_set.rb +33 -0
  19. data/figaro-1.3.0/lib/figaro/cli/install/application.yml +11 -0
  20. data/figaro-1.3.0/lib/figaro/cli/install.rb +32 -0
  21. data/figaro-1.3.0/lib/figaro/cli/task.rb +37 -0
  22. data/figaro-1.3.0/lib/figaro/cli.rb +42 -0
  23. data/figaro-1.3.0/lib/figaro/env.rb +45 -0
  24. data/figaro-1.3.0/lib/figaro/error.rb +17 -0
  25. data/figaro-1.3.0/lib/figaro/rails/application.rb +21 -0
  26. data/figaro-1.3.0/lib/figaro/rails/railtie.rb +9 -0
  27. data/figaro-1.3.0/lib/figaro/rails/tasks.rake +6 -0
  28. data/figaro-1.3.0/lib/figaro/rails.rb +9 -0
  29. data/figaro-1.3.0/lib/figaro.rb +32 -0
  30. data/figaro-1.3.0/spec/figaro/application_spec.rb +262 -0
  31. data/figaro-1.3.0/spec/figaro/cli/heroku_set_spec.rb +67 -0
  32. data/figaro-1.3.0/spec/figaro/cli/install_spec.rb +49 -0
  33. data/figaro-1.3.0/spec/figaro/env_spec.rb +195 -0
  34. data/figaro-1.3.0/spec/figaro/rails/application_spec.rb +41 -0
  35. data/figaro-1.3.0/spec/figaro_spec.rb +99 -0
  36. data/figaro-1.3.0/spec/rails_spec.rb +59 -0
  37. data/figaro-1.3.0/spec/spec_helper.rb +8 -0
  38. data/figaro-1.3.0/spec/support/aruba.rb +18 -0
  39. data/figaro-1.3.0/spec/support/bin/heroku +5 -0
  40. data/figaro-1.3.0/spec/support/command_helpers.rb +17 -0
  41. data/figaro-1.3.0/spec/support/command_interceptor.rb +33 -0
  42. data/figaro-1.3.0/spec/support/reset.rb +13 -0
  43. data/giga-pure-mod.gemspec +11 -0
  44. metadata +82 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 2b3b11abe0e10566bddc43f2261334739b0f347c1df2de97b452919a8afc605d
4
+ data.tar.gz: 76bcfb6a81284c033d9390f86c78998d336f6dacda06e1c08a3f3ff7a6c653f7
5
+ SHA512:
6
+ metadata.gz: 25671907765653dca6f48e89e4bd10b1b15465ef1bf1acf61d4a42db006c07f54fec5cf56da93372f71426c74e64ddb1a09e2c4a3908d92eb989c487c0dff7d3
7
+ data.tar.gz: 902eebf2a3e27aa42ade4a34b214fb976863124eda16ceb256f690ad40a97a695a0e2c366fa217306bf78654053cf8ddb28873a5ca47e424c2bd2f1d0b30aee2
@@ -0,0 +1,129 @@
1
+ ## 1.3.0 / 2025-06-25
2
+
3
+ * [ENHANCEMENT] Drop support for Rubies before 2.5
4
+ * [ENHANCEMENT] Add support for Rubies 3.0, 3.1, 3.2, 3.3, and 3.4
5
+ * [ENHANCEMENT] Add support for Rails 6, 7, and 8
6
+
7
+ ## 1.2.0 / 2020-05-10
8
+
9
+ * [ENHANCEMENT] Drop support for Rubies 1.9.3, 2.0, 2.1, and 2.2
10
+ * [ENHANCEMENT] Add support for Rubies 2.5, 2.6, and 2.7
11
+ * [ENHANCEMENT] Drop support for Rails 3 and 4
12
+ * [ENHANCEMENT] Add support for Rails 5.2 and 6.0
13
+ * [ENHANCEMENT] Proxy all ENV values via CLI to the "heroku" command
14
+
15
+ ## 1.1.1 / 2015-04-30
16
+
17
+ * [BUGFIX] Fix crash when environment-specific configuration is `nil`
18
+
19
+ ## 1.1.0 / 2015-01-27
20
+
21
+ * [FEATURE] Support --remote when setting Heroku configuration
22
+ * [ENHANCEMENT] Test against Rails 4.2 (stable)
23
+
24
+ ## 1.0.0 / 2014-09-17
25
+
26
+ * [BUGFIX] Make calls to Heroku with a clean Bundler environment
27
+ * [ENHANCEMENT] Remove Rails as a runtime dependency
28
+ * [FEATURE] Replace the Rails generator with the `figaro install` task
29
+ * [ENHANCEMENT] Rename the `Figaro.require` method to `Figaro.require_keys`
30
+ * [ENHANCEMENT] Begin to test against Rails 4.2 (beta)
31
+
32
+ ## 1.0.0.rc1 / 2014-04-17
33
+
34
+ * [FEATURE] Add bang and boolean methods to `Figaro.env`
35
+ * [ENHANCEMENT] Detach `Figaro.env` from the configuration file hash
36
+ * [FEATURE] Add the ability to swap Figaro's application adapter
37
+ * [FEATURE] Warn when configuration keys or values are not strings
38
+ * [FEATURE] Enable Figaro to load multiple times, overwriting previous values
39
+ * [FEATURE] Load Figaro configuration prior to database configuration
40
+ * [ENHANCEMENT] Test against Ruby 2.1
41
+ * [ENHANCEMENT] Test against Rails 4.1
42
+ * [FEATURE] Replace Rake task with `figaro` executable
43
+ * [BUGFIX] Fix character escaping for `figaro heroku:set` on Windows
44
+ * [FEATURE] Warn when a preexisting configuration key is skipped during load
45
+ * [FEATURE] Add the ability to fail fast in the absence of required keys
46
+ * [FEATURE] Tie into Rails' earliest possible `before_configuration` hook
47
+
48
+ ## 0.7.0 / 2013-06-27
49
+
50
+ * [FEATURE] Allow configuration values to be overridden on the system level
51
+ * [FEATURE] Enable ERB evaluation of the configuration file
52
+
53
+ ## 0.6.4 / 2013-05-01
54
+
55
+ * [BUGFIX] Make the configuration file path platform-independent
56
+ * [FEATURE] Make `Figaro.env` proxy method calls case-insensitive
57
+
58
+ ## 0.6.3 / 2013-03-10
59
+
60
+ * [BUGFIX] Run Heroku commands with a clean Bundler environment
61
+
62
+ ## 0.6.2 / 2013-03-07
63
+
64
+ * [ENHANCEMENT] Refactor `figaro:heroku` task into a unit-tested class
65
+ * [ENHANCEMENT] Relax development gem dependency version requirements
66
+ * [ENHANCEMENT] Track test coverage
67
+
68
+ ## 0.6.1 / 2013-02-27
69
+
70
+ * [ENHANCEMENT] Declare development gem dependencies in gemfiles
71
+ * [BUGFIX] Cast boolean configuration values to strings
72
+ * [ENHANCEMENT] Use RSpec `expect` syntax
73
+
74
+ ## 0.6.0 / 2013-02-26
75
+
76
+ * [ENHANCEMENT] Test against Ruby 2.0.0
77
+ * [ENHANCEMENT] Test against Rails 4.0
78
+
79
+ ## 0.5.4 / 2013-02-22
80
+
81
+ * [ENHANCEMENT] GitHub Ruby Styleguide conventions
82
+ * [ENHANCEMENT] Remove unnecessary development dependencies
83
+ * [FEATURE] Allow `nil` values in `Figaro.env`
84
+
85
+ ## 0.5.3 / 2013-01-12
86
+
87
+ * [BUGFIX] Fix `figaro:heroku` to properly capture standard output... again
88
+
89
+ ## 0.5.2 / 2013-01-07
90
+
91
+ * [BUGFIX] Escape special characters in the `figaro:heroku` task
92
+
93
+ ## 0.5.1 / 2013-01-07
94
+
95
+ * [BUGFIX] Fix `figaro:heroku` to properly capture standard output
96
+
97
+ ## 0.5.0 / 2012-10-28
98
+
99
+ * [BUGFIX] Automatically cast configuration keys and values to strings
100
+ * [FEATURE] Allow the `figaro:heroku` task to respect remote Rails environment
101
+ * [FEATURE] Enable `Figaro.env` to act as a proxy to `ENV`
102
+
103
+ ## 0.4.1 / 2012-04-25
104
+
105
+ * [BUGFIX] Fix `figaro:heroku` Rake task failures
106
+
107
+ ## 0.4.0 / 2012-04-20
108
+
109
+ * [FEATURE] Allow environment-specific configuration
110
+
111
+ ## 0.3.0 / 2012-04-20
112
+
113
+ * [ENHANCEMENT] Refactor the loading configuration into `ENV`
114
+ * [FEATURE] Add `figaro:heroku` Rake task
115
+
116
+ ## 0.2.0 / 2012-04-03
117
+
118
+ * [ENHANCEMENT] Test against multiple Rails versions (3.0, 3.1, 3.2)
119
+ * [FEATURE] Add `figaro:install` Rails generator
120
+ * [BUGFIX] Gracefully parse YAML files containing only comments
121
+
122
+ ## 0.1.1 / 2012-04-02
123
+
124
+ * [ENHANCEMENT] Remove RSpec development gem dependency
125
+ * [ENHANCEMENT] Introduce Figaro, the mascot
126
+
127
+ ## 0.1.0 / 2012-04-02
128
+
129
+ * Initial release!
@@ -0,0 +1,48 @@
1
+ # Contributing to Figaro
2
+
3
+ Figaro is open source and contributions from the community are encouraged! No
4
+ contribution is too small.
5
+
6
+ Please consider:
7
+
8
+ * Adding a feature
9
+ * Squashing a bug
10
+ * Writing documentation
11
+ * Fixing a typo
12
+ * Correcting [style](https://github.com/styleguide/ruby)
13
+
14
+ ## How do I contribute?
15
+
16
+ For the best chance of having your changes merged, please:
17
+
18
+ 1. [Fork](https://github.com/laserlemon/figaro/fork) the project.
19
+ 2. [Write](http://en.wikipedia.org/wiki/Test-driven_development) a failing test.
20
+ 3. [Commit](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) changes that fix the tests.
21
+ 4. [Submit](https://github.com/laserlemon/figaro/pulls) a pull request with *at least* one animated GIF.
22
+ 5. Be patient.
23
+
24
+ If your proposed changes only affect documentation, include the following on a
25
+ new line in each of your commit messages:
26
+
27
+ ```
28
+ [ci skip]
29
+ ```
30
+
31
+ This will signal [Travis](https://travis-ci.org) that running the test suite is
32
+ not necessary for these changes.
33
+
34
+ ## Bug Reports
35
+
36
+ If you are experiencing unexpected behavior and, after having read Figaro's
37
+ documentation, are convinced this behavior is a bug, please:
38
+
39
+ 1. [Search](https://github.com/laserlemon/figaro/issues) existing issues.
40
+ 2. Collect enough information to reproduce the issue:
41
+ * Figaro version
42
+ * Ruby version
43
+ * Rails version
44
+ * Specific setup conditions
45
+ * Description of expected behavior
46
+ * Description of actual behavior
47
+ 3. [Submit](https://github.com/laserlemon/figaro/issues/new) an issue.
48
+ 4. Be patient.
@@ -0,0 +1,12 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ gem "rails", ">= 5.2.0", "< 9"
6
+
7
+ group :test do
8
+ gem "aruba", "~> 2.1"
9
+ gem "ostruct"
10
+ gem "rspec", "~> 3.13"
11
+ gem "sqlite3"
12
+ end
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Steve Richert
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,351 @@
1
+ > [!IMPORTANT]
2
+ > 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).
3
+ >
4
+ > 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! 💛
5
+
6
+ <h1>
7
+ <picture>
8
+ <source media="(prefers-color-scheme: light)" srcset="https://github.com/user-attachments/assets/5fc9ba97-8288-4228-ba4d-03b2bdcdf0f4">
9
+ <source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/1cd8ae2e-afd4-4930-bdc9-147b787ea3fe">
10
+ <img alt="Figaro" src="https://github.com/user-attachments/assets/5fc9ba97-8288-4228-ba4d-03b2bdcdf0f4" style="height:2em">
11
+ </picture>
12
+ </h1>
13
+
14
+ Simple, Heroku-friendly Rails app configuration using `ENV` and a single YAML file
15
+
16
+ [![Made by laserlemon](https://img.shields.io/badge/laser-lemon-fc0?style=flat-square)](https://github.com/laserlemon)
17
+ [![Gem Version](https://img.shields.io/gem/v/figaro?style=flat-square)](https://rubygems.org/gems/figaro)
18
+ [![Build status](https://img.shields.io/github/checks-status/laserlemon/figaro/main?style=flat-square)](https://github.com/laserlemon/figaro/actions)
19
+
20
+ **NOTE:** If you're using Figaro 0.7 or prior, please refer to the
21
+ [appropriate documentation](https://github.com/laserlemon/figaro/tree/0-stable#readme)
22
+ or [upgrade](#how-do-i-upgrade-to-figaro-10) to Figaro 1.0.
23
+
24
+ ## Why does Figaro exist?
25
+
26
+ Figaro was written to make it easy to securely configure Rails applications.
27
+
28
+ Configuration values often include sensitive information. Figaro strives to be
29
+ secure by default by encouraging a convention that keeps configuration out of
30
+ Git.
31
+
32
+ ## How does Figaro work?
33
+
34
+ Figaro is inspired by the [Twelve-Factor App](http://12factor.net) methodology,
35
+ which states:
36
+
37
+ > 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.
38
+
39
+ This is straightforward in production environments but local development
40
+ environments are often shared between multiple applications, requiring multiple
41
+ configurations.
42
+
43
+ Figaro parses a Git-ignored YAML file in your application and loads its values
44
+ into `ENV`.
45
+
46
+ ### Getting Started
47
+
48
+ Add Figaro to your Gemfile and `bundle install`:
49
+
50
+ ```ruby
51
+ gem "figaro"
52
+ ```
53
+
54
+ Figaro installation is easy:
55
+
56
+
57
+ ```bash
58
+ $ bundle exec figaro install
59
+ ```
60
+
61
+ This creates a commented `config/application.yml` file and adds it to your
62
+ `.gitignore`. Add your own configuration to this file and you're done!
63
+
64
+ ### Example
65
+
66
+ Given the following configuration file:
67
+
68
+ ```yaml
69
+ # config/application.yml
70
+
71
+ pusher_app_id: "2954"
72
+ pusher_key: "7381a978f7dd7f9a1117"
73
+ pusher_secret: "abdc3b896a0ffb85d373"
74
+ ```
75
+
76
+ You can configure [Pusher](http://pusher.com) in an initializer:
77
+
78
+ ```ruby
79
+ # config/initializers/pusher.rb
80
+
81
+ Pusher.app_id = ENV["pusher_app_id"]
82
+ Pusher.key = ENV["pusher_key"]
83
+ Pusher.secret = ENV["pusher_secret"]
84
+ ```
85
+
86
+ **Please note:** `ENV` is a simple key/value store. All values will be converted
87
+ to strings. Deeply nested configuration structures are not possible.
88
+
89
+ ### Environment-Specific Configuration
90
+
91
+ Oftentimes, local configuration values change depending on Rails environment. In
92
+ such cases, you can add environment-specific values to your configuration file:
93
+
94
+ ```yaml
95
+ # config/application.yml
96
+
97
+ pusher_app_id: "2954"
98
+ pusher_key: "7381a978f7dd7f9a1117"
99
+ pusher_secret: "abdc3b896a0ffb85d373"
100
+
101
+ test:
102
+ pusher_app_id: "5112"
103
+ pusher_key: "ad69caf9a44dcac1fb28"
104
+ pusher_secret: "83ca7aa160fedaf3b350"
105
+ ```
106
+
107
+ You can also nullify configuration values for a specific environment:
108
+
109
+ ```yaml
110
+ # config/application.yml
111
+
112
+ google_analytics_key: "UA-35722661-5"
113
+
114
+ test:
115
+ google_analytics_key: ~
116
+ ```
117
+
118
+ ### Using `Figaro.env`
119
+
120
+ `Figaro.env` is a convenience that acts as a proxy to `ENV`.
121
+
122
+ In testing, it is sometimes more convenient to stub and unstub `Figaro.env` than
123
+ to set and reset `ENV`. Whether your application uses `ENV` or `Figaro.env` is
124
+ entirely a matter of personal preference.
125
+
126
+ ```yaml
127
+ # config/application.yml
128
+
129
+ stripe_api_key: "sk_live_dSqzdUq80sw9GWmuoI0qJ9rL"
130
+ ```
131
+
132
+ ```ruby
133
+ ENV["stripe_api_key"] # => "sk_live_dSqzdUq80sw9GWmuoI0qJ9rL"
134
+ ENV.key?("stripe_api_key") # => true
135
+ ENV["google_analytics_key"] # => nil
136
+ ENV.key?("google_analytics_key") # => false
137
+
138
+ Figaro.env.stripe_api_key # => "sk_live_dSqzdUq80sw9GWmuoI0qJ9rL"
139
+ Figaro.env.stripe_api_key? # => true
140
+ Figaro.env.google_analytics_key # => nil
141
+ Figaro.env.google_analytics_key? # => false
142
+ ```
143
+
144
+ ### Required Keys
145
+
146
+ If a particular configuration value is required but not set, it's appropriate to
147
+ raise an error. With Figaro, you can either raise these errors proactively or
148
+ lazily.
149
+
150
+ To proactively require configuration keys:
151
+
152
+ ```ruby
153
+ # config/initializers/figaro.rb
154
+
155
+ Figaro.require_keys("pusher_app_id", "pusher_key", "pusher_secret")
156
+ ```
157
+
158
+ If any of the configuration keys above are not set, your application will raise
159
+ an error during initialization. This method is preferred because it prevents
160
+ runtime errors in a production application due to improper configuration.
161
+
162
+ To require configuration keys lazily, reference the variables via "bang" methods
163
+ on `Figaro.env`:
164
+
165
+ ```ruby
166
+ # config/initializers/pusher.rb
167
+
168
+ Pusher.app_id = Figaro.env.pusher_app_id!
169
+ Pusher.key = Figaro.env.pusher_key!
170
+ Pusher.secret = Figaro.env.pusher_secret!
171
+ ```
172
+
173
+ ### Deployment
174
+
175
+ Figaro is written with deployment in mind. In fact, [Heroku](https://www.heroku.com)'s
176
+ use of `ENV` for application configuration was the original inspiration for
177
+ Figaro.
178
+
179
+ #### Heroku
180
+
181
+ Heroku already makes setting application configuration easy:
182
+
183
+ ```bash
184
+ $ heroku config:set google_analytics_key=UA-35722661-5
185
+ ```
186
+
187
+ Using the `figaro` command, you can set values from your configuration file all
188
+ at once:
189
+
190
+ ```bash
191
+ $ figaro heroku:set -e production
192
+ ```
193
+
194
+ For more information:
195
+
196
+ ```bash
197
+ $ figaro help heroku:set
198
+ ```
199
+
200
+ #### Other Hosts
201
+
202
+ If you're not deploying to Heroku, you have two options:
203
+
204
+ * Generate a remote configuration file
205
+ * Set `ENV` variables directly
206
+
207
+ Generating a remote configuration file is preferred because of:
208
+
209
+ * familiarity – Management of `config/application.yml` is like that of `config/database.yml`.
210
+ * isolation – Multiple applications on the same server will not produce configuration key collisions.
211
+
212
+ ## Is Figaro like [dotenv](https://github.com/bkeepers/dotenv)?
213
+
214
+ Yes. Kind of.
215
+
216
+ Figaro and dotenv were written around the same time to solve similar problems.
217
+
218
+ ### Similarities
219
+
220
+ * Both libraries are useful for Ruby application configuration.
221
+ * Both are popular and well maintained.
222
+ * Both are inspired by Twelve-Factor App's concept of proper [configuration](http://12factor.net/config).
223
+ * Both store configuration values in `ENV`.
224
+
225
+ ### Differences
226
+
227
+ * Configuration File
228
+ * Figaro expects a single file.
229
+ * Dotenv supports separate files for each environment.
230
+ * Configuration File Format
231
+ * Figaro expects YAML containing key/value pairs.
232
+ * Dotenv convention is a collection of `KEY=VALUE` pairs.
233
+ * Security vs. Convenience
234
+ * Figaro convention is to never commit configuration files.
235
+ * Dotenv encourages committing configuration files containing development values.
236
+ * Framework Focus
237
+ * Figaro was written with a focus on Rails development and conventions.
238
+ * Dotenv was written to accommodate any type of Ruby application.
239
+
240
+ Either library may suit your configuration needs. It often boils down to
241
+ personal preference.
242
+
243
+ ## 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)?
244
+
245
+ Yes. Kind of.
246
+
247
+ Rails 4.1 introduced the `secrets.yml` convention for Rails application
248
+ configuration. Figaro predated the Rails 4.1 release by two years.
249
+
250
+ ### Similarities
251
+
252
+ * Both are useful for Rails application configuration.
253
+ * Both are popular and well maintained.
254
+ * Both expect a single YAML file.
255
+
256
+ ### Differences
257
+
258
+ * Configuration Access
259
+ * Figaro stores configuration values in `ENV`.
260
+ * Rails stores configuration values in `Rails.application.secrets`.
261
+ * Configuration File Structure
262
+ * Figaro expects YAML containing key/value string pairs.
263
+ * Secrets may contain nested structures with rich objects.
264
+ * Security vs. Convenience
265
+ * Figaro convention is to never commit configuration files.
266
+ * Secrets are committed by default.
267
+ * Consistency
268
+ * Figaro uses `ENV` for configuration in every environment.
269
+ * Secrets encourage using `ENV` for production only.
270
+ * Approach
271
+ * Figaro is inspired by Twelve-Factor App's concept of proper [configuration](http://12factor.net/config).
272
+ * Secrets are… not.
273
+
274
+ The emergence of a configuration convention for Rails is an important step, but
275
+ as long as the last three differences above exist, Figaro will continue to be
276
+ developed as a more secure, more consistent, and more standards-compliant
277
+ alternative to `secrets.yml`.
278
+
279
+ 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.
280
+
281
+ ## How do I upgrade to Figaro 1.0?
282
+
283
+ In most cases, upgrading from Figaro 0.7 to 1.0 is painless. The format
284
+ expectations for `application.yml` are the same in 1.0 and values from
285
+ `application.yml` are loaded into `ENV` as they were in 0.7.
286
+
287
+ However, there are breaking changes:
288
+
289
+ ### `Figaro.env`
290
+
291
+ In Figaro 0.7, calling a method on the `Figaro.env` proxy would raise an error
292
+ if a corresponding key were not set in `ENV`.
293
+
294
+ In Figaro 1.0, calling a method on `Figaro.env` corresponding to an unset key
295
+ will return `nil`. To emulate the behavior of Figaro 0.7, use "bang" methods as
296
+ described in the [Required Keys](#required-keys) section.
297
+
298
+ **NOTE:** In Figaro 0.7, `Figaro.env` inherited from `Hash` but in Figaro 1.0,
299
+ hash access has been removed.
300
+
301
+ ### Heroku Configuration
302
+
303
+ In Figaro 0.7, a Rake task existed to set remote Heroku configuration according
304
+ to values in `application.yml`.
305
+
306
+ In Figaro 1.0, the Rake task was replaced by a command for the `figaro`
307
+ executable:
308
+
309
+ ```bash
310
+ $ figaro heroku:set -e production
311
+ ```
312
+
313
+ For more information:
314
+
315
+ ```bash
316
+ $ figaro help heroku:set
317
+ ```
318
+
319
+ **NOTE:** The environment option is required for the `heroku:set` command. The
320
+ Rake task in Figaro 0.7 used the default of "development" if unspecified.
321
+
322
+ ### Spring Configuration
323
+
324
+ If you're using Spring, either [stop](http://collectiveidea.com/blog/archives/2015/02/04/spring-is-dead-to-me)
325
+ or add `config/application.yml` to the watch list:
326
+
327
+ ```rb
328
+ # config/spring.rb
329
+
330
+ %w(
331
+ ...
332
+ config/application.yml
333
+ ).each { |path| Spring.watch(path) }
334
+ ```
335
+
336
+ ## Who wrote Figaro?
337
+
338
+ My name is Steve Richert and I wrote Figaro in March, 2012 with overwhelming
339
+ encouragement from my employer, [Collective Idea](http://www.collectiveidea.com).
340
+ Figaro has improved very much since then, thanks entirely to [inspiration](https://github.com/laserlemon/figaro/issues)
341
+ and [contribution](https://github.com/laserlemon/figaro/graphs/contributors)
342
+ from developers everywhere.
343
+
344
+ **Thank you!**
345
+
346
+ ## How can I help?
347
+
348
+ Figaro is open source and contributions from the community are encouraged! No
349
+ contribution is too small.
350
+
351
+ See Figaro's [contribution guidelines](CONTRIBUTING.md) for more information.
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "figaro/cli"
4
+
5
+ Figaro::CLI.start
@@ -0,0 +1,25 @@
1
+ # encoding: utf-8
2
+
3
+ Gem::Specification.new do |gem|
4
+ gem.name = "figaro"
5
+ gem.version = "1.3.0"
6
+
7
+ gem.author = "Steve Richert"
8
+ gem.email = "steve.richert@hey.com"
9
+ gem.summary = "Simple Rails app configuration"
10
+ gem.description = "Simple, Heroku-friendly Rails app configuration using ENV and a single YAML file"
11
+ gem.homepage = "https://github.com/laserlemon/figaro"
12
+ gem.license = "MIT"
13
+
14
+ gem.required_ruby_version = ">= 2.5.0"
15
+
16
+ gem.add_dependency "thor", ">= 0.14.0", "< 2"
17
+
18
+ gem.add_development_dependency "bundler", ">= 1.7.0", "< 3"
19
+ gem.add_development_dependency "rake", ">= 10.4.0", "< 14"
20
+
21
+ gem.files = `git ls-files`.split($\)
22
+ gem.test_files = gem.files.grep(/^spec/)
23
+
24
+ gem.executables << "figaro"
25
+ end
@@ -0,0 +1,11 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec path: ".."
4
+
5
+ gem "rails", "~> 5.2.0"
6
+
7
+ group :test do
8
+ gem "aruba", "~> 2.1"
9
+ gem "rspec", "~> 3.13"
10
+ gem "sqlite3", "~> 1.4"
11
+ end
@@ -0,0 +1,14 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec path: ".."
4
+
5
+ gem "rails", "~> 6.0.0"
6
+
7
+ # See: https://github.com/rails/rails/issues/54263
8
+ gem "concurrent-ruby", "< 1.3.5"
9
+
10
+ group :test do
11
+ gem "aruba", "~> 2.1"
12
+ gem "rspec", "~> 3.13"
13
+ gem "sqlite3", "~> 1.4"
14
+ end
@@ -0,0 +1,14 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec path: ".."
4
+
5
+ gem "rails", "~> 6.1.0"
6
+
7
+ # See: https://github.com/rails/rails/issues/54263
8
+ gem "concurrent-ruby", "< 1.3.5"
9
+
10
+ group :test do
11
+ gem "aruba", "~> 2.1"
12
+ gem "rspec", "~> 3.13"
13
+ gem "sqlite3", "~> 1.4"
14
+ end
@@ -0,0 +1,14 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec path: ".."
4
+
5
+ gem "rails", "~> 7.0.0"
6
+
7
+ # See: https://github.com/rails/rails/issues/54263
8
+ gem "concurrent-ruby", "< 1.3.5"
9
+
10
+ group :test do
11
+ gem "aruba", "~> 2.1"
12
+ gem "rspec", "~> 3.13"
13
+ gem "sqlite3", "~> 1.4"
14
+ end
@@ -0,0 +1,11 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec path: ".."
4
+
5
+ gem "rails", "~> 7.1.0"
6
+
7
+ group :test do
8
+ gem "aruba", "~> 2.1"
9
+ gem "rspec", "~> 3.13"
10
+ gem "sqlite3"
11
+ end