rails_simple_config 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,39 @@
|
|
1
|
+
##
|
2
|
+
# Configuration settings for use by the Rails application
|
3
|
+
# Made available via the SimpleConfig global class
|
4
|
+
# Use for settings such as mail server configurations, Amazon keys and secrets etc...
|
5
|
+
# You can use ERB too
|
6
|
+
#
|
7
|
+
# NNB: This file contains SECRETS! NOT FOR SOURCE CONTROL!!!
|
8
|
+
#
|
9
|
+
##
|
10
|
+
|
11
|
+
##
|
12
|
+
# Define shared settings
|
13
|
+
#
|
14
|
+
shared: &shared
|
15
|
+
|
16
|
+
## E.g. Amazon key and secret
|
17
|
+
# s3_key: XXXXXXXXXXXXXXXXXXXX
|
18
|
+
# s3_secret: 12345678901234567890ABCDEFGHIJKLMNOPQRST
|
19
|
+
example: sekret!
|
20
|
+
|
21
|
+
##
|
22
|
+
# Define settings per Rails environment,
|
23
|
+
# provide overrides to the shared settings as needed
|
24
|
+
#
|
25
|
+
development:
|
26
|
+
# inherit shared settings
|
27
|
+
<<: *shared
|
28
|
+
|
29
|
+
test:
|
30
|
+
# inherit shared settings
|
31
|
+
<<: *shared
|
32
|
+
|
33
|
+
|
34
|
+
production:
|
35
|
+
# inherit shared settings
|
36
|
+
<<: *shared
|
37
|
+
|
38
|
+
|
39
|
+
|
data/lib/rails_simple_config.rb
CHANGED
@@ -10,8 +10,8 @@ module SimpleConfig
|
|
10
10
|
|
11
11
|
def load!
|
12
12
|
puts "Loading configuration for '#{Rails.env}'."
|
13
|
-
|
14
|
-
|
13
|
+
load_file(Rails.root + 'secrets.yml')
|
14
|
+
load_file(Rails.root + 'config.yml')
|
15
15
|
end
|
16
16
|
|
17
17
|
def reload!
|
@@ -21,7 +21,7 @@ module SimpleConfig
|
|
21
21
|
|
22
22
|
private
|
23
23
|
|
24
|
-
def
|
24
|
+
def load_file(filename)
|
25
25
|
if File.exist?(filename)
|
26
26
|
configuration = YAML.load(ERB.new(File.read(filename)).result)[Rails.env]
|
27
27
|
configuration.each do |key, value|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_simple_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -28,6 +28,7 @@ files:
|
|
28
28
|
- lib/generators/rails_simple_config/install/USAGE
|
29
29
|
- lib/generators/rails_simple_config/install/install_generator.rb
|
30
30
|
- lib/generators/rails_simple_config/install/templates/config.yml
|
31
|
+
- lib/generators/rails_simple_config/install/templates/secrets.yml
|
31
32
|
- lib/rails_simple_config.rb
|
32
33
|
- lib/rails_simple_config/railtie.rb
|
33
34
|
- lib/rails_simple_config/version.rb
|