rails_pwnerer 0.6.53 → 0.6.54

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.6.54. Support Rails 3 applications.
2
+
1
3
  v0.6.53. Updated magic Google search string for RubyGems download location.
2
4
 
3
5
  v0.6.52. Added dependencies for Rails 3 to the set of scaffolded gems.
@@ -81,11 +81,17 @@ class RailsPwnage::App::ClusterConfig
81
81
  RailsPwnage::App::NginxConfig.new.update app_name, instance_name
82
82
  end
83
83
 
84
- static_cmd = "thin start -a 127.0.0.1 -A rails -c #{app_path} -d -u #{pwnerer_user}" +
84
+ static_cmd = "thin start -a 127.0.0.1 -c #{app_path} -d -u #{pwnerer_user}" +
85
85
  " -g #{pwnerer_group} -e #{environment} "
86
86
 
87
87
  # TODO: start the servers simultaneously
88
- Dir.chdir app_config[:app_path] do
88
+ Dir.chdir app_path do
89
+ if File.exist? 'config.ru'
90
+ static_cmd << '-R config.ru '
91
+ else
92
+ static_cmd << '-A rails '
93
+ end
94
+
89
95
  frontends.times do |f|
90
96
  fe_port = first_port + f
91
97
  cmd = static_cmd + "-p #{fe_port} -l log/fe.#{fe_port}.log -P tmp/pids/fe.#{fe_port}.pid"
@@ -90,11 +90,19 @@ class RailsPwnage::App::Files
90
90
  load_files app_name, instance_name
91
91
  when :console
92
92
  Dir.chdir(RailsPwnage::Config[app_name, instance_name][:app_path]) do
93
- Kernel.system 'ruby script/console production'
93
+ if File.exist? 'script/rails'
94
+ Kernel.system 'rails console production'
95
+ else
96
+ Kernel.system 'ruby script/console production'
97
+ end
94
98
  end
95
99
  when :db_console
96
100
  Dir.chdir(RailsPwnage::Config[app_name, instance_name][:app_path]) do
97
- Kernel.system 'ruby script/dbconsole --include-password production'
101
+ if File.exist? 'script/rails'
102
+ Kernel.system 'rails dbconsole --include-password production'
103
+ else
104
+ Kernel.system 'ruby script/dbconsole --include-password production'
105
+ end
98
106
  end
99
107
  end
100
108
  end
@@ -6,26 +6,31 @@ class RailsPwnage::App::Gems
6
6
  def update(app_name, instance_name)
7
7
  app_config = RailsPwnage::Config[app_name, instance_name]
8
8
 
9
- # Phase 1: app-directed install
10
- if app_config[:gems]
11
- # Can be specified as comma-separated string or array.
12
- if app_config[:gems].respond_to? :to_str
13
- install_gems = app_config[:gems].split(',')
14
- else
15
- install_gems = app_config[:gems]
16
- end
17
- install_gems.each do |gem_name|
18
- #begin
19
- install_gem gem_name unless gem_exists? gem_name
20
- #rescue Exception
21
- #end
9
+ Dir.chdir app_config[:app_path] do
10
+ # Phase 1: app-directed install
11
+ if !File.exist?('Gemfile') && app_config[:gems]
12
+ # Can be specified as comma-separated string or array.
13
+ if app_config[:gems].respond_to? :to_str
14
+ install_gems = app_config[:gems].split(',')
15
+ else
16
+ install_gems = app_config[:gems]
17
+ end
18
+ install_gems.each do |gem_name|
19
+ begin
20
+ install_gem gem_name unless gem_exists? gem_name
21
+ rescue Exception
22
+ end
23
+ end
22
24
  end
23
- end
24
25
 
25
- # Phase 2: rails install
26
- Dir.chdir app_config[:app_path] do
27
- # install the gems needed by the app
28
- system "rake gems:install RAILS_ENV=production"
26
+ # Phase 2: bundler / rails install
27
+ # Install the gems needed by the app.
28
+ if File.exist? 'Gemfile'
29
+ File.open('Gemfile', 'a') { |f| f.write "\ngem 'thin'\n"}
30
+ system "bundle install"
31
+ else
32
+ system "rake gems:install RAILS_ENV=production"
33
+ end
29
34
  end
30
35
  end
31
36
 
@@ -9,7 +9,7 @@ class RailsPwnage::Scaffolds::Gems
9
9
  end
10
10
 
11
11
  def install_servers
12
- install_gems %w(memcache-client rack rack-test rack-mount thin mongrel)
12
+ install_gems %w(memcache-client rack rack-test rack-mount unicorn thin)
13
13
  end
14
14
 
15
15
  def install_dbi
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{rails_pwnerer}
5
- s.version = "0.6.53"
5
+ s.version = "0.6.54"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Victor Costan"]
9
- s.date = %q{2010-02-06}
9
+ s.date = %q{2010-02-09}
10
10
  s.default_executable = %q{bin/rpwn}
11
11
  s.description = %q{Rails deployment tool/hack.}
12
12
  s.email = %q{victor@costan.us}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_pwnerer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.53
4
+ version: 0.6.54
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Costan
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-06 00:00:00 -05:00
12
+ date: 2010-02-09 00:00:00 -05:00
13
13
  default_executable: bin/rpwn
14
14
  dependencies: []
15
15