confidential 0.0.5 → 0.0.6
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 +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +44 -0
- data/lib/confidential/railtie.rb +3 -3
- data/lib/confidential/version.rb +1 -1
- data/lib/confidential.rb +0 -1
- data/test/confidential_test.rb +1 -1
- data/test/dummy/log/test.log +20 -0
- metadata +6 -6
- data/README.rdoc +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f00bc86ba03b4bcc285a3a18b16ab784e546e46e
|
4
|
+
data.tar.gz: 2e68d7e39eff0c3e38c62cf04262e3333817f9c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f7ddbc46a45e946299d1cd331073e683a2a0df22ff7aa2b8a430b8758ef30b1593fd9c31aad234a4583f1fd78d0849f37952ee99fa76ce4daab6f36669dc2a0
|
7
|
+
data.tar.gz: 1c7cdf12f3d7b09d694c1c63ec5f653572df81fd91709e99ba9f9cd9506003ea7eea4d45c6a14550223f342ebb9520d684b0064e78a5bcd88c01c69fff4e2024
|
data/MIT-LICENSE
CHANGED
data/README.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
[](http://badge.fury.io/rb/confidential) [](https://codeclimate.com/github/museways/confidential) [](https://travis-ci.org/museways/confidential) [](https://gemnasium.com/museways/confidential)
|
2
|
+
|
3
|
+
# Confidential
|
4
|
+
|
5
|
+
Loads your confidential configuration into envs in rails.
|
6
|
+
|
7
|
+
## Install
|
8
|
+
|
9
|
+
Put this line in your Gemfile:
|
10
|
+
```ruby
|
11
|
+
gem 'confidential'
|
12
|
+
```
|
13
|
+
|
14
|
+
Then bundle:
|
15
|
+
```
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
## Configuration
|
20
|
+
|
21
|
+
Put your confidential information in config/confidential.yml:
|
22
|
+
```yaml
|
23
|
+
DB_USER: user
|
24
|
+
DB_PASS: pass
|
25
|
+
```
|
26
|
+
|
27
|
+
NOTE: Probably you want to ignore config/confidential.yml in your repo.
|
28
|
+
|
29
|
+
## Usage
|
30
|
+
|
31
|
+
All the keys will be loaded into envs, you may want to use those for your database.yml:
|
32
|
+
```erb
|
33
|
+
production:
|
34
|
+
username: <%= ENV['DB_USER'] %>
|
35
|
+
password: <%= ENV['DB_PASS'] %>
|
36
|
+
```
|
37
|
+
|
38
|
+
## Credits
|
39
|
+
|
40
|
+
This gem is maintained and funded by [museways](http://museways.com).
|
41
|
+
|
42
|
+
## License
|
43
|
+
|
44
|
+
It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
|
data/lib/confidential/railtie.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
module Confidential
|
2
2
|
class Railtie < Rails::Railtie
|
3
|
-
|
3
|
+
|
4
4
|
config.before_configuration do
|
5
|
-
confidential_file = Rails.root.join('config', 'confidential.yml')
|
6
|
-
if File.exist? confidential_file and envs = YAML.load(File.read(confidential_file))
|
5
|
+
confidential_file = Rails.root.join('config', 'confidential.yml')
|
6
|
+
if File.exist? confidential_file and envs = YAML.load(File.read(confidential_file))
|
7
7
|
envs.each { |key, value| ENV[key] = value }
|
8
8
|
end
|
9
9
|
end
|
data/lib/confidential/version.rb
CHANGED
data/lib/confidential.rb
CHANGED
data/test/confidential_test.rb
CHANGED
data/test/dummy/log/test.log
CHANGED
@@ -3,3 +3,23 @@
|
|
3
3
|
ConfidentialTest: test_should_load_confidential_values
|
4
4
|
------------------------------------------------------
|
5
5
|
[1m[35m (0.0ms)[0m rollback transaction
|
6
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
7
|
+
----------------------------------
|
8
|
+
ConfidentialTest: test_envs_values
|
9
|
+
----------------------------------
|
10
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
11
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
12
|
+
----------------------------------
|
13
|
+
ConfidentialTest: test_envs_values
|
14
|
+
----------------------------------
|
15
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
16
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
17
|
+
----------------------------------
|
18
|
+
ConfidentialTest: test_envs_values
|
19
|
+
----------------------------------
|
20
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
21
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
22
|
+
----------------------------------
|
23
|
+
ConfidentialTest: test_envs_values
|
24
|
+
----------------------------------
|
25
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: confidential
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Museways
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -44,7 +44,7 @@ dependencies:
|
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '1.3'
|
47
|
-
description: Loads your confidential configuration into envs.
|
47
|
+
description: Loads your confidential configuration into envs in rails.
|
48
48
|
email:
|
49
49
|
- hello@museways.com
|
50
50
|
executables: []
|
@@ -52,7 +52,7 @@ extensions: []
|
|
52
52
|
extra_rdoc_files: []
|
53
53
|
files:
|
54
54
|
- MIT-LICENSE
|
55
|
-
- README.
|
55
|
+
- README.md
|
56
56
|
- Rakefile
|
57
57
|
- lib/confidential.rb
|
58
58
|
- lib/confidential/railtie.rb
|
@@ -112,10 +112,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
112
|
version: '0'
|
113
113
|
requirements: []
|
114
114
|
rubyforge_project:
|
115
|
-
rubygems_version: 2.2.
|
115
|
+
rubygems_version: 2.2.0
|
116
116
|
signing_key:
|
117
117
|
specification_version: 4
|
118
|
-
summary: Confidential
|
118
|
+
summary: Confidential envs for rails.
|
119
119
|
test_files:
|
120
120
|
- test/confidential_test.rb
|
121
121
|
- test/dummy/app/assets/javascripts/application.js
|
data/README.rdoc
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
{<img src="https://badge.fury.io/rb/confidential.png" alt="Gem Version" />}[http://badge.fury.io/rb/confidential] {<img src="https://codeclimate.com/github/museways/confidential.png" />}[https://codeclimate.com/github/museways/confidential] {<img src="https://travis-ci.org/museways/confidential.png?branch=master" alt="Build Status" />}[https://travis-ci.org/museways/confidential] {<img src="https://gemnasium.com/museways/confidential.png" alt="Dependency Status" />}[https://gemnasium.com/museways/confidential]
|
2
|
-
|
3
|
-
= Confidential
|
4
|
-
|
5
|
-
Loads your confidential configuration into envs.
|
6
|
-
|
7
|
-
= Install
|
8
|
-
|
9
|
-
Put this line in your Gemfile:
|
10
|
-
gem 'confidential'
|
11
|
-
|
12
|
-
Then bundle:
|
13
|
-
$ bundle
|
14
|
-
|
15
|
-
= Usage
|
16
|
-
|
17
|
-
Just put your confidential information in config/confidential.yml:
|
18
|
-
DB_USER: user
|
19
|
-
DB_PASS: pass
|
20
|
-
|
21
|
-
(Probably you want to ignore config/confidential.yml in your repo)
|