nvar 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +10 -2
- data/lib/nvar/environment_variable.rb +1 -1
- data/lib/nvar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5623fcf10c45adddb15aee26416afa566eeb57972db115b930913fb874b0e7d9
|
4
|
+
data.tar.gz: 2b5d10f4fc45886002a0eccd0dde8d1709cf7e4d38b8e4e8e672509cef318eb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60ca286c6d6741804fcb8f31652db93a728764e9a03af2119075c03d804640bcb2802a428ae3042f0d0658453e79d1f629dce7e0b0c1c6a198a602b8ab48a732
|
7
|
+
data.tar.gz: dfecc072b41861cb91ac42471460277deaefd5b12d468b0456038cea174247d61c81d3c309ba6ba98e4984e6abb008267f0b652b574722b801ea4e427e89e94c
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -60,9 +60,13 @@ Your tests shouldn't be reliant on your environment, so generally, you want to h
|
|
60
60
|
Now that you've been through and configured the environment variables that are necessary for your app, `Nvar` will write your environment variables to top-level constants, cast to any types you've specified, and raise an informative error if any are absent.
|
61
61
|
### .env files
|
62
62
|
|
63
|
-
`Nvar` works well with gems like `dotenv` that source their config from a `.env` file. If an environment variable is unset when the app initializes and isn't present in `.env`, it will be added to that file. If a default value is specified in your `Nvar` config, that will be passed to `.env` too.
|
63
|
+
`Nvar` works well with gems like `dotenv-rails` that source their config from a `.env` file. If an environment variable is unset when the app initializes and isn't present in `.env`, it will be added to that file. If a default value is specified in your `Nvar` config, that will be passed to `.env` too.
|
64
64
|
|
65
|
-
When using gems such as `dotenv`, make sure you load those first so that the environment is ready for `Nvar` to check.
|
65
|
+
When using gems such as `dotenv-rails`, make sure you load those first so that the environment is ready for `Nvar` to check.
|
66
|
+
|
67
|
+
### `rake nvar:verify_environment_file`
|
68
|
+
|
69
|
+
This Rake task provided by `Nvar` is super helpful for your project's developer experience. Based on what's currently in the environment, it'll show any environment variables that are missing and add declarations for them to `.env`. And if you've set a `default_value` in your config, that'll get written too.
|
66
70
|
|
67
71
|
## Development
|
68
72
|
|
@@ -82,3 +86,7 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
82
86
|
## Code of Conduct
|
83
87
|
|
84
88
|
Everyone interacting in the Nvar project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/boardfish/nvar/blob/master/CODE_OF_CONDUCT.md).
|
89
|
+
|
90
|
+
## This gem's name
|
91
|
+
|
92
|
+
This gem isn't associated with [sneakertack/nvar](https://github.com/sneakertack/nvar).
|
@@ -16,7 +16,7 @@ module Nvar
|
|
16
16
|
@type = type
|
17
17
|
@required = args[:required].nil? ? true : args[:required]
|
18
18
|
@filter_from_requests = filter_from_requests.yield_self { |f| [true, false].include?(f) ? f : f&.to_sym }
|
19
|
-
@value = fetch_value(args.slice(:passthrough, :default_value))
|
19
|
+
@value = fetch_value(**args.slice(:passthrough, :default_value))
|
20
20
|
@defined = true
|
21
21
|
rescue KeyError
|
22
22
|
@value = args[:default_value]
|
data/lib/nvar/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nvar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Fish
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|