rails_pwnerer 0.6.101 → 0.6.102
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -0
- data/README +2 -2
- data/ext/rpwn_setup_notice/extconf.rb +3 -2
- data/lib/rails_pwnerer/app/assets.rb +0 -0
- data/lib/rails_pwnerer/base/dirs.rb +1 -1
- data/lib/rails_pwnerer/base/packages.rb +18 -5
- data/rails_pwnerer.gemspec +17 -17
- data/test/base_package_test.rb +2 -2
- metadata +5 -5
data/CHANGELOG
CHANGED
data/README
CHANGED
@@ -26,10 +26,10 @@ application.
|
|
26
26
|
Life with +rails_pwnerer+:
|
27
27
|
|
28
28
|
1) Install a bootstrap version of ruby and rubygems (yes the order is correct):
|
29
|
-
sudo apt-get -y install
|
29
|
+
sudo apt-get -y install ruby1.9.1
|
30
30
|
|
31
31
|
2) Install +rails_pwnerer+:
|
32
|
-
sudo gem install rails_pwnerer
|
32
|
+
sudo gem install rails_pwnerer make
|
33
33
|
(if it says gem not found, retry a couple of times)
|
34
34
|
|
35
35
|
3) Get your server production-ready:
|
@@ -32,9 +32,10 @@ base_path = File.expand_path "../../..", __FILE__
|
|
32
32
|
openup base_path
|
33
33
|
|
34
34
|
# We really shouldn't be abusing rubygems' root. Then again, the Debian
|
35
|
-
#
|
35
|
+
# maintainers shouldn't be abusing the patience of Ruby developers.
|
36
36
|
|
37
|
-
# Now trick rubygems and echoe into
|
37
|
+
# Now trick rubygems and echoe into believing that a gem got installed and
|
38
|
+
# everything is good.
|
38
39
|
ext_binary = 'rpwn_setup_notice' + (Gem.win_platform? ? '.dll' : '.so')
|
39
40
|
File.open(ext_binary, 'w') { |f| }
|
40
41
|
File.open('Makefile', 'w') do |f|
|
File without changes
|
@@ -200,9 +200,19 @@ module RailsPwnerer::Base
|
|
200
200
|
# Returns a hash where the keys are matching package names, and the values
|
201
201
|
# are version numbers.
|
202
202
|
def search_packages(pattern)
|
203
|
-
|
203
|
+
packages = RailsPwnerer::Base.all_packages
|
204
|
+
Hash[packages.select { |key, value|
|
204
205
|
pattern.kind_of?(Regexp) ? (pattern =~ key) : key.index(pattern)
|
205
|
-
}.
|
206
|
+
}.map { |key, value|
|
207
|
+
# apt-cache search sometimes leaves version numbers out
|
208
|
+
# Update the cache with version numbers.
|
209
|
+
if value.nil?
|
210
|
+
info = RailsPwnerer::Base.package_info_hash(
|
211
|
+
Kernel.`("apt-cache show #{key}"))
|
212
|
+
packages[key] = value = info['Version']
|
213
|
+
end
|
214
|
+
[key, value]
|
215
|
+
}]
|
206
216
|
end
|
207
217
|
|
208
218
|
# A hash of all the packages in the system, associated with their versions.
|
@@ -217,14 +227,17 @@ module RailsPwnerer::Base
|
|
217
227
|
def self.all_packages_without_caching
|
218
228
|
output = Kernel.` "apt-cache search --full ."
|
219
229
|
versions = output.split("\n\n").map(&:strip).reject(&:empty?).map { |info|
|
220
|
-
info_hash =
|
221
|
-
map { |s| s.split(': ', 2) }.
|
222
|
-
select { |kvp| kvp.length == 2 }.flatten)]
|
230
|
+
info_hash = package_info_hash info
|
223
231
|
[info_hash['Package'], info_hash['Version']]
|
224
232
|
}
|
225
233
|
Hash[*(versions.flatten)]
|
226
234
|
end
|
227
235
|
|
236
|
+
def self.package_info_hash(output)
|
237
|
+
Hash[output.split(/\n(?=\w)/m).map { |s| s.split(': ', 2) }.
|
238
|
+
select { |kvp| kvp.length == 2 }]
|
239
|
+
end
|
240
|
+
|
228
241
|
# Upgrades a package to the latest version.
|
229
242
|
def upgrade_package(package_name, options = {})
|
230
243
|
return install_package(package_name, options) if options[:source]
|
data/rails_pwnerer.gemspec
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
|
-
s.name =
|
5
|
-
s.version = "0.6.
|
4
|
+
s.name = "rails_pwnerer"
|
5
|
+
s.version = "0.6.102"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = [
|
9
|
-
s.date =
|
10
|
-
s.description =
|
11
|
-
s.email =
|
12
|
-
s.executables = [
|
13
|
-
s.extensions = [
|
14
|
-
s.extra_rdoc_files = [
|
15
|
-
s.files = [
|
16
|
-
s.homepage =
|
17
|
-
s.rdoc_options = [
|
18
|
-
s.require_paths = [
|
19
|
-
s.rubyforge_project =
|
20
|
-
s.rubygems_version =
|
21
|
-
s.summary =
|
22
|
-
s.test_files = [
|
8
|
+
s.authors = ["Victor Costan"]
|
9
|
+
s.date = "2011-10-12"
|
10
|
+
s.description = "Rails deployment hack."
|
11
|
+
s.email = "victor@costan.us"
|
12
|
+
s.executables = ["rpwn", "rpwnctl", "rpwndev"]
|
13
|
+
s.extensions = ["ext/rpwn_setup_notice/extconf.rb"]
|
14
|
+
s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README", "bin/rpwn", "bin/rpwnctl", "bin/rpwndev", "ext/rpwn_setup_notice/extconf.rb", "lib/rails_pwnerer.rb", "lib/rails_pwnerer/app/assets.rb", "lib/rails_pwnerer/app/cluster_config.rb", "lib/rails_pwnerer/app/config.rb", "lib/rails_pwnerer/app/db/mysql.rb", "lib/rails_pwnerer/app/files.rb", "lib/rails_pwnerer/app/gems.rb", "lib/rails_pwnerer/app/main.rb", "lib/rails_pwnerer/app/nginx_config.rb", "lib/rails_pwnerer/app/scripts.rb", "lib/rails_pwnerer/app/vcs/git.rb", "lib/rails_pwnerer/app/vcs/perforce.rb", "lib/rails_pwnerer/app/vcs/svn.rb", "lib/rails_pwnerer/base.rb", "lib/rails_pwnerer/base/atomics.rb", "lib/rails_pwnerer/base/cpus.rb", "lib/rails_pwnerer/base/dirs.rb", "lib/rails_pwnerer/base/gems.rb", "lib/rails_pwnerer/base/hostname.rb", "lib/rails_pwnerer/base/input.rb", "lib/rails_pwnerer/base/packages.rb", "lib/rails_pwnerer/base/process.rb", "lib/rails_pwnerer/base/rails.rb", "lib/rails_pwnerer/base/startup.rb", "lib/rails_pwnerer/config/app.rb", "lib/rails_pwnerer/config/frontends.rb", "lib/rails_pwnerer/config/main.rb", "lib/rails_pwnerer/config/paths.rb", "lib/rails_pwnerer/config/ports.rb", "lib/rails_pwnerer/config/repository.rb", "lib/rails_pwnerer/ctl_executor.rb", "lib/rails_pwnerer/dev_executor.rb", "lib/rails_pwnerer/executor.rb", "lib/rails_pwnerer/scaffolds/config.rb", "lib/rails_pwnerer/scaffolds/dir_permissions.rb", "lib/rails_pwnerer/scaffolds/dirs.rb", "lib/rails_pwnerer/scaffolds/gems.rb", "lib/rails_pwnerer/scaffolds/hook_daemon.rb", "lib/rails_pwnerer/scaffolds/hook_dyndns.rb", "lib/rails_pwnerer/scaffolds/mysql_config.rb", "lib/rails_pwnerer/scaffolds/packages.rb", "lib/rails_pwnerer/scaffolds/rubygems.rb", "lib/rails_pwnerer/scaffolds/sshd.rb", "lib/rails_pwnerer/util/kill_process_set.rb", "lib/rails_pwnerer/util/main.rb"]
|
15
|
+
s.files = ["CHANGELOG", "LICENSE", "Manifest", "README", "RUBYFORGE", "Rakefile", "bin/rpwn", "bin/rpwnctl", "bin/rpwndev", "ext/rpwn_setup_notice/extconf.rb", "lib/rails_pwnerer.rb", "lib/rails_pwnerer/app/assets.rb", "lib/rails_pwnerer/app/cluster_config.rb", "lib/rails_pwnerer/app/config.rb", "lib/rails_pwnerer/app/db/mysql.rb", "lib/rails_pwnerer/app/files.rb", "lib/rails_pwnerer/app/gems.rb", "lib/rails_pwnerer/app/main.rb", "lib/rails_pwnerer/app/nginx_config.rb", "lib/rails_pwnerer/app/scripts.rb", "lib/rails_pwnerer/app/vcs/git.rb", "lib/rails_pwnerer/app/vcs/perforce.rb", "lib/rails_pwnerer/app/vcs/svn.rb", "lib/rails_pwnerer/base.rb", "lib/rails_pwnerer/base/atomics.rb", "lib/rails_pwnerer/base/cpus.rb", "lib/rails_pwnerer/base/dirs.rb", "lib/rails_pwnerer/base/gems.rb", "lib/rails_pwnerer/base/hostname.rb", "lib/rails_pwnerer/base/input.rb", "lib/rails_pwnerer/base/packages.rb", "lib/rails_pwnerer/base/process.rb", "lib/rails_pwnerer/base/rails.rb", "lib/rails_pwnerer/base/startup.rb", "lib/rails_pwnerer/config/app.rb", "lib/rails_pwnerer/config/frontends.rb", "lib/rails_pwnerer/config/main.rb", "lib/rails_pwnerer/config/paths.rb", "lib/rails_pwnerer/config/ports.rb", "lib/rails_pwnerer/config/repository.rb", "lib/rails_pwnerer/ctl_executor.rb", "lib/rails_pwnerer/dev_executor.rb", "lib/rails_pwnerer/executor.rb", "lib/rails_pwnerer/scaffolds/config.rb", "lib/rails_pwnerer/scaffolds/dir_permissions.rb", "lib/rails_pwnerer/scaffolds/dirs.rb", "lib/rails_pwnerer/scaffolds/gems.rb", "lib/rails_pwnerer/scaffolds/hook_daemon.rb", "lib/rails_pwnerer/scaffolds/hook_dyndns.rb", "lib/rails_pwnerer/scaffolds/mysql_config.rb", "lib/rails_pwnerer/scaffolds/packages.rb", "lib/rails_pwnerer/scaffolds/rubygems.rb", "lib/rails_pwnerer/scaffolds/sshd.rb", "lib/rails_pwnerer/util/kill_process_set.rb", "lib/rails_pwnerer/util/main.rb", "test/base_package_test.rb", "test/helper.rb", "rails_pwnerer.gemspec"]
|
16
|
+
s.homepage = "http://www.costan.us/rails_pwnage"
|
17
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Rails_pwnerer", "--main", "README"]
|
18
|
+
s.require_paths = ["lib", "ext"]
|
19
|
+
s.rubyforge_project = "rails-pwnage"
|
20
|
+
s.rubygems_version = "1.8.10"
|
21
|
+
s.summary = "Rails deployment hack."
|
22
|
+
s.test_files = ["test/base_package_test.rb"]
|
23
23
|
|
24
24
|
if s.respond_to? :specification_version then
|
25
25
|
s.specification_version = 3
|
data/test/base_package_test.rb
CHANGED
@@ -15,7 +15,7 @@ class BasePackageTest < Test::Unit::TestCase
|
|
15
15
|
def test_search_packages_with_regexp
|
16
16
|
packages = @base.search_packages /ruby.*\-dev/
|
17
17
|
assert_operator packages, :has_key?, 'ruby1.8-dev'
|
18
|
-
assert_operator packages, :has_key?, 'ruby1.9-dev'
|
18
|
+
assert_operator packages, :has_key?, 'ruby1.9.1-dev'
|
19
19
|
end
|
20
20
|
|
21
21
|
def test_best_package_matching
|
@@ -53,7 +53,7 @@ class BasePackageTest < Test::Unit::TestCase
|
|
53
53
|
"Found package that no test system should have (#{package})"
|
54
54
|
|
55
55
|
source = 'http://ppa.launchpad.net/mactel-support/ppa/ubuntu'
|
56
|
-
repos = ['
|
56
|
+
repos = ['oneiric', 'main']
|
57
57
|
@base.with_package_source(source, repos) do
|
58
58
|
assert !(@base.search_packages(package).empty?),
|
59
59
|
"with_new_package_source didn't integrate the new source"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_pwnerer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 203
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 102
|
10
|
+
version: 0.6.102
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Victor Costan
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-10-12 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: zerg_support
|
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
229
229
|
requirements: []
|
230
230
|
|
231
231
|
rubyforge_project: rails-pwnage
|
232
|
-
rubygems_version: 1.8.
|
232
|
+
rubygems_version: 1.8.10
|
233
233
|
signing_key:
|
234
234
|
specification_version: 3
|
235
235
|
summary: Rails deployment hack.
|