heroku-rails 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,5 +1,11 @@
1
1
  Heroku Rails
2
2
 
3
+ v0.4.4
4
+ ============================================
5
+ Fix heroku rake
6
+ Upgrade heroku authorization
7
+ Fix deprecation warning
8
+
3
9
  v0.2.0
4
10
  ============================================
5
11
  Added Heroku Settings tasks, and rails generators
@@ -29,4 +35,4 @@ Glenn Roberts
29
35
 
30
36
  v0.0.1.
31
37
  ============================================
32
- Initial release.
38
+ Initial release.
data/Gemfile CHANGED
@@ -6,5 +6,4 @@ gem "ruby-debug19", :platforms => :mri_19
6
6
 
7
7
  gem "autotest", ">= 0"
8
8
  gem "growl-glue", ">= 0"
9
-
10
- gem "rake", "0.8.7"
9
+ gem "rdoc"
@@ -1,44 +1,52 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- heroku-rails (0.4.3)
5
- heroku (>= 1.11.0)
4
+ heroku-rails (0.4.4)
5
+ heroku (>= 2.15.0)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
- ZenTest (4.6.2)
11
- addressable (2.2.6)
10
+ ZenTest (4.8.2)
11
+ addressable (2.3.2)
12
12
  archive-tar-minitar (0.5.2)
13
13
  autotest (4.4.6)
14
14
  ZenTest (>= 4.4.1)
15
- columnize (0.3.5)
15
+ columnize (0.3.6)
16
16
  diff-lcs (1.1.3)
17
+ excon (0.15.4)
17
18
  growl-glue (1.0.7)
18
- heroku (2.15.1)
19
+ heroku (2.30.1)
20
+ heroku-api (~> 0.3.1)
19
21
  launchy (>= 0.3.2)
22
+ netrc (~> 0.7.5)
20
23
  rest-client (~> 1.6.1)
21
24
  rubyzip
22
- term-ansicolor (~> 1.0.5)
23
- launchy (2.0.5)
24
- addressable (~> 2.2.6)
25
+ heroku-api (0.3.1)
26
+ excon (~> 0.15.4)
27
+ json (1.7.4)
28
+ launchy (2.1.1)
29
+ addressable (~> 2.3)
25
30
  linecache (0.46)
26
31
  rbx-require-relative (> 0.0.4)
27
32
  linecache19 (0.5.12)
28
33
  ruby_core_source (>= 0.1.4)
29
- mime-types (1.17.2)
30
- rake (0.8.7)
31
- rbx-require-relative (0.0.5)
34
+ mime-types (1.19)
35
+ netrc (0.7.5)
36
+ rake (0.9.2.2)
37
+ rbx-require-relative (0.0.9)
38
+ rdoc (3.12)
39
+ json (~> 1.4)
32
40
  rest-client (1.6.7)
33
41
  mime-types (>= 1.16)
34
- rspec (2.7.0)
35
- rspec-core (~> 2.7.0)
36
- rspec-expectations (~> 2.7.0)
37
- rspec-mocks (~> 2.7.0)
38
- rspec-core (2.7.1)
39
- rspec-expectations (2.7.0)
40
- diff-lcs (~> 1.1.2)
41
- rspec-mocks (2.7.0)
42
+ rspec (2.11.0)
43
+ rspec-core (~> 2.11.0)
44
+ rspec-expectations (~> 2.11.0)
45
+ rspec-mocks (~> 2.11.0)
46
+ rspec-core (2.11.1)
47
+ rspec-expectations (2.11.2)
48
+ diff-lcs (~> 1.1.3)
49
+ rspec-mocks (2.11.1)
42
50
  ruby-debug (0.10.4)
43
51
  columnize (>= 0.1)
44
52
  ruby-debug-base (~> 0.10.4.0)
@@ -54,8 +62,7 @@ GEM
54
62
  ruby-debug-base19 (>= 0.11.19)
55
63
  ruby_core_source (0.1.5)
