heroku_env 0.1.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/.gitignore +4 -0
- data/Gemfile +4 -0
- data/README.textile +23 -0
- data/Rakefile +2 -0
- data/heroku_env.gemspec +23 -0
- data/lib/heroku_env/version.rb +3 -0
- data/lib/heroku_env.rb +19 -0
- metadata +71 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.textile
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
h1. Heroku Env - Easy heroku environment variables in development mode
|
2
|
+
|
3
|
+
h2. About
|
4
|
+
|
5
|
+
Heroku Env fetchs all your heroku config variables and set up them in your
|
6
|
+
local development environment.
|
7
|
+
|
8
|
+
h2. Usage
|
9
|
+
|
10
|
+
Add the the gem to your <code>Gemfile</code>
|
11
|
+
|
12
|
+
<code>gem "heroku_env"</code>
|
13
|
+
|
14
|
+
Configure <code>config/heroku_env.yml</code> optionaly to customize the variables
|
15
|
+
without changing herokus or your variables
|
16
|
+
|
17
|
+
<pre><code>development:
|
18
|
+
GOOGLE_ANALYTICS: nil
|
19
|
+
FOO: BAR
|
20
|
+
</code></pre>
|
21
|
+
|
22
|
+
Heroku Env will overwrite herokus environment variables with yours in
|
23
|
+
<code>config/heroku_env.yml</code>
|
data/Rakefile
ADDED
data/heroku_env.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "heroku_env/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "heroku_env"
|
7
|
+
s.version = HerokuEnv::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Daniel Spangenberg"]
|
10
|
+
s.email = ["daniel.spangenberg@parcydo.com"]
|
11
|
+
s.homepage = "http://neonlex.github.com"
|
12
|
+
s.summary = %q{With this gem you can develop with environment variables local like you would do on heroku.}
|
13
|
+
s.description = %q{This gem provides heroku environment variables in your local development environment.}
|
14
|
+
|
15
|
+
s.add_dependency "heroku"
|
16
|
+
|
17
|
+
s.rubyforge_project = "heroku_env"
|
18
|
+
|
19
|
+
s.files = `git ls-files`.split("\n")
|
20
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
21
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
22
|
+
s.require_paths = ["lib"]
|
23
|
+
end
|
data/lib/heroku_env.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
module HerokuEnv
|
2
|
+
module Rails
|
3
|
+
class Railtie < ::Rails::Railtie
|
4
|
+
config.before_configuration do
|
5
|
+
heroku_config = `heroku config --shell`.split("\n").inject({}) do |config, item|
|
6
|
+
key, value = item.split("=", 2)
|
7
|
+
config[key] = value
|
8
|
+
config
|
9
|
+
end
|
10
|
+
custom_config = YAML.load_file(File.join(::Rails.root, "config", "heroku_env.yml"))[::Rails.env] rescue {}
|
11
|
+
config = heroku_config.merge(custom_config)
|
12
|
+
config.each do |key, value|
|
13
|
+
ENV[key] = value if !ENV.has_key?(key) && key != "BUNDLE_WITHOUT"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: heroku_env
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.1.0
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Daniel Spangenberg
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-04-16 00:00:00 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: heroku
|
17
|
+
prerelease: false
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
type: :runtime
|
25
|
+
version_requirements: *id001
|
26
|
+
description: This gem provides heroku environment variables in your local development environment.
|
27
|
+
email:
|
28
|
+
- daniel.spangenberg@parcydo.com
|
29
|
+
executables: []
|
30
|
+
|
31
|
+
extensions: []
|
32
|
+
|
33
|
+
extra_rdoc_files: []
|
34
|
+
|
35
|
+
files:
|
36
|
+
- .gitignore
|
37
|
+
- Gemfile
|
38
|
+
- README.textile
|
39
|
+
- Rakefile
|
40
|
+
- heroku_env.gemspec
|
41
|
+
- lib/heroku_env.rb
|
42
|
+
- lib/heroku_env/version.rb
|
43
|
+
homepage: http://neonlex.github.com
|
44
|
+
licenses: []
|
45
|
+
|
46
|
+
post_install_message:
|
47
|
+
rdoc_options: []
|
48
|
+
|
49
|
+
require_paths:
|
50
|
+
- lib
|
51
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: "0"
|
57
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: "0"
|
63
|
+
requirements: []
|
64
|
+
|
65
|
+
rubyforge_project: heroku_env
|
66
|
+
rubygems_version: 1.7.2
|
67
|
+
signing_key:
|
68
|
+
specification_version: 3
|
69
|
+
summary: With this gem you can develop with environment variables local like you would do on heroku.
|
70
|
+
test_files: []
|
71
|
+
|