fastenv 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -0
- data/README.md +56 -5
- data/fastenv.gemspec +1 -1
- data/lib/fastenv/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89d95332b8d91bbba1eb1523620932eb276e641f
|
4
|
+
data.tar.gz: 8517cf01810d392a8384754023b3bd3de5c330ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1208a38f61a7a81bfef27150593da1a5f31fb2aa8a8845aa585273c1df711444550e9016a04297c96cc047a7ed14df11822c7c922edb225a50c5902a40c772e
|
7
|
+
data.tar.gz: 97c0d65a617a616389ceaaed40732d856534cc1965911f69ec92c2c4042fd0bfd2d2156e00b1048bcf00087f6593ed2106bfb1c245927f1ead1485228233eb59
|
data/LICENSE.txt
CHANGED
@@ -20,3 +20,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
20
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
21
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
22
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
|
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# Fastenv
|
2
2
|
|
3
|
-
|
3
|
+
Fast access to environment variables. Takes advantage of method_missing to
|
4
|
+
easily return values of environment variable.
|
5
|
+
|
6
|
+
Why? Because TYPING_IN_ALL_CAPS isn't fun or readable.
|
4
7
|
|
5
8
|
## Installation
|
6
9
|
|
@@ -12,20 +15,68 @@ gem 'fastenv'
|
|
12
15
|
|
13
16
|
And then execute:
|
14
17
|
|
15
|
-
|
18
|
+
```
|
19
|
+
$ bundle
|
20
|
+
```
|
16
21
|
|
17
22
|
Or install it yourself as:
|
18
23
|
|
19
|
-
|
24
|
+
```
|
25
|
+
$ gem install fastenv
|
26
|
+
```
|
20
27
|
|
21
28
|
## Usage
|
22
29
|
|
23
|
-
|
30
|
+
Say you have an environment variable
|
31
|
+
|
32
|
+
```bash
|
33
|
+
WORDPRESS_USERNAME="La-de-da-de-da"
|
34
|
+
```
|
35
|
+
|
36
|
+
You can access it from your Ruby code as simply as
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
require 'fastenv'
|
40
|
+
|
41
|
+
Fastenv.wordpress_username
|
42
|
+
```
|
43
|
+
|
44
|
+
If the environment variable doesn't exist, a `NameError` will be raise.
|
45
|
+
|
46
|
+
Fastenv is intended for querying credentials. Missing credentials is an
|
47
|
+
exceptional event.
|
48
|
+
|
49
|
+
---
|
50
|
+
|
51
|
+
## Goes Well With
|
52
|
+
|
53
|
+
Pair it with [dotenv](https://github.com/bkeepers/dotenv) to easily set _and_
|
54
|
+
retrieve your credentials from environment variables.
|
55
|
+
|
56
|
+
```bash
|
57
|
+
# .env
|
58
|
+
WORDPRESS_USERNAME="TweedleDee"
|
59
|
+
WORDPRESS_PASSWORD="password"
|
60
|
+
```
|
61
|
+
|
62
|
+
```ruby
|
63
|
+
# your_app.rb
|
64
|
+
require 'dotenv'
|
65
|
+
Dotenv.load
|
66
|
+
|
67
|
+
require 'fastenv'
|
68
|
+
|
69
|
+
credentials = {
|
70
|
+
username: Fastenv.wordpress_username,
|
71
|
+
password: Fastenv.wordpress_password }
|
72
|
+
# => {:username=>"TweedleDee", :password=>"password"}
|
73
|
+
```
|
24
74
|
|
25
75
|
## Contributing
|
26
76
|
|
27
|
-
1. Fork it ( https://github.com/
|
77
|
+
1. Fork it ( https://github.com/kyletolle/fastenv/fork )
|
28
78
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
79
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
80
|
4. Push to the branch (`git push origin my-new-feature`)
|
31
81
|
5. Create a new Pull Request
|
82
|
+
|
data/fastenv.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["kyle@nullsix.com"]
|
11
11
|
spec.summary = %q{Fast access to environment variables.}
|
12
12
|
spec.description = %q{Takes advantage of method_missing to give you fast access to environment variables.}
|
13
|
-
spec.homepage = "https://
|
13
|
+
spec.homepage = "https://github.com/kyletolle/fastenv"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
data/lib/fastenv/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastenv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Tolle
|
@@ -72,7 +72,7 @@ files:
|
|
72
72
|
- lib/fastenv/version.rb
|
73
73
|
- spec/fastenv_spec.rb
|
74
74
|
- spec/spec_helper.rb
|
75
|
-
homepage: https://
|
75
|
+
homepage: https://github.com/kyletolle/fastenv
|
76
76
|
licenses:
|
77
77
|
- MIT
|
78
78
|
metadata: {}
|