rails_pwnerer 0.6.18 → 0.6.19

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 CHANGED
@@ -1,3 +1,5 @@
1
+ v0.6.19. Added LSB header to rpwnctl. Using symbolic links instead of copying for init.d scripts so they can be upgraded.
2
+
1
3
  v0.6.18. Fixed bad log path in thin command line.
2
4
 
3
5
  v0.6.17. Doing svn revert on config/ on updates, so svn doesn't complain about conflicts.
data/bin/rpwn CHANGED
@@ -1,4 +1,19 @@
1
1
  #!/usr/bin/env ruby
2
+ #
3
+ ### BEGIN INIT INFO
4
+ # Provides: rpwn
5
+ # Required-Start: $local_fs $syslog
6
+ # Required-Stop: $local_fs $syslog
7
+ # Should-Start: $remote_fs $network $named $time mysql nginx
8
+ # Should-Stop: $remote_fs $network $named $time mysql nginx
9
+ # Default-Start: 2 3 4 5
10
+ # Default-Stop: 0 1 6
11
+ # Short-Description: Starts rails_pwnerer's control daemon.
12
+ # Description: rails_pwnerer's control daemon configures and starts up
13
+ # the Rails applications deployed on the machine
14
+ ### END INIT INFO
15
+ #
16
+
2
17
  require 'rubygems'
3
18
  require 'rails_pwnerer'
4
19
 
@@ -118,7 +118,7 @@ ENDSQL
118
118
  Dir.chdir app_config[:backup_path] do
119
119
  # find the latest dump and load it in
120
120
  dump_file = Dir.glob("db/#{app_name}.#{instance_name}_*").max
121
- system "mysql -u#{db_user} -p#{db_pass} #{db_name} < #{dump_file}"
121
+ Kernel.system "mysql -u#{db_user} -p#{db_pass} #{db_name} < #{dump_file}"
122
122
  end
123
123
  end
124
124
 
@@ -16,11 +16,17 @@ module RailsPwnage::Base
16
16
  end
17
17
 
18
18
  # hooks a script into the boot sequence
19
- def hook_boot_script(script_location, script_name = File.basename(script_location))
19
+ def hook_boot_script(script_location, script_name = File.basename(script_location), options = {})
20
20
  # copy the script to /etc/init.d and chmod +x
21
21
  target_script = path_to_boot_script script_name
22
- FileUtils.cp script_location, target_script
23
- File.chmod 0755, target_script
22
+ if options[:symlink]
23
+ FileUtils.ln_s script_location, target_script, :force => true
24
+ exec_file = script_location
25
+ else
26
+ FileUtils.cp script_location, target_script
27
+ exec_file = target_script
28
+ end
29
+ File.chmod 0755, exec_file
24
30
 
25
31
  # add to boot sequence
26
32
  system "update-rc.d #{script_name} defaults"
@@ -5,8 +5,8 @@ class RailsPwnage::Scaffolds::HookDaemon
5
5
 
6
6
  # runner
7
7
  def run
8
- daemon_ctl = File.join path_to_gem('rails_pwnerer', '/lib/rails_pwnerer.rb'), 'bin/rpwnctl'
9
- hook_boot_script daemon_ctl, 'rpwn'
8
+ daemon_ctl = `which rpwnctl`.strip
9
+ hook_boot_script daemon_ctl, 'rpwn', :symlink => true
10
10
  end
11
11
 
12
12
  # standalone runner
@@ -1,18 +1,18 @@
1
1
 
2
- # Gem::Specification for Rails_pwnerer-0.6.18
2
+ # Gem::Specification for Rails_pwnerer-0.6.19
3
3
  # Originally generated by Echoe
4
4
 
5
5
  --- !ruby/object:Gem::Specification
6
6
  name: rails_pwnerer
7
7
  version: !ruby/object:Gem::Version
8
- version: 0.6.18
8
+ version: 0.6.19
9
9
  platform: ruby
10
10
  authors:
11
11
  - Victor Costan
12
12
  autorequire:
13
13
  bindir: bin
14
14
 
15
- date: 2008-10-13 00:00:00 -04:00
15
+ date: 2008-10-18 00:00:00 -04:00
16
16
  default_executable: bin/rpwn
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
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.18
4
+ version: 0.6.19
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: 2008-10-13 00:00:00 -04:00
12
+ date: 2008-10-18 00:00:00 -04:00
13
13
  default_executable: bin/rpwn
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency