heroku-rails-saas 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/heroku-rails.gemspec +1 -1
- data/lib/heroku-rails-saas.rb +4 -0
- data/lib/{heroku-rails → heroku-rails-saas}/config.rb +1 -1
- data/lib/{heroku-rails → heroku-rails-saas}/hash_recursive_merge.rb +0 -0
- data/lib/{heroku-rails → heroku-rails-saas}/railtie.rb +2 -2
- data/lib/{heroku-rails → heroku-rails-saas}/runner.rb +3 -3
- data/lib/heroku/rails/tasks.rb +6 -6
- data/spec/heroku/rails/{heroku_config_spec.rb → saas/heroku_config_spec.rb} +1 -1
- data/spec/heroku/rails/{heroku_runner_spec.rb → saas/heroku_runner_spec.rb} +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +17 -17
- data/lib/heroku-rails.rb +0 -4
data/Gemfile.lock
CHANGED
data/heroku-rails.gemspec
CHANGED
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'heroku/client'
|
2
2
|
|
3
|
-
module
|
3
|
+
module HerokuRailsSaas
|
4
4
|
class Runner
|
5
5
|
def initialize(config)
|
6
6
|
@config = config
|
@@ -109,8 +109,8 @@ module HerokuRails
|
|
109
109
|
new_config = @config.config(app_env)
|
110
110
|
|
111
111
|
# default RACK_ENV and RAILS_ENV to the heroku_env (unless its manually set to something else)
|
112
|
-
new_config["RACK_ENV"] =
|
113
|
-
new_config["RAILS_ENV"] =
|
112
|
+
new_config["RACK_ENV"] = HerokuRailsSaas::Config.extract_environment_from(app_env) unless new_config["RACK_ENV"]
|
113
|
+
new_config["RAILS_ENV"] = HerokuRailsSaas::Config.extract_environment_from(app_env) unless new_config["RAILS_ENV"]
|
114
114
|
# get the existing config from heroku's servers
|
115
115
|
existing_config = @heroku.config_vars(app_name) || {}
|
116
116
|
|
data/lib/heroku/rails/tasks.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
require 'heroku-rails'
|
1
|
+
require 'heroku-rails-saas'
|
2
2
|
|
3
3
|
HEROKU_CONFIG_FILE = File.join(HerokuRails::Config.root, 'config', 'heroku.yml')
|
4
4
|
HEROKU_APP_SPECIFIC_CONFIG_FILES = Dir.glob("#{File.join(HerokuRails::Config.root, 'config', 'heroku')}/*.yml")
|
5
|
-
HEROKU_CONFIG =
|
6
|
-
HEROKU_RUNNER =
|
5
|
+
HEROKU_CONFIG = HerokuRailsSaas::Config.new({:default => HEROKU_CONFIG_FILE, :apps => HEROKU_APP_SPECIFIC_CONFIG_FILES})
|
6
|
+
HEROKU_RUNNER = HerokuRailsSaas::Runner.new(HEROKU_CONFIG)
|
7
7
|
|
8
8
|
# create all the environment specific tasks
|
9
9
|
(HEROKU_CONFIG.apps).each do |app, hsh|
|
10
10
|
hsh.each do |env, heroku_env|
|
11
|
-
app_name =
|
11
|
+
app_name = HerokuRailsSaas::Config.app_name(app, env)
|
12
12
|
desc "Select #{app_name} Heroku app for later commands"
|
13
13
|
task app_name do
|
14
14
|
# callback switch_environment
|
@@ -231,8 +231,8 @@ namespace :heroku do
|
|
231
231
|
HEROKU_RUNNER.each_heroku_app do |heroku_env, app_name, repo|
|
232
232
|
system_with_echo "heroku pgdumps:capture --app #{app_name}"
|
233
233
|
dump = `heroku pgdumps --app #{app_name}`.split("\n").last.split(" ").first
|
234
|
-
system_with_echo "mkdir -p #{
|
235
|
-
file = "#{
|
234
|
+
system_with_echo "mkdir -p #{HerokuRailsSaas::Config.root}/db/dumps"
|
235
|
+
file = "#{HerokuRailsSaas::Config.root}/db/dumps/#{dump}.sql.gz"
|
236
236
|
url = `heroku pgdumps:url --app #{app_name} #{dump}`.chomp
|
237
237
|
system_with_echo "wget", url, "-O", file
|
238
238
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heroku-rails-saas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,11 +12,11 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2012-04-
|
15
|
+
date: 2012-04-30 00:00:00.000000000Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: heroku
|
19
|
-
requirement: &
|
19
|
+
requirement: &2160512740 !ruby/object:Gem::Requirement
|
20
20
|
none: false
|
21
21
|
requirements:
|
22
22
|
- - ! '>='
|
@@ -24,10 +24,10 @@ dependencies:
|
|
24
24
|
version: 2.24.1
|
25
25
|
type: :runtime
|
26
26
|
prerelease: false
|
27
|
-
version_requirements: *
|
27
|
+
version_requirements: *2160512740
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rspec
|
30
|
-
requirement: &
|
30
|
+
requirement: &2160511520 !ruby/object:Gem::Requirement
|
31
31
|
none: false
|
32
32
|
requirements:
|
33
33
|
- - ~>
|
@@ -35,7 +35,7 @@ dependencies:
|
|
35
35
|
version: '2.0'
|
36
36
|
type: :development
|
37
37
|
prerelease: false
|
38
|
-
version_requirements: *
|
38
|
+
version_requirements: *2160511520
|
39
39
|
description: Manage multiple Heroku instances/apps for a single Rails app using Rake.
|
40
40
|
email: railsjedi@gmail.com
|
41
41
|
executables: []
|
@@ -50,16 +50,16 @@ files:
|
|
50
50
|
- lib/generators/templates/heroku.rake
|
51
51
|
- lib/generators/templates/heroku.yml
|
52
52
|
- lib/heroku/rails/tasks.rb
|
53
|
-
- lib/heroku-rails/config.rb
|
54
|
-
- lib/heroku-rails/hash_recursive_merge.rb
|
55
|
-
- lib/heroku-rails/railtie.rb
|
56
|
-
- lib/heroku-rails/runner.rb
|
57
|
-
- lib/heroku-rails.rb
|
53
|
+
- lib/heroku-rails-saas/config.rb
|
54
|
+
- lib/heroku-rails-saas/hash_recursive_merge.rb
|
55
|
+
- lib/heroku-rails-saas/railtie.rb
|
56
|
+
- lib/heroku-rails-saas/runner.rb
|
57
|
+
- lib/heroku-rails-saas.rb
|
58
58
|
- spec/fixtures/awesomeapp.yml
|
59
59
|
- spec/fixtures/heroku-config.yml
|
60
60
|
- spec/fixtures/mediocreapp.yml
|
61
|
-
- spec/heroku/rails/heroku_config_spec.rb
|
62
|
-
- spec/heroku/rails/heroku_runner_spec.rb
|
61
|
+
- spec/heroku/rails/saas/heroku_config_spec.rb
|
62
|
+
- spec/heroku/rails/saas/heroku_runner_spec.rb
|
63
63
|
- spec/spec_helper.rb
|
64
64
|
- heroku-rails.gemspec
|
65
65
|
- Gemfile
|
@@ -84,7 +84,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
84
84
|
version: '0'
|
85
85
|
segments:
|
86
86
|
- 0
|
87
|
-
hash:
|
87
|
+
hash: -1604565509238945250
|
88
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
89
|
none: false
|
90
90
|
requirements:
|
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
93
|
version: '0'
|
94
94
|
segments:
|
95
95
|
- 0
|
96
|
-
hash:
|
96
|
+
hash: -1604565509238945250
|
97
97
|
requirements: []
|
98
98
|
rubyforge_project: none
|
99
99
|
rubygems_version: 1.8.6
|
@@ -104,6 +104,6 @@ test_files:
|
|
104
104
|
- spec/fixtures/awesomeapp.yml
|
105
105
|
- spec/fixtures/heroku-config.yml
|
106
106
|
- spec/fixtures/mediocreapp.yml
|
107
|
-
- spec/heroku/rails/heroku_config_spec.rb
|
108
|
-
- spec/heroku/rails/heroku_runner_spec.rb
|
107
|
+
- spec/heroku/rails/saas/heroku_config_spec.rb
|
108
|
+
- spec/heroku/rails/saas/heroku_runner_spec.rb
|
109
109
|
- spec/spec_helper.rb
|
data/lib/heroku-rails.rb
DELETED