rails_pwnerer 0.6.11 → 0.6.14

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,7 @@
1
+ v0.6.14. Cheating to get rpwn on the system path even on restrictive Debians.
2
+
3
+ v0.6.12. Added hooks into the database reset operation.
4
+
1
5
  v0.6.11. Added option for resetting the database.
2
6
 
3
7
  v0.6.10. Doing svn cleanup in case svn update fails.
data/Manifest CHANGED
@@ -2,6 +2,7 @@ bin/rpwn
2
2
  bin/rpwnctl
3
3
  bin/rpwndev
4
4
  CHANGELOG
5
+ ext/rpwn_setup_notice/extconf.rb
5
6
  lib/pwnage/app/cluster_config.rb
6
7
  lib/pwnage/app/config.rb
7
8
  lib/pwnage/app/database.rb
data/README CHANGED
@@ -40,8 +40,9 @@ sudo gem install rails_pwnerer
40
40
  3) Get your server production-ready:
41
41
  sudo rpwn scaffold
42
42
 
43
- If this doesn't work, you have a retarded Debian version of rubygems.
44
- Workaround:
43
+ If this doesn't work, blame your OS distribution (rubygems was prevented
44
+ from creating a wrapper for rpwn, and our cheat against common preventions failed).
45
+ Manual workaround:
45
46
 
46
47
  a) Find the path to the gems: gem environment gemdir (e.g. /var/lib/gems/1.8/gems/)
47
48
  b) run bin/rpwn from there:
@@ -152,6 +153,8 @@ The following prefixes are searched for in script/rails_pwnerer:
152
153
  * post_start - executed after the application is started
153
154
  * pre_stop - executed before the application is stopped
154
155
  * post_stop - executed after the application is stopped
156
+ * pre_reset - executed before the application's database is reset
157
+ * post_reset - executed after the application's database is reset
155
158
  * update - executed when the application is updated
156
159
  * remove - executed when the application is removed
157
160
 
data/Rakefile CHANGED
@@ -10,6 +10,10 @@ Echoe.new('rails_pwnerer') do |p|
10
10
  p.summary = 'Rails deployment tool/hack.'
11
11
  p.url = 'http://www.costan.us/rails_pwnage'
12
12
  # p.dependencies = ['rails >=2.0']
13
+ p.extensions = ['ext/rpwn_setup_notice/extconf.rb']
14
+ p.eval = proc do |p|
15
+ p.default_executable = 'bin/rpwn'
16
+ end
13
17
 
14
18
  p.need_tar_gz = true
15
19
  p.need_zip = true
@@ -0,0 +1,13 @@
1
+ # invoked when the gem is installed
2
+
3
+ # cheat to get the gem installed in the right place even on Debians
4
+ unless File.exists? '/usr/bin/rpwn'
5
+ Kernel.system "ln -s #{File.expand_path(__FILE__ + '/../../../bin/rpwn')} /usr/bin/rpwn"
6
+ end
7
+ # we really shouldn't be abusing rubygems' root; then again, the Debian maintaines shouldn't be
8
+ # abusing the patience of Ruby developers
9
+
10
+ # now trick rubygems into believeing that all is good
11
+ File.open('Makefile', 'w') { |f| f.write "all:\n\ninstall:\n\n" }
12
+ File.open('rpwn_setup_notice.so', 'w') {}
13
+ File.open('rpwn_setup_notice.dll', 'w') {}
@@ -96,7 +96,11 @@ module RailsPwnage::App
96
96
  when :db_console
97
97
  Svn.new.manage app, instance, action
98
98
  when :db_reset
99
- Database.new.manage app, instance, action
99
+ self.update_app app, instance do
100
+ Scripts.new.pre_reset app, instance
101
+ Database.new.manage app, instance, action
102
+ Scripts.new.post_reset app, instance
103
+ end
100
104
  end
101
105
  end
102
106
  end
@@ -58,6 +58,12 @@ class RailsPwnage::App::Scripts
58
58
  def post_stop(app_name, instance_name)
59
59
  run_script app_name, instance_name, 'post_stop'
60
60
  end
