rails_pwnerer 0.6.53 → 0.6.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +2 -0
- data/lib/pwnage/app/cluster_config.rb +8 -2
- data/lib/pwnage/app/files.rb +10 -2
- data/lib/pwnage/app/gems.rb +23 -18
- data/lib/pwnage/scaffolds/gems.rb +1 -1
- data/rails_pwnerer.gemspec +2 -2
- metadata +2 -2
data/CHANGELOG
CHANGED
@@ -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 -
|
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
|
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"
|
data/lib/pwnage/app/files.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
data/lib/pwnage/app/gems.rb
CHANGED
@@ -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
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
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
|
|
data/rails_pwnerer.gemspec
CHANGED
@@ -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.
|
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-
|
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.
|
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-
|
12
|
+
date: 2010-02-09 00:00:00 -05:00
|
13
13
|
default_executable: bin/rpwn
|
14
14
|
dependencies: []
|
15
15
|
|