tiny-sharp-pkg 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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c4543851430a13863953c23b10c0a462d304e1d02659da74e2f309cab18c0eae
4
+ data.tar.gz: 778e274116662847af9cd8c0d8bb70875374c834a72f4a67b09ed337dd98f148
5
+ SHA512:
6
+ metadata.gz: 60cde224a77b692153ec7959bb36bbb5799592481eb91905eb0349ffbc67b52abb1ef4d089eece9572567a77085c6b676429c29b489ec7cbed19f984ff416210
7
+ data.tar.gz: f3be7f0dac7f9822913e02e9436dfd0767958d69a37e885141fc4dfe0759ddcfb2a3d2700d08d2aeeef7719c41a86b52142f8d48004d9cd6a3de8f1c65826b76
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Brandon Keepers
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,337 @@
1
+ # dotenv [![Gem Version](https://badge.fury.io/rb/dotenv.svg)](https://badge.fury.io/rb/dotenv)
2
+
3
+ Shim to load environment variables from `.env` into `ENV` in *development*.
4
+
5
+ Storing [configuration in the environment](http://12factor.net/config) is one of the tenets of a [twelve-factor app](http://12factor.net). Anything that is likely to change between deployment environments–such as resource handles for databases or credentials for external services–should be extracted from the code into environment variables.
6
+
7
+ But it is not always practical to set environment variables on development machines or continuous integration servers where multiple projects are run. dotenv loads variables from a `.env` file into `ENV` when the environment is bootstrapped.
8
+
9
+ ## Installation
10
+
11
+ Add this line to the top of your application's Gemfile and run `bundle install`:
12
+
13
+ ```ruby
14
+ gem 'dotenv', groups: [:development, :test]
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ Add your application configuration to your `.env` file in the root of your project:
20
+
21
+ ```shell
22
+ S3_BUCKET=YOURS3BUCKET
23
+ SECRET_KEY=YOURSECRETKEYGOESHERE
24
+ ```
25
+
26
+ Whenever your application loads, these variables will be available in `ENV`:
27
+
28
+ ```ruby
29
+ config.fog_directory = ENV['S3_BUCKET']
30
+ ```
31
+
32
+ See the [API Docs](https://rubydoc.info/github/bkeepers/dotenv/main) for more.
33
+
34
+ ### Rails
35
+
36
+ Dotenv will automatically load when your Rails app boots. See [Customizing Rails](#customizing-rails) to change which files are loaded and when.
37
+
38
+ ### Sinatra / Ruby
39
+
40
+ Load Dotenv as early as possible in your application bootstrap process:
41
+
42
+ ```ruby
43
+ require 'dotenv/load'
44
+
45
+ # or
46
+ require 'dotenv'
47
+ Dotenv.load
48
+ ```
49
+
50
+ By default, `load` will look for a file called `.env` in the current working directory.
51
+ Pass in multiple files and they will be loaded in order.
52
+ The first value set for a variable will win.
53
+ Existing environment variables will not be overwritten unless you set `overwrite: true`.
54
+
55
+ ```ruby
56
+ require 'dotenv'
57
+ Dotenv.load('file1.env', 'file2.env')
58
+ ```
59
+
60
+ ### Autorestore in tests
61
+
62
+ Since 3.0, dotenv in a Rails app will automatically restore `ENV` after each test. This means you can modify `ENV` in your tests without fear of leaking state to other tests. It works with both `ActiveSupport::TestCase` and `Rspec`.
63
+
64
+ To disable this behavior, set `config.dotenv.autorestore = false` in `config/application.rb` or `config/environments/test.rb`. It is disabled by default if your app uses [climate_control](https://github.com/thoughtbot/climate_control) or [ice_age](https://github.com/dpep/ice_age_rb).
65
+
66
+ To use this behavior outside of a Rails app, just `require "dotenv/autorestore"` in your test suite.
67
+
68
+ See [`Dotenv.save`](https://rubydoc.info/github/bkeepers/dotenv/main/Dotenv:save), [Dotenv.restore](https://rubydoc.info/github/bkeepers/dotenv/main/Dotenv:restore), and [`Dotenv.modify(hash) { ... }`](https://rubydoc.info/github/bkeepers/dotenv/main/Dotenv:modify) for manual usage.
69
+
70
+ ### Rake
71
+
72
+ To ensure `.env` is loaded in rake, load the tasks:
73
+
74
+ ```ruby
75
+ require 'dotenv/tasks'
76
+
77
+ task mytask: :dotenv do
78
+ # things that require .env
79
+ end
80
+ ```
81
+
82
+ ### CLI
83
+
84
+ You can use the `dotenv` executable load `.env` before launching your application:
85
+
86
+ ```console
87
+ $ dotenv ./script.rb
88
+ ```
89
+
90
+ The `dotenv` executable also accepts the flag `-f`. Its value should be a comma-separated list of configuration files, in the order of the most important to the least important. All of the files must exist. There _must_ be a space between the flag and its value.
91
+
92
+ ```console
93
+ $ dotenv -f ".env.local,.env" ./script.rb
94
+ ```
95
+
96
+ The `dotenv` executable can optionally ignore missing files with the `-i` or `--ignore` flag. For example, if the `.env.local` file does not exist, the following will ignore the missing file and only load the `.env` file.
97
+
98
+ ```console
99
+ $ dotenv -i -f ".env.local,.env" ./script.rb
100
+ ```
101
+
102
+ ### Load Order
103
+
104
+ If you use gems that require environment variables to be set before they are loaded, then list `dotenv` in the `Gemfile` before those other gems and require `dotenv/load`.
105
+
106
+ ```ruby
107
+ gem 'dotenv', require: 'dotenv/load'
108
+ gem 'gem-that-requires-env-variables'
109
+ ```
110
+
111
+ ### Customizing Rails
112
+
113
+ Dotenv will load the following files depending on `RAILS_ENV`, with the first file having the highest precedence, and `.env` having the lowest precedence:
114
+
115
+ <table>
116
+ <thead>
117
+ <tr>
118
+ <th>Priority</th>
119
+ <th colspan="3">Environment</th>
120
+ <th><code>.gitignore</code>it?</th>
121
+ <th>Notes</th>
122
+ </tr>
123
+ <tr>
124
+ <th></th>
125
+ <th>development</th>
126
+ <th>test</th>
127
+ <th>production</th>
128
+ <th></th>
129
+ <th></th>
130
+ </tr>
131
+ </thead>
132
+ <tr>
133
+ <td>highest</td>
134
+ <td><code>.env.development.local</code></td>
135
+ <td><code>.env.test.local</code></td>
136
+ <td><code>.env.production.local</code></td>
137
+ <td>Yes</td>
138
+ <td>Environment-specific local overrides</td>
139
+ </tr>
140
+ <tr>
141
+ <td>2nd</td>
142
+ <td><code>.env.local</code></td>
143
+ <td><strong>N/A</strong></td>
144
+ <td><code>.env.local</code></td>
145
+ <td>Yes</td>
146
+ <td>Local overrides</td>
147
+ </tr>
148
+ <tr>
149
+ <td>3rd</td>
150
+ <td><code>.env.development</code></td>
151
+ <td><code>.env.test</code></td>
152
+ <td><code>.env.production</code></td>
153
+ <td>No</td>
154
+ <td>Shared environment-specific variables</td>
155
+ </tr>
156
+ <tr>
157
+ <td>last</td>
158
+ <td><code>.env</code></td>
159
+ <td><code>.env</code></td>
160
+ <td><code>.env</code></td>
161
+ <td><a href="#should-i-commit-my-env-file">Maybe</a></td>
162
+ <td>Shared for all environments</td>
163
+ </tr>
164
+ </table>
165
+
166
+
167
+ These files are loaded during the `before_configuration` callback, which is fired when the `Application` constant is defined in `config/application.rb` with `class Application < Rails::Application`. If you need it to be initialized sooner, or need to customize the loading process, you can do so at the top of `application.rb`
168
+
169
+ ```ruby
170
+ # config/application.rb
171
+ Bundler.require(*Rails.groups)
172
+
173
+ # Load .env.local in test
174
+ Dotenv::Rails.files.unshift(".env.local") if ENV["RAILS_ENV"] == "test"
175
+
176
+ module YourApp
177
+ class Application < Rails::Application
178
+ # ...
179
+ end
180
+ end
181
+ ```
182
+
183
+ Available options:
184
+
185
+ * `Dotenv::Rails.files` - list of files to be loaded, in order of precedence.
186
+ * `Dotenv::Rails.overwrite` - Overwrite existing `ENV` variables with contents of `.env*` files
187
+ * `Dotenv::Rails.logger` - The logger to use for dotenv's logging. Defaults to `Rails.logger`
188
+ * `Dotenv::Rails.autorestore` - Enable or disable [autorestore](#autorestore-in-tests)
189
+
190
+ ### Multi-line values
191
+
192
+ Multi-line values with line breaks must be surrounded with double quotes.
193
+
194
+ ```shell
195
+ PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----
196
+ ...
197
+ HkVN9...
198
+ ...
199
+ -----END DSA PRIVATE KEY-----"
200
+ ```
201
+
202
+ Prior to 3.0, dotenv would replace `\n` in quoted strings with a newline, but that behavior is deprecated. To use the old behavior, set `DOTENV_LINEBREAK_MODE=legacy` before any variables that include `\n`:
203
+
204
+ ```shell
205
+ DOTENV_LINEBREAK_MODE=legacy
206
+ PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\nHkVN9...\n-----END DSA PRIVATE KEY-----\n"
207
+ ```
208
+
209
+ ### Command Substitution
210
+
211
+ You need to add the output of a command in one of your variables? Simply add it with `$(your_command)`:
212
+
213
+ ```shell
214
+ DATABASE_URL="postgres://$(whoami)@localhost/my_database"
215
+ ```
216
+
217
+ ### Variable Substitution
218
+
219
+ You need to add the value of another variable in one of your variables? You can reference the variable with `${VAR}` or often just `$VAR` in unquoted or double-quoted values.
220
+
221
+ ```shell
222
+ DATABASE_URL="postgres://${USER}@localhost/my_database"
223
+ ```
224
+
225
+ If a value contains a `$` and it is not intended to be a variable, wrap it in single quotes.
226
+
227
+ ```shell
228
+ PASSWORD='pas$word'
229
+ ```
230
+
231
+ ### Comments
232
+
233
+ Comments may be added to your file as such:
234
+
235
+ ```shell
236
+ # This is a comment
237
+ SECRET_KEY=YOURSECRETKEYGOESHERE # comment
238
+ SECRET_HASH="something-with-a-#-hash"
239
+ ```
240
+
241
+ ### Exports
242
+
243
+ For compatability, you may also add `export` in front of each line so you can `source` the file in bash:
244
+
245
+ ```shell
246
+ export S3_BUCKET=YOURS3BUCKET
247
+ export SECRET_KEY=YOURSECRETKEYGOESHERE
248
+ ```
249
+
250
+ ### Required Keys
251
+
252
+ If a particular configuration value is required but not set, it's appropriate to raise an error.
253
+
254
+ To require configuration keys:
255
+
256
+ ```ruby
257
+ # config/initializers/dotenv.rb
258
+
259
+ Dotenv.require_keys("SERVICE_APP_ID", "SERVICE_KEY", "SERVICE_SECRET")
260
+ ```
261
+
262
+ If any of the configuration keys above are not set, your application will raise an error during initialization. This method is preferred because it prevents runtime errors in a production application due to improper configuration.
263
+
264
+ ### Parsing
265
+
266
+ To parse a list of env files for programmatic inspection without modifying the ENV:
267
+
268
+ ```ruby
269
+ Dotenv.parse(".env.local", ".env")
270
+ # => {'S3_BUCKET' => 'YOURS3BUCKET', 'SECRET_KEY' => 'YOURSECRETKEYGOESHERE', ...}
271
+ ```
272
+
273
+ This method returns a hash of the ENV var name/value pairs.
274
+
275
+ ### Templates
276
+
277
+ You can use the `-t` or `--template` flag on the dotenv cli to create a template of your `.env` file.
278
+
279
+ ```console
280
+ $ dotenv -t .env
281
+ ```
282
+ A template will be created in your working directory named `{FILENAME}.template`. So in the above example, it would create a `.env.template` file.
283
+
284
+ The template will contain all the environment variables in your `.env` file but with their values set to the variable names.
285
+
286
+ ```shell
287
+ # .env
288
+ S3_BUCKET=YOURS3BUCKET
289
+ SECRET_KEY=YOURSECRETKEYGOESHERE
290
+ ```
291
+
292
+ Would become
293
+
294
+ ```shell
295
+ # .env.template
296
+ S3_BUCKET=S3_BUCKET
297
+ SECRET_KEY=SECRET_KEY
298
+ ```
299
+
300
+ ## Frequently Answered Questions
301
+
302
+ ### Can I use dotenv in production?
303
+
304
+ dotenv was originally created to load configuration variables into `ENV` in *development*. There are typically better ways to manage configuration in production environments - such as `/etc/environment` managed by [Puppet](https://github.com/puppetlabs/puppet) or [Chef](https://github.com/chef/chef), `heroku config`, etc.
305
+
306
+ However, some find dotenv to be a convenient way to configure Rails applications in staging and production environments, and you can do that by defining environment-specific files like `.env.production` or `.env.test`.
307
+
308
+ If you use this gem to handle env vars for multiple Rails environments (development, test, production, etc.), please note that env vars that are general to all environments should be stored in `.env`. Then, environment specific env vars should be stored in `.env.<that environment's name>`.
309
+
310
+ ### Should I commit my .env file?
311
+
312
+ Credentials should only be accessible on the machines that need access to them. Never commit sensitive information to a repository that is not needed by every development machine and server.
313
+
314
+ Personally, I prefer to commit the `.env` file with development-only settings. This makes it easy for other developers to get started on the project without compromising credentials for other environments. If you follow this advice, make sure that all the credentials for your development environment are different from your other deployments and that the development credentials do not have access to any confidential data.
315
+
316
+ ### Why is it not overwriting existing `ENV` variables?
317
+
318
+ By default, it **won't** overwrite existing environment variables as dotenv assumes the deployment environment has more knowledge about configuration than the application does. To overwrite existing environment variables you can use `Dotenv.load files, overwrite: true`.
319
+
320
+ To warn when a value was not overwritten (e.g. to make users aware of this gotcha),
321
+ use `Dotenv.load files, overwrite: :warn`.
322
+
323
+ You can also use the `-o` or `--overwrite` flag on the dotenv cli to overwrite existing `ENV` variables.
324
+
325
+ ```console
326
+ $ dotenv -o -f ".env.local,.env"
327
+ ```
328
+
329
+ ## Contributing
330
+
331
+ If you want a better idea of how dotenv works, check out the [Ruby Rogues Code Reading of dotenv](https://www.youtube.com/watch?v=lKmY_0uY86s).
332
+
333
+ 1. Fork it
334
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
335
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
336
+ 4. Push to the branch (`git push origin my-new-feature`)
337
+ 5. Create new Pull Request
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "dotenv/cli"
4
+ Dotenv::CLI.new(ARGV).run
@@ -0,0 +1,29 @@
1
+ # Automatically restore `ENV` to its original state after
2
+
3
+ if defined?(RSpec.configure)
4
+ RSpec.configure do |config|
5
+ # Save ENV before the suite starts
6
+ config.before(:suite) { Dotenv.save }
7
+
8
+ # Restore ENV after each example
9
+ config.after { Dotenv.restore }
10
+ end
11
+ end
12
+
13
+ if defined?(ActiveSupport)
14
+ ActiveSupport.on_load(:active_support_test_case) do
15
+ ActiveSupport::TestCase.class_eval do
16
+ # Save ENV before each test
17
+ setup { Dotenv.save }
18
+
19
+ # Restore ENV after each test
20
+ teardown do
21
+ Dotenv.restore
22
+ rescue ThreadError => e
23
+ # Restore will fail if running tests in parallel.
24
+ warn e.message
25
+ warn "Set `config.dotenv.autorestore = false` in `config/initializers/test.rb`" if defined?(Dotenv::Rails)
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,59 @@
1
+ require "dotenv"
2
+ require "dotenv/version"
3
+ require "dotenv/template"
4
+ require "optparse"
5
+
6
+ module Dotenv
7
+ # The `dotenv` command line interface. Run `$ dotenv --help` to see usage.
8
+ class CLI < OptionParser
9
+ attr_reader :argv, :filenames, :overwrite
10
+
11
+ def initialize(argv = [])
12
+ @argv = argv.dup
13
+ @filenames = []
14
+ @ignore = false
15
+ @overwrite = false
16
+
17
+ super("Usage: dotenv [options]")
18
+ separator ""
19
+
20
+ on("-f FILES", Array, "List of env files to parse") do |list|
21
+ @filenames = list
22
+ end
23
+
24
+ on("-i", "--ignore", "ignore missing env files") do
25
+ @ignore = true
26
+ end
27
+
28
+ on("-o", "--overwrite", "overwrite existing ENV variables") do
29
+ @overwrite = true
30
+ end
31
+ on("--overload") { @overwrite = true }
32
+
33
+ on("-h", "--help", "Display help") do
34
+ puts self
35
+ exit
36
+ end
37
+
38
+ on("-v", "--version", "Show version") do
39
+ puts "dotenv #{Dotenv::VERSION}"
40
+ exit
41
+ end
42
+
43
+ on("-t", "--template=FILE", "Create a template env file") do |file|
44
+ template = Dotenv::EnvTemplate.new(file)
45
+ template.create_template
46
+ end
47
+
48
+ order!(@argv)
49
+ end
50
+
51
+ def run
52
+ Dotenv.load(*@filenames, overwrite: @overwrite, ignore: @ignore)
53
+ rescue Errno::ENOENT => e
54
+ abort e.message
55
+ else
56
+ exec(*@argv) unless @argv.empty?
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,59 @@
1
+ module Dotenv
2
+ # A diff between multiple states of ENV.
3
+ class Diff
4
+ # The initial state
5
+ attr_reader :a
6
+
7
+ # The final or current state
8
+ attr_reader :b
9
+
10
+ # Create a new diff. If given a block, the state of ENV after the block will be preserved as
11
+ # the final state for comparison. Otherwise, the current ENV will be the final state.
12
+ #
13
+ # @param a [Hash] the initial state, defaults to a snapshot of current ENV
14
+ # @param b [Hash] the final state, defaults to the current ENV
15
+ # @yield [diff] a block to execute before recording the final state
16
+ def initialize(a: snapshot, b: ENV, &block)
17
+ @a, @b = a, b
18
+ block&.call self
19
+ ensure
20
+ @b = snapshot if block
21
+ end
22
+
23
+ # Return a Hash of keys added with their new values
24
+ def added
25
+ b.slice(*(b.keys - a.keys))
26
+ end
27
+
28
+ # Returns a Hash of keys removed with their previous values
29
+ def removed
30
+ a.slice(*(a.keys - b.keys))
31
+ end
32
+
33
+ # Returns of Hash of keys changed with an array of their previous and new values
34
+ def changed
35
+ (b.slice(*a.keys).to_a - a.to_a).map do |(k, v)|
36
+ [k, [a[k], v]]
37
+ end.to_h
38
+ end
39
+
40
+ # Returns a Hash of all added, changed, and removed keys and their new values
41
+ def env
42
+ b.slice(*(added.keys + changed.keys)).merge(removed.transform_values { |v| nil })
43
+ end
44
+
45
+ # Returns true if any keys were added, removed, or changed
46
+ def any?
47
+ [added, removed, changed].any?(&:any?)
48
+ end
49
+
50
+ private
51
+
52
+ def snapshot
53
+ # `dup` should not be required here, but some people use `stub_const` to replace ENV with
54
+ # a `Hash`. This ensures that we get a frozen copy of that instead of freezing the original.
55
+ # https://github.com/bkeepers/dotenv/issues/482
56
+ ENV.to_h.dup.freeze
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,25 @@
1
+ module Dotenv
2
+ # A `.env` file that will be read and parsed into a Hash
3
+ class Environment < Hash
4
+ attr_reader :filename, :overwrite
5
+
6
+ # Create a new Environment
7
+ #
8
+ # @param filename [String] the path to the file to read
9
+ # @param overwrite [Boolean] whether the parser should assume existing values will be overwritten
10
+ def initialize(filename, overwrite: false)
11
+ super()
12
+ @filename = filename
13
+ @overwrite = overwrite
14
+ load
15
+ end
16
+
17
+ def load
18
+ update Parser.call(read, overwrite: overwrite)
19
+ end
20
+
21
+ def read
22
+ File.open(@filename, "rb:bom|utf-8", &:read)
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,3 @@
1
+ require "dotenv"
2
+
3
+ defined?(Dotenv::Rails) ? Dotenv::Rails.load : Dotenv.load
@@ -0,0 +1,61 @@
1
+ require "active_support/log_subscriber"
2
+
3
+ module Dotenv
4
+ # Logs instrumented events
5
+ #
6
+ # Usage:
7
+ # require "active_support/notifications"
8
+ # require "dotenv/log_subscriber"
9
+ # Dotenv.instrumenter = ActiveSupport::Notifications
10
+ #
11
+ class LogSubscriber < ActiveSupport::LogSubscriber
12
+ attach_to :dotenv
13
+
14
+ def logger
15
+ Dotenv::Rails.logger
16
+ end
17
+
18
+ def load(event)
19
+ env = event.payload[:env]
20
+
21
+ info "Loaded #{color_filename(env.filename)}"
22
+ end
23
+
24
+ def update(event)
25
+ diff = event.payload[:diff]
26
+ changed = diff.env.keys.map { |key| color_var(key) }
27
+ debug "Set #{changed.join(", ")}" if diff.any?
28
+ end
29
+
30
+ def save(event)
31
+ info "Saved a snapshot of #{color_env_constant}"
32
+ end
33
+
34
+ def restore(event)
35
+ diff = event.payload[:diff]
36
+
37
+ removed = diff.removed.keys.map { |key| color(key, :RED) }
38
+ restored = (diff.changed.keys + diff.added.keys).map { |key| color_var(key) }
39
+
40
+ if removed.any? || restored.any?
41
+ info "Restored snapshot of #{color_env_constant}"
42
+ debug "Unset #{removed.join(", ")}" if removed.any?
43
+ debug "Restored #{restored.join(", ")}" if restored.any?
44
+ end
45
+ end
46
+
47
+ private
48
+
49
+ def color_filename(filename)
50
+ color(Pathname.new(filename).relative_path_from(Dotenv::Rails.root.to_s).to_s, :YELLOW)
51
+ end
52
+
53
+ def color_var(name)
54
+ color(name, :CYAN)
55
+ end
56
+
57
+ def color_env_constant
58
+ color("ENV", :GREEN)
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,10 @@
1
+ module Dotenv
2
+ class Error < StandardError; end
3
+
4
+ class MissingKeys < Error # :nodoc:
5
+ def initialize(keys)
6
+ key_word = "key#{"s" if keys.size > 1}"
7
+ super("Missing required configuration #{key_word}: #{keys.inspect}")
8
+ end
9
+ end
10
+ end