habitat 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +15 -1
- data/VERSION +1 -1
- data/habitat.gemspec +2 -2
- data/lib/habitat/railtie.rb +9 -2
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -1,7 +1,21 @@
|
|
1
|
-
=
|
1
|
+
= Habitat
|
2
2
|
|
3
3
|
Rails 3 plugin that automatically loads heroku config variables into your development environment
|
4
4
|
|
5
|
+
== Usage
|
6
|
+
|
7
|
+
In your Gemfile:
|
8
|
+
|
9
|
+
group :development do
|
10
|
+
gem 'habitat'
|
11
|
+
end
|
12
|
+
|
13
|
+
To override values from heroku config create a habitat.yml file in config
|
14
|
+
|
15
|
+
Sample config/habitat.yml:
|
16
|
+
|
17
|
+
TWITTER_KEY: differentkeythanproduction
|
18
|
+
|
5
19
|
== Note on Patches/Pull Requests
|
6
20
|
|
7
21
|
* Fork the project.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/habitat.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{habitat}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.2.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ed Schmalzle"]
|
12
|
-
s.date = %q{2010-08-
|
12
|
+
s.date = %q{2010-08-05}
|
13
13
|
s.description = %q{Automatically loads heroku config variables into your environment for development}
|
14
14
|
s.email = %q{Jonas714@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/habitat/railtie.rb
CHANGED
@@ -6,8 +6,15 @@ module Habitat
|
|
6
6
|
initializer "Habitat.configure_heroku_environment_variables" do
|
7
7
|
heroku_config = `heroku config --long`
|
8
8
|
heroku_config = heroku_config.split("\n").map{|string| string.split("=>").map(&:strip)}
|
9
|
-
heroku_config
|
10
|
-
|
9
|
+
heroku_config = heroku_config.inject({}){|memo, entry| memo[entry.first] = entry.last;memo;}
|
10
|
+
|
11
|
+
override_path = Rails.root.join('config','habitat.yml')
|
12
|
+
override_config = YAML.load_file(override_path) if File.exists?(override_path)
|
13
|
+
|
14
|
+
heroku_config.merge!(override_config)
|
15
|
+
|
16
|
+
heroku_config.each_pair do |key, value|
|
17
|
+
ENV[key] = value unless key == "RACK_ENV"
|
11
18
|
end
|
12
19
|
end
|
13
20
|
end
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
7
|
+
- 2
|
8
8
|
- 0
|
9
|
-
version: 0.
|
9
|
+
version: 0.2.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Ed Schmalzle
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-08-
|
17
|
+
date: 2010-08-05 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|