Skip to content

Commit

Permalink
Make the install task Windows friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
jherdman committed Jul 31, 2008
1 parent 2e54de4 commit 884a80f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/thor/tasks.rb
Expand Up @@ -13,10 +13,12 @@ def self.package_task(spec)

def self.install_task(spec)
package_task spec

null_file = RUBY_PLATFORM =~ /w(in)?32$/ ? "NUL" : "/dev/null"

desc "install", "install the gem"
define_method :install do
old_stderr, $stderr = $stderr.dup, File.open("/dev/null", "w")
old_stderr, $stderr = $stderr.dup, File.open(null_file, "w")
package
$stderr = old_stderr
system %{sudo gem install pkg/#{spec.name}-#{spec.version} --no-rdoc --no-ri --no-update-sources}
Expand Down

0 comments on commit 884a80f

Please sign in to comment.