rails_gem_install 0.3.1 → 0.3.2

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/.document CHANGED
@@ -1,4 +1,5 @@
1
1
  README.rdoc
2
+ CHANGES.rdoc
2
3
  lib/**/*.rb
3
4
  bin/*
4
5
  features/**/*.feature
data/CHANGES.rdoc ADDED
@@ -0,0 +1,8 @@
1
+ == 0.3.2
2
+
3
+ * Fixed non-root gem install issues on FreeBSD.
4
+ * Fixed non-root gem install issues on Mac OS X.
5
+
6
+ == 0.3.1
7
+
8
+ * Initial public release.
data/Rakefile CHANGED
@@ -49,5 +49,7 @@ Rake::RDocTask.new do |rdoc|
49
49
  rdoc.rdoc_dir = 'rdoc'
50
50
  rdoc.title = "rails_gem_install #{version}"
51
51
  rdoc.rdoc_files.include('README*')
52
+ rdoc.rdoc_files.include('CHANGES*')
53
+ rdoc.rdoc_files.include('LICENSE*')
52
54
  rdoc.rdoc_files.include('lib/**/*.rb')
53
55
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
@@ -2,6 +2,12 @@
2
2
 
3
3
  ENV['RAILS_ENV'] ||= 'production'
4
4
 
5
+ # On FreeBSD platforms, if we are not running as root it all gem installs will
6
+ # fail unless we tell it to do a user install via the environment.
7
+ if (RUBY_PLATFORM) =~ /freebsd/i && (Process.euid != 0)
8
+ ENV['RB_USER_INSTALL'] ||= '1'
9
+ end
10
+
5
11
  require 'rubygems'
6
12
  require 'rails_gem_install'
7
13
 
@@ -40,6 +40,19 @@ module Rails
40
40
  # first.
41
41
  require 'rails/gem_dependency'
42
42
 
43
+ # On Mac OS X, if we are not running as root, we have to ensure that
44
+ # all the gem install commands are passed the --user-install option
45
+ # otherwise they will fail to install. We do this by monkey-patching
46
+ # the Rails::GemDependency class we're using.
47
+ if (RUBY_PLATFORM =~ /darwin/i) && (Process.euid != 0)
48
+ Rails::GemDependency.class_eval do
49
+ alias :install_command_without_user_install :install_command
50
+ def install_command
51
+ install_command_without_user_install << "--user-install"
52
+ end
53
+ end
54
+ end
55
+
43
56
  puts "[Ensuring config.gem gems are all installed]"
44
57
  config = self.new
45
58
  cmds = File.readlines("config/environment.rb")
@@ -49,6 +49,13 @@ class RailsGemInstaller
49
49
  if gemspec[:version]
50
50
  cmd << " --version '#{gemspec[:version]}'"
51
51
  end
52
+
53
+ # On Mac OS X, if we're not root we need to explicitly tell gem
54
+ # to do a user install.
55
+ if (RUBY_PLATFORM =~ /darwin/i) && (Process.euid != 0)
56
+ cmd << " --user-install"
57
+ end
58
+
52
59
  puts cmd
53
60
  system cmd
54
61
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 1
9
- version: 0.3.1
8
+ - 2
9
+ version: 0.3.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Scott W. Bradley
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-05 00:00:00 -07:00
17
+ date: 2010-07-19 00:00:00 -07:00
18
18
  default_executable: rails_gem_install
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -41,6 +41,7 @@ extra_rdoc_files:
41
41
  files:
42
42
  - .document
43
43
  - .gitignore
44
+ - CHANGES.rdoc
44
45
  - LICENSE
45
46
  - README.rdoc
46
47
  - Rakefile