heroku_san 4.0.4 → 4.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/heroku_san.gemspec +0 -1
- data/lib/heroku_san.rb +8 -1
- data/lib/heroku_san/project.rb +3 -6
- data/lib/heroku_san/stage.rb +6 -7
- data/lib/heroku_san/version.rb +1 -1
- data/spec/heroku_san/stage_spec.rb +3 -3
- metadata +3 -19
data/CHANGELOG.md
CHANGED
data/heroku_san.gemspec
CHANGED
@@ -29,7 +29,6 @@ Gem::Specification.new do |s|
|
|
29
29
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
30
30
|
s.add_runtime_dependency(%q<heroku-api>, ['>= 0.1.2'])
|
31
31
|
s.add_runtime_dependency(%q<rake>)
|
32
|
-
s.add_runtime_dependency('activesupport')
|
33
32
|
s.add_development_dependency(%q<rails>, ['>= 2'])
|
34
33
|
s.add_development_dependency(%q<rspec>)
|
35
34
|
s.add_development_dependency(%q<aruba>)
|
data/lib/heroku_san.rb
CHANGED
@@ -6,7 +6,14 @@ require 'heroku_san/deploy/rails'
|
|
6
6
|
require 'heroku_san/deploy/sinatra'
|
7
7
|
|
8
8
|
module HerokuSan
|
9
|
-
|
9
|
+
class << self
|
10
|
+
def project
|
11
|
+
@project
|
12
|
+
end
|
13
|
+
def project=(project)
|
14
|
+
@project = project
|
15
|
+
end
|
16
|
+
end
|
10
17
|
class NoApps < StandardError; end
|
11
18
|
class MissingApp < StandardError; end
|
12
19
|
class Deprecated < StandardError; end
|
data/lib/heroku_san/project.rb
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
require 'active_support/core_ext/string/inflections'
|
2
|
-
require 'active_support/core_ext/hash/slice'
|
3
|
-
|
4
1
|
module HerokuSan
|
5
2
|
class Project
|
6
3
|
attr_reader :config_file
|
@@ -14,7 +11,7 @@ module HerokuSan
|
|
14
11
|
config = parse(@config_file)
|
15
12
|
config.each do |stage, settings|
|
16
13
|
# TODO: Push this eval later (j.i.t.)
|
17
|
-
@app_settings[stage] = HerokuSan::Stage.new(stage, settings.merge(options
|
14
|
+
@app_settings[stage] = HerokuSan::Stage.new(stage, settings.merge('deploy' => (options[:deploy]||options['deploy'])))
|
18
15
|
end
|
19
16
|
end
|
20
17
|
|
@@ -45,7 +42,7 @@ module HerokuSan
|
|
45
42
|
end
|
46
43
|
|
47
44
|
def apps
|
48
|
-
if @apps.
|
45
|
+
if @apps && !@apps.empty?
|
49
46
|
@apps
|
50
47
|
else
|
51
48
|
@apps = if all.size == 1
|
@@ -113,4 +110,4 @@ module HerokuSan
|
|
113
110
|
app_settings
|
114
111
|
end
|
115
112
|
end
|
116
|
-
end
|
113
|
+
end
|
data/lib/heroku_san/stage.rb
CHANGED
@@ -1,8 +1,5 @@
|
|
1
1
|
require 'heroku-api'
|
2
2
|
require 'json'
|
3
|
-
require 'active_support/core_ext/object/blank'
|
4
|
-
require 'active_support/core_ext/hash/keys'
|
5
|
-
require 'active_support/core_ext/hash/slice'
|
6
3
|
|
7
4
|
MOCK = false unless defined?(MOCK)
|
8
5
|
|
@@ -16,7 +13,7 @@ module HerokuSan
|
|
16
13
|
'deploy' => HerokuSan::Deploy::Rails
|
17
14
|
}
|
18
15
|
@name = stage
|
19
|
-
@options = default_options.merge(options
|
16
|
+
@options = default_options.merge(options)
|
20
17
|
end
|
21
18
|
|
22
19
|
def heroku
|
@@ -85,8 +82,10 @@ module HerokuSan
|
|
85
82
|
end
|
86
83
|
|
87
84
|
def create
|
88
|
-
params =
|
89
|
-
|
85
|
+
params = {
|
86
|
+
'name' => @options['app'],
|
87
|
+
'stack' => @options['stack']
|
88
|
+
}
|
90
89
|
response = heroku.post_app(params)
|
91
90
|
response.body['name']
|
92
91
|
end
|
@@ -104,7 +103,7 @@ module HerokuSan
|
|
104
103
|
end
|
105
104
|
|
106
105
|
def push_config(options = nil)
|
107
|
-
params = (options || config)
|
106
|
+
params = (options || config)
|
108
107
|
heroku.put_config_vars(app, params).body
|
109
108
|
end
|
110
109
|
|
data/lib/heroku_san/version.rb
CHANGED
@@ -219,15 +219,15 @@ describe HerokuSan::Stage do
|
|
219
219
|
|
220
220
|
describe "#push_config" do
|
221
221
|
it "updates the configuration settings on Heroku" do
|
222
|
-
subject = HerokuSan::Stage.new('test', {"app" => "awesomeapp", "config" => {
|
222
|
+
subject = HerokuSan::Stage.new('test', {"app" => "awesomeapp", "config" => {'FOO' => 'bar', 'DOG' => 'emu'}})
|
223
223
|
with_app(subject, 'name' => subject.app) do |app_data|
|
224
224
|
subject.push_config.should == STOCK_CONFIG.merge('FOO' => 'bar', 'DOG' => 'emu')
|
225
225
|
end
|
226
226
|
end
|
227
227
|
it "pushes the options hash" do
|
228
|
-
subject = HerokuSan::Stage.new('test', {"app" => "awesomeapp", "config" => {
|
228
|
+
subject = HerokuSan::Stage.new('test', {"app" => "awesomeapp", "config" => {'FOO' => 'bar', 'DOG' => 'emu'}})
|
229
229
|
with_app(subject, 'name' => subject.app) do |app_data|
|
230
|
-
subject.push_config(
|
230
|
+
subject.push_config('RACK_ENV' => 'magic').should == STOCK_CONFIG.merge('RACK_ENV' => 'magic')
|
231
231
|
end
|
232
232
|
end
|
233
233
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heroku_san
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2012-11-
|
15
|
+
date: 2012-11-24 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: heroku-api
|
@@ -46,22 +46,6 @@ dependencies:
|
|
46
46
|
- - ! '>='
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0'
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
name: activesupport
|
51
|
-
requirement: !ruby/object:Gem::Requirement
|
52
|
-
none: false
|
53
|
-
requirements:
|
54
|
-
- - ! '>='
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version: '0'
|
57
|
-
type: :runtime
|
58
|
-
prerelease: false
|
59
|
-
version_requirements: !ruby/object:Gem::Requirement
|
60
|
-
none: false
|
61
|
-
requirements:
|
62
|
-
- - ! '>='
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
version: '0'
|
65
49
|
- !ruby/object:Gem::Dependency
|
66
50
|
name: rails
|
67
51
|
requirement: !ruby/object:Gem::Requirement
|
@@ -255,7 +239,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
255
239
|
version: '0'
|
256
240
|
segments:
|
257
241
|
- 0
|
258
|
-
hash:
|
242
|
+
hash: 676383002045527270
|
259
243
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
260
244
|
none: false
|
261
245
|
requirements:
|