rails_pwnerer 0.4.14 → 0.4.15

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.4.15. Moved temporary installation dirs to / so that it works on CSAIL Debian.
2
+
1
3
  v0.4.14. Fixed bug that completely broke new box scaffolding.
2
4
 
3
5
  v0.4.12. Added application gem management (new in Rails 2.1.0 apps).
@@ -25,8 +25,8 @@ module RailsPwnage::Base
25
25
  end
26
26
 
27
27
  # executes a block in a temporary directory
28
- def with_temp_dir
29
- temp_dir = "rbpwn_#{Time.now.to_i}"
28
+ def with_temp_dir(options = {})
29
+ temp_dir = "#{options[:root] ? '/' : ''}rbpwn_#{Time.now.to_i}"
30
30
  Dir.mkdir temp_dir
31
31
  Dir.chdir(temp_dir) { yield }
32
32
  FileUtils.rm_r temp_dir
@@ -6,7 +6,7 @@ module RailsPwnage::Base
6
6
  # installs a package
7
7
  def install_package(package_name, options = {})
8
8
  if options[:source]
9
- with_temp_dir do
9
+ with_temp_dir(:root => true) do
10
10
  system "apt-get build-dep -y #{package_name}"
11
11
  system "apt-get source -b #{package_name}"
12
12
  system "dpkg -i #{Dir.glob('*.deb', File::FNM_DOTMATCH).join(' ')}"
@@ -19,6 +19,8 @@ module RailsPwnage::Base
19
19
  # upgrades a package to the latest version
20
20
  def upgrade_package(package_name, options = {})
21
21
  if options[:source]
22
+ remove_package(package_name)
23
+
22
24
  install_package(package_name, :source => true)
23
25
  else
24
26
  system "apt-get upgrade -y #{package_name.nil ? '' : package_name}"
@@ -32,11 +32,14 @@ class RailsPwnage::Scaffolds::Packages
32
32
 
33
33
  # the packages for a mysql server and development libraries
34
34
  def install_mysql
35
- install_packages %w(mysql-client mysql-server libmysqlclient15-dev), :source => true
35
+ # not installing mySQL from source because it's a pain
36
+ install_packages %w(mysql-client mysql-server libmysqlclient15-dev)
36
37
  end
37
38
 
38
39
  # the packager for _the_ load balancer (nginx, from Russia with <3)
39
40
  def install_balancer
41
+ remove_packages %w(nginx)
42
+
40
43
  install_packages %w(nginx), :source => true
41
44
  end
42
45
 
@@ -1,10 +1,10 @@
1
1
 
2
- # Gem::Specification for Rails_pwnerer-0.4.14
2
+ # Gem::Specification for Rails_pwnerer-0.4.15
3
3
  # Originally generated by Echoe
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = %q{rails_pwnerer}
7
- s.version = "0.4.14"
7
+ s.version = "0.4.15"
8
8
 
9
9
  s.specification_version = 2 if s.respond_to? :specification_version=
10
10
 
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.4.14
4
+ version: 0.4.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Costan