56
64
  archive-tar-minitar (>= 0.5.2)
57
- rubyzip (0.9.5)
58
- term-ansicolor (1.0.7)
65
+ rubyzip (0.9.9)
59
66
 
60
67
  PLATFORMS
61
68
  ruby
@@ -64,7 +71,8 @@ DEPENDENCIES
64
71
  autotest
65
72
  growl-glue
66
73
  heroku-rails!
67
- rake (= 0.8.7)
74
+ rake (~> 0.9.2)
75
+ rdoc
68
76
  rspec (~> 2.0)
69
77
  ruby-debug
70
78
  ruby-debug19
data/Rakefile CHANGED
@@ -2,10 +2,10 @@ require "bundler"
2
2
  Bundler.setup
3
3
 
4
4
  require 'rake'
5
- require 'rake/gempackagetask'
5
+ require 'rubygems/package_task'
6
6
 
7
7
  gemspec = eval(File.read('heroku-rails.gemspec'))
8
- Rake::GemPackageTask.new(gemspec) do |pkg|
8
+ Gem::PackageTask.new(gemspec) do |pkg|
9
9
  pkg.gem_spec = gemspec
10
10
  end
11
11
 
@@ -22,17 +22,17 @@ end
22
22
  require "rspec"
23
23
  require "rspec/core/rake_task"
24
24
 
25
- Rspec::Core::RakeTask.new(:spec) do |spec|
25
+ RSpec::Core::RakeTask.new(:spec) do |spec|
26
26
  spec.pattern = "spec/**/*_spec.rb"
27
27
  end
28
28
 
29
- Rspec::Core::RakeTask.new('spec:progress') do |spec|
29
+ RSpec::Core::RakeTask.new('spec:progress') do |spec|
30
30
  spec.rspec_opts = %w(--format progress)
31
31
  spec.pattern = "spec/**/*_spec.rb"
32
32
  end
33
33
 
34
- require "rake/rdoctask"
35
- Rake::RDocTask.new do |rdoc|
34
+ require "rdoc/task"
35
+ RDoc::Task.new do |rdoc|
36
36
  rdoc.rdoc_dir = "rdoc"
37
37
  rdoc.title = "Heroku Rails #{gemspec.version}"
38
38
  rdoc.rdoc_files.include("README*")
@@ -40,4 +40,4 @@ Rake::RDocTask.new do |rdoc|
40
40
  end
41
41
 
42
42
 
43
- task :default => :spec
43
+ task :default => :spec
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "heroku-rails"
3
- s.version = "0.4.3"
3
+ s.version = "0.4.4"
4
4
 
5
5
  s.authors = ["Elijah Miller", "Glenn Roberts", "Jacques Crocker"]
6
6
  s.summary = "Deployment and configuration tools for Heroku/Rails"
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
31
31
  "CHANGELOG"
32
32
  ]
33
33
 
34
- s.add_runtime_dependency "heroku", ">= 1.11.0"
34
+ s.add_runtime_dependency "heroku", ">= 2.15.0"
35
35
  s.add_development_dependency "rspec", "~> 2.0"
36
+ s.add_development_dependency "rake", "~> 0.9.2"
36
37
  end
37
-
@@ -40,6 +40,14 @@ module HerokuRails
40
40
  stacks[app_env] || stacks['all']
41
41
  end
42
42
 
43
+ def rake_cmd(app_env)
44
+ if self.stack(app_env) =~ /cedar/i
45
+ 'heroku run rake'
46
+ else
47
+ 'heroku rake'
48
+ end
49
+ end
50
+
43
51
  # pull out the config setting hash for a particular app environment
44
52
  def config(app_env)
45
53
  config = self.settings['config'] || {}
@@ -75,4 +83,4 @@ module HerokuRails
75
83
  (all + (setting[app] || [])).uniq
76
84
  end
77
85
  end
78
- end
86
+ end
@@ -8,20 +8,7 @@ module HerokuRails
8
8
  end
