rails_pwnerer 0.6.101 → 0.6.102

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.102. Workaround for buggy apt-cache search output.
2
+
1
3
  v0.6.101. Install MRI 1.9.2+ instead of 1.8.7+ when available.
2
4
 
3
5
  v0.6.100. Nginx configuration for Rails 3.1 asset pipeline.
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 rubygems ruby
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
- # maintaines shouldn't be abusing the patience of Ruby developers.
35
+ # maintainers shouldn't be abusing the patience of Ruby developers.
36
36
 
37
- # Now trick rubygems and echoe into believeing that a gem got installed is good.
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
@@ -32,7 +32,7 @@ module RailsPwnerer::Base
32
32
  # executes a block in a temporary directory
33
33
  def with_temp_dir(options = {})
34
34
  base_dir = if options[:root]
35
- File.exists?('/tmp') ? '/tmp' : '/'
35
+ File.exists?('/tmp') ? '/tmp/' : '/'
36
36
  else
37
37
  './'
38
38
  end
@@ -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
- Hash[*(RailsPwnerer::Base.all_packages.select { |key, value|
203
+ packages = RailsPwnerer::Base.all_packages
204
+ Hash[packages.select { |key, value|
204
205
  pattern.kind_of?(Regexp) ? (pattern =~ key) : key.index(pattern)
205
- }.flatten)]
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 = Hash[*(info.split(/\n(?=\w)/).
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]
@@ -1,25 +1,25 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  Gem::Specification.new do |s|
4
- s.name = %q{rails_pwnerer}
5
- s.version = "0.6.101"
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 = [%q{Victor Costan}]
9
- s.date = %q{2011-09-08}
10
- s.description = %q{Rails deployment hack.}
11
- s.email = %q{victor@costan.us}
12
- s.executables = [%q{rpwn}, %q{rpwnctl}, %q{rpwndev}]
13
- s.extensions = [%q{ext/rpwn_setup_notice/extconf.rb}]
14
- s.extra_rdoc_files = [%q{CHANGELOG}, %q{LICENSE}, %q{README}, %q{bin/rpwn}, %q{bin/rpwnctl}, %q{bin/rpwndev}, %q{ext/rpwn_setup_notice/extconf.rb}, %q{lib/rails_pwnerer.rb}, %q{lib/rails_pwnerer/app/assets.rb}, %q{lib/rails_pwnerer/app/cluster_config.rb}, %q{lib/rails_pwnerer/app/config.rb}, %q{lib/rails_pwnerer/app/db/mysql.rb}, %q{lib/rails_pwnerer/app/files.rb}, %q{lib/rails_pwnerer/app/gems.rb}, %q{lib/rails_pwnerer/app/main.rb}, %q{lib/rails_pwnerer/app/nginx_config.rb}, %q{lib/rails_pwnerer/app/scripts.rb}, %q{lib/rails_pwnerer/app/vcs/git.rb}, %q{lib/rails_pwnerer/app/vcs/perforce.rb}, %q{lib/rails_pwnerer/app/vcs/svn.rb}, %q{lib/rails_pwnerer/base.rb}, %q{lib/rails_pwnerer/base/atomics.rb}, %q{lib/rails_pwnerer/base/cpus.rb}, %q{lib/rails_pwnerer/base/dirs.rb}, %q{lib/rails_pwnerer/base/gems.rb}, %q{lib/rails_pwnerer/base/hostname.rb}, %q{lib/rails_pwnerer/base/input.rb}, %q{lib/rails_pwnerer/base/packages.rb}, %q{lib/rails_pwnerer/base/process.rb}, %q{lib/rails_pwnerer/base/rails.rb}, %q{lib/rails_pwnerer/base/startup.rb}, %q{lib/rails_pwnerer/config/app.rb}, %q{lib/rails_pwnerer/config/frontends.rb}, %q{lib/rails_pwnerer/config/main.rb}, %q{lib/rails_pwnerer/config/paths.rb}, %q{lib/rails_pwnerer/config/ports.rb}, %q{lib/rails_pwnerer/config/repository.rb}, %q{lib/rails_pwnerer/ctl_executor.rb}, %q{lib/rails_pwnerer/dev_executor.rb}, %q{lib/rails_pwnerer/executor.rb}, %q{lib/rails_pwnerer/scaffolds/config.rb}, %q{lib/rails_pwnerer/scaffolds/dir_permissions.rb}, %q{lib/rails_pwnerer/scaffolds/dirs.rb}, %q{lib/rails_pwnerer/scaffolds/gems.rb}, %q{lib/rails_pwnerer/scaffolds/hook_daemon.rb}, %q{lib/rails_pwnerer/scaffolds/hook_dyndns.rb}, %q{lib/rails_pwnerer/scaffolds/mysql_config.rb}, %q{lib/rails_pwnerer/scaffolds/packages.rb}, %q{lib/rails_pwnerer/scaffolds/rubygems.rb}, %q{lib/rails_pwnerer/scaffolds/sshd.rb}, %q{lib/rails_pwnerer/util/kill_process_set.rb}, %q{lib/rails_pwnerer/util/main.rb}]
15
- s.files = [%q{CHANGELOG}, %q{LICENSE}, %q{Manifest}, %q{README}, %q{RUBYFORGE}, %q{Rakefile}, %q{bin/rpwn}, %q{bin/rpwnctl}, %q{bin/rpwndev}, %q{ext/rpwn_setup_notice/extconf.rb}, %q{lib/rails_pwnerer.rb}, %q{lib/rails_pwnerer/app/assets.rb}, %q{lib/rails_pwnerer/app/cluster_config.rb}, %q{lib/rails_pwnerer/app/config.rb}, %q{lib/rails_pwnerer/app/db/mysql.rb}, %q{lib/rails_pwnerer/app/files.rb}, %q{lib/rails_pwnerer/app/gems.rb}, %q{lib/rails_pwnerer/app/main.rb}, %q{lib/rails_pwnerer/app/nginx_config.rb}, %q{lib/rails_pwnerer/app/scripts.rb}, %q{lib/rails_pwnerer/app/vcs/git.rb}, %q{lib/rails_pwnerer/app/vcs/perforce.rb}, %q{lib/rails_pwnerer/app/vcs/svn.rb}, %q{lib/rails_pwnerer/base.rb}, %q{lib/rails_pwnerer/base/atomics.rb}, %q{lib/rails_pwnerer/base/cpus.rb}, %q{lib/rails_pwnerer/base/dirs.rb}, %q{lib/rails_pwnerer/base/gems.rb}, %q{lib/rails_pwnerer/base/hostname.rb}, %q{lib/rails_pwnerer/base/input.rb}, %q{lib/rails_pwnerer/base/packages.rb}, %q{lib/rails_pwnerer/base/process.rb}, %q{lib/rails_pwnerer/base/rails.rb}, %q{lib/rails_pwnerer/base/startup.rb}, %q{lib/rails_pwnerer/config/app.rb}, %q{lib/rails_pwnerer/config/frontends.rb}, %q{lib/rails_pwnerer/config/main.rb}, %q{lib/rails_pwnerer/config/paths.rb}, %q{lib/rails_pwnerer/config/ports.rb}, %q{lib/rails_pwnerer/config/repository.rb}, %q{lib/rails_pwnerer/ctl_executor.rb}, %q{lib/rails_pwnerer/dev_executor.rb}, %q{lib/rails_pwnerer/executor.rb}, %q{lib/rails_pwnerer/scaffolds/config.rb}, %q{lib/rails_pwnerer/scaffolds/dir_permissions.rb}, %q{lib/rails_pwnerer/scaffolds/dirs.rb}, %q{lib/rails_pwnerer/scaffolds/gems.rb}, %q{lib/rails_pwnerer/scaffolds/hook_daemon.rb}, %q{lib/rails_pwnerer/scaffolds/hook_dyndns.rb}, %q{lib/rails_pwnerer/scaffolds/mysql_config.rb}, %q{lib/rails_pwnerer/scaffolds/packages.rb}, %q{lib/rails_pwnerer/scaffolds/rubygems.rb}, %q{lib/rails_pwnerer/scaffolds/sshd.rb}, %q{lib/rails_pwnerer/util/kill_process_set.rb}, %q{lib/rails_pwnerer/util/main.rb}, %q{test/base_package_test.rb}, %q{test/helper.rb}, %q{rails_pwnerer.gemspec}]
16
- s.homepage = %q{http://www.costan.us/rails_pwnage}
17
- s.rdoc_options = [%q{--line-numbers}, %q{--inline-source}, %q{--title}, %q{Rails_pwnerer}, %q{--main}, %q{README}]
18
- s.require_paths = [%q{lib}, %q{ext}]
19
- s.rubyforge_project = %q{rails-pwnage}
20
- s.rubygems_version = %q{1.8.8}
21
- s.summary = %q{Rails deployment hack.}
22
- s.test_files = [%q{test/base_package_test.rb}]
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
@@ -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 = ['lucid', 'main']
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: 205
4
+ hash: 203
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 101
10
- version: 0.6.101
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-09-08 00:00:00 Z
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.8
232
+ rubygems_version: 1.8.10
233
233
  signing_key:
234
234
  specification_version: 3
235
235
  summary: Rails deployment hack.