61
+ def pre_reset(app_name, instance_name)
62
+ run_script app_name, instance_name, 'pre_reset'
63
+ end
64
+ def post_reset(app_name, instance_name)
65
+ run_script app_name, instance_name, 'post_reset'
66
+ end
61
67
 
62
68
  def control_all(action)
63
69
  RailsPwnage::Config.all_applications.each do |ai|
@@ -66,6 +72,8 @@ class RailsPwnage::App::Scripts
66
72
  when :post_start then 'post_start'
67
73
  when :pre_stop then 'pre_stop'
68
74
  when :post_stop then 'post_stop'
75
+ when :pre_reset then 'pre_reset'
76
+ when :post_reset then 'post_reset'
69
77
  end)
70
78
  end
71
79
  end
@@ -1,11 +1,11 @@
1
1
 
2
- # Gem::Specification for Rails_pwnerer-0.6.11
2
+ # Gem::Specification for Rails_pwnerer-0.6.14
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.11
8
+ version: 0.6.14
9
9
  platform: ruby
10
10
  authors:
11
11
  - Victor Costan
@@ -13,7 +13,7 @@ autorequire:
13
13
  bindir: bin
14
14
 
15
15
  date: 2008-10-02 00:00:00 -04:00
16
- default_executable:
16
+ default_executable: bin/rpwn
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: echoe
@@ -31,13 +31,14 @@ executables:
31
31
  - rpwn
32
32
  - rpwnctl
33
33
  - rpwndev
34
- extensions: []
35
-
34
+ extensions:
35
+ - ext/rpwn_setup_notice/extconf.rb
36
36
  extra_rdoc_files:
37
37
  - bin/rpwn
38
38
  - bin/rpwnctl
39
39
  - bin/rpwndev
40
40
  - CHANGELOG
41
+ - ext/rpwn_setup_notice/extconf.rb
41
42
  - lib/pwnage/app/cluster_config.rb
42
43
  - lib/pwnage/app/config.rb
43
44
  - lib/pwnage/app/database.rb
@@ -83,6 +84,7 @@ files:
83
84
  - bin/rpwnctl
84
85
  - bin/rpwndev
85
86
  - CHANGELOG
87
+ - ext/rpwn_setup_notice/extconf.rb
86
88
  - lib/pwnage/app/cluster_config.rb
87
89
  - lib/pwnage/app/config.rb
88
90
  - lib/pwnage/app/database.rb
@@ -139,6 +141,7 @@ rdoc_options:
139
141
  - README
140
142
  require_paths:
141
143
  - lib
144
+ - ext
142
145
  required_ruby_version: !ruby/object:Gem::Requirement
143
146
  requirements:
144
147
  - - ">="
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.11
4
+ version: 0.6.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Costan
@@ -10,7 +10,7 @@ bindir: bin
10
10
  cert_chain: []
11
11
 
12
12
  date: 2008-10-02 00:00:00 -04:00
13
- default_executable:
13
+ default_executable: bin/rpwn
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: echoe
@@ -28,13 +28,14 @@ executables:
28
28
  - rpwn
29
29
  - rpwnctl
30
30
  - rpwndev
31
- extensions: []
32
-
31
+ extensions:
32
+ - ext/rpwn_setup_notice/extconf.rb
33
33
  extra_rdoc_files:
34
34
  - bin/rpwn
35
35
  - bin/rpwnctl
36
36
  - bin/rpwndev
37
37
  - CHANGELOG
38
+ - ext/rpwn_setup_notice/extconf.rb
38
39
  - lib/pwnage/app/cluster_config.rb
39
40
  - lib/pwnage/app/config.rb
40
41
  - lib/pwnage/app/database.rb
@@ -80,6 +81,7 @@ files:
80
81
  - bin/rpwnctl
81
82
  - bin/rpwndev
82
83
  - CHANGELOG
84
+ - ext/rpwn_setup_notice/extconf.rb
83
85
  - lib/pwnage/app/cluster_config.rb
84
86
  - lib/pwnage/app/config.rb
85
87
  - lib/pwnage/app/database.rb
@@ -136,6 +138,7 @@ rdoc_options:
136
138
  - README
137
139
  require_paths:
138
140
  - lib
141
+ - ext
139
142
  required_ruby_version: !ruby/object:Gem::Requirement
140
143
  requirements:
141
144
  - - ">="