9
9
 
10
10
  def authorize
11
- return if @heroku
12
-
13
- # setup heroku username and password so we can start up a heroku client
14
- credentials_path = File.expand_path("~/.heroku/credentials")
15
-
16
- # read in the username,password so we can build the client
17
- if File.exists?(credentials_path)
18
- auth = File.read(credentials_path)
19
- username, password = auth.split("\n")
20
- @heroku = Heroku::Client.new(username, password)
21
- else
22
- puts "Heroku not set up. Run `heroku list` in order to input your credentials and try again"
23
- exit(1)
24
- end
11
+ @heroku ||= Heroku::Auth.client
25
12
  end
26
13
 
27
14
  # add a specific environment to the run list
@@ -36,7 +23,7 @@ module HerokuRails
36
23
 
37
24
  # setup apps (create if necessary)
38
25
  def setup_apps
39
- authorize unless @heroku
26
+ authorize
40
27
 
41
28
  # get a list of all my current apps on Heroku (so we don't create dupes)
42
29
  @my_apps = @heroku.list.map{|a| a.first}
@@ -52,7 +39,7 @@ module HerokuRails
52
39
 
53
40
  # setup the stacks for each app (migrating if necessary)
54
41
  def setup_stacks
55
- authorize unless @heroku
42
+ authorize
56
43
  each_heroku_app do |heroku_env, app_name, repo|
57
44
  # get the intended stack setting
58
45
  stack = @config.stack(heroku_env)
@@ -70,7 +57,7 @@ module HerokuRails
70
57
 
71
58
  # setup the list of collaborators
72
59
  def setup_collaborators
73
- authorize unless @heroku
60
+ authorize
74
61
  each_heroku_app do |heroku_env, app_name, repo|
75
62
  # get the remote info about the app from heroku
76
63
  heroku_app_info = @heroku.info(app_name) || {}
@@ -110,7 +97,7 @@ module HerokuRails
110
97
 
111
98
  # setup configuration
112
99
  def setup_config
113
- authorize unless @heroku
100
+ authorize
114
101
  each_heroku_app do |heroku_env, app_name, repo|
115
102
  # get the configuration that we are aiming towards
116
103
  new_config = @config.config(heroku_env)
@@ -144,7 +131,7 @@ module HerokuRails
144
131
 
145
132
  # setup the addons for heroku
146
133
  def setup_addons
147
- authorize unless @heroku
134
+ authorize
148
135
  each_heroku_app do |heroku_env, app_name, repo|
149
136
  # get the addons that we are aiming towards
150
137
  addons = @config.addons(heroku_env)
@@ -186,7 +173,7 @@ module HerokuRails
186
173
 
187
174
  # setup the domains for heroku
188
175
  def setup_domains
189
- authorize unless @heroku
176
+ authorize
190
177
  each_heroku_app do |heroku_env, app_name, repo|
191
178
  # get the domains that we are aiming towards
192
179
  domains = @config.domains(heroku_env)
@@ -268,15 +255,13 @@ module HerokuRails
268
255
  end
269
256
 
270
257
  def output_destroy_commands(app)
271
- if @destroy_commands.present?
272
- puts "The #{app} had a few things removed from the heroku.yml."
273
- puts "If they are no longer neccessary, then run the following commands:\n\n"
274
- (@destroy_commands || []).each do |destroy_cmd|
275
- puts destroy_cmd
276
- end
277
- puts "\n\nthese commands may cause data loss so make sure you know that these are necessary"
278
- # clear destroy commands
258
+ puts "The #{app} had a few things removed from the heroku.yml."
259
+ puts "If they are no longer neccessary, then run the following commands:\n\n"
260
+ (@destroy_commands || []).each do |destroy_command|
261
+ puts destroy_command
279
262
  end
263
+ puts "\n\nthese commands may cause data loss so make sure you know that these are necessary"
264
+ # clear destroy commands
280
265
  @destroy_commands = []
281
266
  end
282
267
 
@@ -285,4 +270,4 @@ module HerokuRails
285
270
  end
286
271
 
287
272
  end
288
- end
273
+ end
@@ -62,10 +62,12 @@ namespace :heroku do
62
62
  Rake::Task["heroku:before_each_deploy"].reenable
63
63
  Rake::Task["heroku:before_each_deploy"].invoke(app_name)
64
64
 
65
+ rake_cmd = HEROKU_CONFIG.rake_cmd(heroku_env)
66
+
65
67
  branch = `git branch`.scan(/^\* (.*)\n/).flatten.first.to_s
66
68
  if branch.present?
67
69
  @git_push_arguments ||= []
68
- system_with_echo "git push #{repo} #{@git_push_arguments.join(' ')} #{branch}:master && heroku restart --app #{app_name}"
70
+ system_with_echo "git push #{repo} #{@git_push_arguments.join(' ')} #{branch}:master && #{rake_cmd} --app #{app_name} db:migrate && heroku restart --app #{app_name}"
69
71
  else
70
72
  puts "Unable to determine the current git branch, please checkout the branch you'd like to deploy"
71
73
  exit(1)
@@ -179,7 +181,8 @@ namespace :heroku do
179
181
  desc "Migrates and restarts remote servers"
180
182
  task :migrate do
181
183
  HEROKU_RUNNER.each_heroku_app do |heroku_env, app_name, repo|
182
- system_with_echo "heroku rake --app #{app_name} db:migrate && heroku restart --app #{app_name}"
184
+ rake_cmd = HEROKU_CONFIG.rake_cmd(heroku_env)
185
+ system_with_echo "#{rake_cmd} --app #{app_name} db:migrate && heroku restart --app #{app_name}"
183
186
  end
184
187
  end
185
188
 
@@ -200,4 +203,4 @@ namespace :heroku do
200
203
  end
201
204
  end
202
205
  end
203
- end
206
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,22 +11,22 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-01-07 00:00:00.000000000Z
14
+ date: 2012-07-31 00:00:00.000000000Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: heroku
18
- requirement: &2152235900 !ruby/object:Gem::Requirement
18
+ requirement: &70366282766080 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
22
22
  - !ruby/object:Gem::Version
23
- version: 1.11.0
23
+ version: 2.15.0
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *2152235900
26
+ version_requirements: *70366282766080
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
- requirement: &2152234080 !ruby/object:Gem::Requirement
29
+ requirement: &70366282757360 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ~>
@@ -34,7 +34,18 @@ dependencies:
34
34
  version: '2.0'
35
35
  type: :development
36
36
  prerelease: false
37
- version_requirements: *2152234080
37
+ version_requirements: *70366282757360
38
+ - !ruby/object:Gem::Dependency
39
+ name: rake
40
+ requirement: &70366282754740 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 0.9.2
46
+ type: :development
47
+ prerelease: false
48
+ version_requirements: *70366282754740
38
49
  description: Manage multiple Heroku instances/apps for a single Rails app using Rake.
39
50
  It's the Capistrano for Heroku, without the suck.
40
51
  email: railsjedi@gmail.com
@@ -81,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
81
92
  version: '0'
82
93
  segments:
83
94
  - 0
84
- hash: 1070963580858279242
95
+ hash: 3344456155800977380
85
96
  required_rubygems_version: !ruby/object:Gem::Requirement
86
97
  none: false
87
98
  requirements:
@@ -90,10 +101,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
101
  version: '0'
91
102
  segments:
92
103
  - 0
93
- hash: 1070963580858279242
104
+ hash: 3344456155800977380
94
105
  requirements: []
95
106
  rubyforge_project: none
96
- rubygems_version: 1.8.6
107
+ rubygems_version: 1.8.16
97
108
  signing_key:
98
109
  specification_version: 3
99
110
  summary: Deployment and configuration tools for Heroku/Rails