exportr 0.1.95 → 0.2.0
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.
- data/lib/exportr/railtie.rb +16 -0
- data/lib/exportr/version.rb +1 -1
- data/lib/exportr.rb +3 -1
- data/lib/generators/exportr/exportr_generator.rb +0 -10
- metadata +3 -2
@@ -0,0 +1,16 @@
|
|
1
|
+
require "exportr/config"
|
2
|
+
|
3
|
+
module Exportr
|
4
|
+
|
5
|
+
class Railtie < Rails::Railtie
|
6
|
+
|
7
|
+
initializer 'exportr.load_environment_variables' do |app|
|
8
|
+
if File.exists? "#{Rails.root}/#{Exportr::Config::CONFIG_FILE}"
|
9
|
+
config = YAML.load(File.open("#{Rails.root}/#{Exportr::Config::CONFIG_FILE}"))
|
10
|
+
config.each_pair { |key,value| ENV[key] = value } if config
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
data/lib/exportr/version.rb
CHANGED
data/lib/exportr.rb
CHANGED
@@ -4,16 +4,6 @@ class ExportrGenerator < Rails::Generators::Base
|
|
4
4
|
|
5
5
|
def generate_initializer
|
6
6
|
copy_file 'exportr.yml', 'config/exportr.yml'
|
7
|
-
# copy_file 'exportr.rb', 'config/initializers/exportr.rb'
|
8
|
-
application '
|
9
|
-
# Loads export.yml and sets key=value to the local environment
|
10
|
-
config.before_initialize do
|
11
|
-
require "exportr/config"
|
12
|
-
if File.exists? "#{Rails.root}/#{Exportr::Config::CONFIG_FILE}"
|
13
|
-
config = YAML.load(File.open("#{Rails.root}/#{Exportr::Config::CONFIG_FILE}"))
|
14
|
-
config.each_pair { |key,value| ENV[key] = value } if config
|
15
|
-
end
|
16
|
-
end'
|
17
7
|
|
18
8
|
# Decrecation warning
|
19
9
|
if File.exists?("#{Rails.root}/config/initializers/exportr.rb")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exportr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-
|
12
|
+
date: 2012-04-10 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Helps manage rails application specific environment variables for multiple
|
15
15
|
apps in development.
|
@@ -31,6 +31,7 @@ files:
|
|
31
31
|
- lib/exportr/command.rb
|
32
32
|
- lib/exportr/config.rb
|
33
33
|
- lib/exportr/helpers.rb
|
34
|
+
- lib/exportr/railtie.rb
|
34
35
|
- lib/exportr/version.rb
|
35
36
|
- lib/generators/exportr/exportr_generator.rb
|
36
37
|
- lib/generators/exportr/templates/exportr.yml
|