heroku-environment 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +49 -0
- data/lib/heroku-environment.rb +1 -0
- data/lib/heroku/command/config.rb +20 -0
- data/lib/heroku/environment.rb +16 -0
- metadata +70 -0
data/Rakefile
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
require "rake"
|
2
|
+
require "rspec"
|
3
|
+
require "rspec/core/rake_task"
|
4
|
+
|
5
|
+
$:.unshift File.expand_path("../lib", __FILE__)
|
6
|
+
require "heroku/environment"
|
7
|
+
|
8
|
+
task :default => :spec
|
9
|
+
|
10
|
+
desc "Run all specs"
|
11
|
+
Rspec::Core::RakeTask.new(:spec) do |t|
|
12
|
+
t.pattern = 'spec/**/*_spec.rb'
|
13
|
+
end
|
14
|
+
|
15
|
+
desc "Generate RCov code coverage report"
|
16
|
+
task :rcov => "rcov:build" do
|
17
|
+
%x{ open coverage/index.html }
|
18
|
+
end
|
19
|
+
|
20
|
+
Rspec::Core::RakeTask.new("rcov:build") do |t|
|
21
|
+
t.pattern = 'spec/**/*_spec.rb'
|
22
|
+
t.rcov = true
|
23
|
+
t.rcov_opts = [ "--exclude", Gem.default_dir , "--exclude", "spec" ]
|
24
|
+
end
|
25
|
+
|
26
|
+
######################################################
|
27
|
+
|
28
|
+
begin
|
29
|
+
require 'jeweler'
|
30
|
+
Jeweler::Tasks.new do |s|
|
31
|
+
s.name = "heroku-environment"
|
32
|
+
s.version = Heroku::Environment::VERSION
|
33
|
+
|
34
|
+
s.summary = "Push and pull Heroku environments for local use"
|
35
|
+
s.description = s.summary
|
36
|
+
s.author = "David Dollar"
|
37
|
+
s.email = "ddollar@gmail.com"
|
38
|
+
s.homepage = "http://github.com/ddollar/heroku-environment"
|
39
|
+
|
40
|
+
s.platform = Gem::Platform::RUBY
|
41
|
+
s.has_rdoc = false
|
42
|
+
|
43
|
+
s.files = %w(Rakefile README.md) + Dir["{lib,spec}/**/*"]
|
44
|
+
s.require_path = "lib"
|
45
|
+
end
|
46
|
+
Jeweler::GemcutterTasks.new
|
47
|
+
rescue LoadError
|
48
|
+
puts "Jeweler not available. Install it with: sudo gem install jeweler"
|
49
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require "heroku/environment"
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require "yaml"
|
2
|
+
|
3
|
+
class Heroku::Command::Config < Heroku::Command::BaseWithApp
|
4
|
+
|
5
|
+
def pull
|
6
|
+
File.open(".environment", "w") do |file|
|
7
|
+
file.puts YAML.dump(heroku.config_vars(app))
|
8
|
+
end
|
9
|
+
display "Config for #{app} written to .environment"
|
10
|
+
end
|
11
|
+
|
12
|
+
def push
|
13
|
+
error "No .environment file" unless File.exists?(".environment")
|
14
|
+
config = YAML.load_file(".environment")
|
15
|
+
heroku.clear_config_vars(app)
|
16
|
+
heroku.add_config_vars(app, config)
|
17
|
+
display "Config in .environment written to #{app}"
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Heroku
|
2
|
+
module Environment
|
3
|
+
VERSION = "0.0.1"
|
4
|
+
|
5
|
+
def self.load
|
6
|
+
require "yaml"
|
7
|
+
if File.exists?(".environment")
|
8
|
+
YAML.load_file(".environment").each do |key, value|
|
9
|
+
ENV[key] = value
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
Heroku::Environment.load
|
metadata
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: heroku-environment
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- David Dollar
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-08-12 00:00:00 -04:00
|
19
|
+
default_executable:
|
20
|
+
dependencies: []
|
21
|
+
|
22
|
+
description: Push and pull Heroku environments for local use
|
23
|
+
email: ddollar@gmail.com
|
24
|
+
executables: []
|
25
|
+
|
26
|
+
extensions: []
|
27
|
+
|
28
|
+
extra_rdoc_files: []
|
29
|
+
|
30
|
+
files:
|
31
|
+
- Rakefile
|
32
|
+
- lib/heroku-environment.rb
|
33
|
+
- lib/heroku/command/config.rb
|
34
|
+
- lib/heroku/environment.rb
|
35
|
+
has_rdoc: false
|
36
|
+
homepage: http://github.com/ddollar/heroku-environment
|
37
|
+
licenses: []
|
38
|
+
|
39
|
+
post_install_message:
|
40
|
+
rdoc_options:
|
41
|
+
- --charset=UTF-8
|
42
|
+
require_paths:
|
43
|
+
- lib
|
44
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
+
none: false
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
hash: 3
|
50
|
+
segments:
|
51
|
+
- 0
|
52
|
+
version: "0"
|
53
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 3
|
59
|
+
segments:
|
60
|
+
- 0
|
61
|
+
version: "0"
|
62
|
+
requirements: []
|
63
|
+
|
64
|
+
rubyforge_project:
|
65
|
+
rubygems_version: 1.3.7
|
66
|
+
signing_key:
|
67
|
+
specification_version: 3
|
68
|
+
summary: Push and pull Heroku environments for local use
|
69
|
+
test_files: []
|
70
|
+
|