Changeset 707

Show
Ignore:
Timestamp:
06/20/08 13:27:24 (5 months ago)
Author:
raggi
Message:

Fixes for 1.9 support

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/raggi/ext/extconf.rb

    r706 r707  
    130130dc_flags += ["#{ENV['OPENSSL']}/include", ENV['OPENSSL']] if /linux/ =~ RUBY_PLATFORM 
    131131libs, heads = case RUBY_PLATFORM 
    132 when /mswin/    : OPENSSL_LIBS_HEADS_PLATFORMS[:mswin] 
    133 when /mingw/    : OPENSSL_LIBS_HEADS_PLATFORMS[:unix] 
    134 when /darwin/   : OPENSSL_LIBS_HEADS_PLATFORMS[:darwin] 
    135 when /openbsd/  : OPENSSL_LIBS_HEADS_PLATFORMS[:crypto_hack] 
    136 when /linux/    : OPENSSL_LIBS_HEADS_PLATFORMS[:crypto_hack] 
     132when /mswin/    ; OPENSSL_LIBS_HEADS_PLATFORMS[:mswin] 
     133when /mingw/    ; OPENSSL_LIBS_HEADS_PLATFORMS[:unix] 
     134when /darwin/   ; OPENSSL_LIBS_HEADS_PLATFORMS[:darwin] 
     135when /openbsd/  ; OPENSSL_LIBS_HEADS_PLATFORMS[:crypto_hack] 
     136when /linux/    ; OPENSSL_LIBS_HEADS_PLATFORMS[:crypto_hack] 
    137137else              OPENSSL_LIBS_HEADS_PLATFORMS[:unix] 
    138138end 
  • branches/raggi/Rakefile

    r705 r707  
    3232require 'rake/gempackagetask' 
    3333 
    34 Package = true # Build zips and tarballs? 
     34Package = false # Build zips and tarballs? 
    3535Dir.glob('tasks/*.rake').each { |r| Rake.application.add_import r } 
    3636 
  • branches/raggi/tasks/raggi_tasks.rake

    r701 r707  
    2828  abort "Err: #{__FILE__}:#{__LINE__} monkey patch windows? clobbers!" unless instance_methods.grep(/windows\?/).empty? 
    2929  abort "Err: #{__FILE__}:#{__LINE__} monkey patch sudo clobbers!" unless instance_methods.grep(/sudo/).empty? 
     30  abort "Err: #{__FILE__}:#{__LINE__} monkey patch gem_cmd clobbers!" unless instance_methods.grep(/gem_cmd/).empty? 
    3031  def windows?; RUBY_PLATFORM =~ /mswin|mingw/; end 
    31   def sudo(cmd); sh(windows? ? cmd : "sudo #{cmd}"); end 
     32  def sudo(cmd) 
     33    if windows? || (require 'etc'; Etc.getpwuid.uid == 0) 
     34      sh cmd 
     35    else 
     36      sh "sudo #{cmd}" 
     37    end 
     38  end 
     39  def gem_cmd(action, name, *args) 
     40    rb = Gem.ruby rescue nil 
     41    rb ||= (require 'rbconfig'; File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])) 
     42    sudo "#{rb} -r rubygems -e 'require %{rubygems/gem_runner}; Gem::GemRunner.new.run(%w{#{action} #{name} #{args.join(' ')}})'" 
     43  end 
    3244end 
    3345 
     
    6779  task :docs => :rdoc do 
    6880    case RUBY_PLATFORM 
    69     when /darwin/       : sh 'open rdoc/index.html' 
    70     when /mswin|mingw/  : sh 'start rdoc\index.html' 
     81    when /darwin/       ; sh 'open rdoc/index.html' 
     82    when /mswin|mingw/  ; sh 'start rdoc\index.html' 
    7183    else  
    7284      sh 'firefox rdoc/index.html' 
     
    8092end 
    8193 
     94require 'rubygems' 
     95 
    8296desc 'Install gem (and sudo if required)' 
    83 task :install => :package do sudo %{gem i pkg/#{Spec.name}-#{Spec.version}} end 
     97task :install => :package do  
     98  gem_cmd(:install, "pkg/#{Spec.name}-#{Spec.version}.gem") 
     99end 
    84100 
    85101desc 'Uninstall gem (and sudo if required)' 
    86 task :uninstall do sudo %{gem unin #{Spec.name} -v="#{Spec.version}"} end 
     102task :uninstall do 
     103  gem_cmd(:uninstall, "#{Spec.name}", "-v=#{Spec.version}") 
     104end 
    87105 
    88106# Find an scm's store directory, if we do, make a task to commit to it only