Permalink
Browse files

Don't use sudo on win32/cygwin (Kevin Williams)

  • Loading branch information...
evan committed Jan 16, 2008
1 parent 7a0912e commit 01536a7438ac8a6f6c30bae4134b413e53c173bd
Showing with 7 additions and 5 deletions.
  1. +1 −1 CHANGELOG
  2. +2 −1 TODO
  3. +4 −3 lib/echoe.rb
View
@@ -1,5 +1,5 @@
-vSVN. support compiling without extension registration for win32 and java targets.
+v2.7.7. Don't use sudo on win32/cygwin (Kevin Williams).
v2.7.6. Better Echoe.silence behavior.
View
3 TODO
@@ -1,3 +1,4 @@
-* Add a non-repository source (ENV or file) for per-project certificate chains.
+* Support compiling without extension registration for win32 and java targets.
* Figure out why need_gem = false caused releasing to fail
+* Add a non-repository source (ENV or file) for per-project per-developer certificate chains. (?)
View
@@ -144,7 +144,7 @@ class Echoe
attr_accessor :author, :changes, :clean_pattern, :description, :email, :dependencies, :need_tgz, :need_tar_gz, :need_gem, :need_zip, :rdoc_pattern, :project, :summary, :test_pattern, :url, :version, :docs_host, :rdoc_template, :manifest_name, :install_message, :extension_pattern, :private_key, :certificate_chain, :require_signed, :ruby_version, :platform, :ignore_pattern, :executable_pattern, :changelog, :rcov_options
# best left alone
- attr_accessor :name, :lib_files, :test_files, :bin_files, :spec, :rdoc_options, :rubyforge_name, :has_rdoc, :include_gemspec, :include_rakefile, :gemspec_name, :eval, :files, :changelog_patterns, :rubygems_version
+ attr_accessor :name, :lib_files, :test_files, :bin_files, :spec, :rdoc_options, :rubyforge_name, :has_rdoc, :include_gemspec, :include_rakefile, :gemspec_name, :eval, :files, :changelog_patterns, :rubygems_version, :use_sudo
# legacy
attr_accessor :extra_deps, :rdoc_files, :extensions
@@ -178,6 +178,7 @@ def initialize(name, _version = nil)
self.install_message = nil
self.executable_pattern = /^bin\//
self.has_rdoc = true
+ self.use_sudo = RUBY_PLATFORM !~ /mswin32|cygwin/
self.rcov_options = []
self.rdoc_pattern = /^(lib|bin|tasks|ext)|^README|^CHANGELOG|^TODO|^LICENSE|^COPYING$/
self.rdoc_options = ['--line-numbers', '--inline-source']
@@ -391,12 +392,12 @@ def define_tasks
desc 'Install the gem'
task :install => [:clean, :package, :uninstall] do
- system "sudo gem install pkg/*.gem -P MediumSecurity"
+ system "#{'sudo' if use_sudo} gem install pkg/*.gem -P MediumSecurity --no-update-sources"
end
desc 'Uninstall the gem'
task :uninstall do
- system "sudo gem uninstall #{name} -a -i -x"
+ system "#{'sudo' if use_sudo} gem uninstall #{name} -a -i -x"
end
desc 'Package and upload the release to Rubyforge'

0 comments on commit 01536a7

Please sign in to comment.