ez-credentials 0.1.01 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '029ff47272055e48fb8f23d891a8e55cf495b2bd1075510fb77dd9184828d243'
4
- data.tar.gz: 262685a11c8ee06cc195624b1b7a3168d56d20b839c5e3b09fc4704f9ec522c2
3
+ metadata.gz: efe3550c56924e93ff82abcdac3314ae8297aa10d4028f9ced18fa3598f4fff9
4
+ data.tar.gz: bef69d939b782aa8011d9930bbeff1b2cae2ae3d5c2d8d086d2b335ffb162e2f
5
5
  SHA512:
6
- metadata.gz: 64595619b3e9b8405cdcc355c619fa02d1c73daaa8e60136f8b6e37e26018d93cf18b811e9a4b168c94476a84eb75e0e7da78c0af935d7728d5fb1c27e31f69e
7
- data.tar.gz: fa0c4936def6c6ddd3e2a80b2f063ac64a04d7a5f2b03dc2292e226ee191d64fa73d1a0199360173f36b49d9a478a520de4aee3aa1abb902dabdc1b369edf776
6
+ metadata.gz: 84df42e272f9468c62bdf4adfcd2047d9a9a90a071e34eb64d1d039d9bd08c68f38b29f2fbe7d88a081f8948306f50e3e3d66c9231ec65d91ea073a0a945eb41
7
+ data.tar.gz: 6c63b54e92cb301cddca23ab055b0960d80ebeee53407f50f254ab9b863c9482b2ba4cfc98c5223eacdbee0e6a6e41d5fd23046ccc312545967c701e29cb6864
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ez-credentials (0.1.01)
4
+ ez-credentials (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,15 +1,12 @@
1
1
  # Credentials
2
-
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/credentials`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
2
+ A simple environment-aware wrapper around Rails encrypted credentials.
6
3
 
7
4
  ## Installation
8
5
 
9
6
  Add this line to your application's Gemfile:
10
7
 
11
8
  ```ruby
12
- gem 'credentials'
9
+ gem 'ez-credentials', require 'credentials'
13
10
  ```
14
11
 
15
12
  And then execute:
@@ -18,7 +15,7 @@ And then execute:
18
15
 
19
16
  Or install it yourself as:
20
17
 
21
- $ gem install credentials
18
+ $ gem install ez-credentials
22
19
 
23
20
  ## Usage
24
21
  This gem assumes you are in a rails application and are using one encrypted credential file with environmnet namespaces, like the example below:
@@ -38,10 +35,23 @@ production:
38
35
  bar: realsecret
39
36
  ```
40
37
 
41
- To access credentials in the project for the correct environment, use one of the methods below (the `Credentials` class already takes the environment into account):
42
- - `Credentials.get('foo.bar')`
43
- - `Credentials.get(:foo, :bar)`
44
- - `Credentials.get(:foo)[:bar]`
38
+ The `Credentials` class wraps `Rails.application.credentials` call with environment-aware easy accessors.
39
+ To access credentials in the project for the correct environment, use one of the methods below:
40
+ ```ruby
41
+ require 'credentials' # if not required in Gemfile
42
+
43
+ Credentials.all
44
+ # => {:foo => {:bar => 'baz'}}
45
+
46
+ Credentials.get(:foo) # also takes string 'foo'
47
+ # => {:bar=>"baz"}
48
+
49
+ Credentials.get('foo.bar')
50
+ # => "baz"
51
+
52
+ Credentials.get(:foo, :bar)
53
+ # => "baz"
54
+ ```
45
55
 
46
56
  ---
47
57
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Credentials
4
- VERSION = "0.1.01"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ez-credentials
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.01
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - jimjoyce