diff RubyGems v1.4.2 vs MacRuby's
diff -r rubygems-v1.4.2/lib/rubygems/commands/update_command.rb macruby/lib/rubygems/commands/update_command.rb
50a51,53
> # XXX MACRUBY We can't allow people to self-update RubyGems at this point.
> raise "This version of RubyGems cannot be self-updated."
>
Only in macruby/lib/rubygems: defaults
diff -r rubygems-v1.4.2/lib/rubygems/installer.rb macruby/lib/rubygems/installer.rb
325,327c325,359
< FileUtils.rm_f bin_script_path # prior install may have been --no-wrappers
<
< File.open bin_script_path, 'w', 0755 do |file|
---
> # XXX MACRUBY do not allow executables to be overriden by a different
> # Ruby implementation
> #FileUtils.rm_f bin_script_path # prior install may have been --no-wrappers
>
> #File.open bin_script_path, 'w', 0755 do |file|
> bin_script_exists = File.exists?(bin_script_path)
> mode = 'w' unless(bin_script_exists)
> mode ||= 'r+'
> new_shebang = shebang(filename)
> File.open bin_script_path, mode, 0755 do |file|
> if bin_script_exists
> # If the first line is different than the shebang we want to insert
> # we are probably overwriting a script installed by another ruby
> # implementation / version
> begin
> old_shebang = file.readline.chomp
> rescue
> old_shebang = ""
> end
>
> if old_shebang != new_shebang
> warn = <<-WARN_MESSAGE
> You are installing a new version of #{bin_script_path}.
> This file already exists with a different shebang, possibly from a different
> ruby implementation or version. This operation may break the script.
> WARN_MESSAGE
> alert_warning(warn)
> if !@force && !ask_yes_no("Do you still wish to continue?")
> raise Gem::InstallError, "Could not write #{bin_script_path}"
> end
> say "Overwrote #{bin_script_path}" if Gem.configuration.really_verbose
> end
> file.seek(0)
> file.truncate(0)
> end
diff -r rubygems-v1.4.2/lib/rubygems/package/tar_input.rb macruby/lib/rubygems/package/tar_input.rb
206c206,207
< if defined? Rubinius or defined? Maglev then
---
> # XXX MACRUBY we also enter the first condition
> if true#defined? Rubinius or defined? Maglev then
207a209
> require 'stringio'
diff -r rubygems-v1.4.2/lib/rubygems/package/tar_writer.rb macruby/lib/rubygems/package/tar_writer.rb
42a43,45
> # XXX MACRUBY mainly because our File.open won't honor 'b'.
> data = data.force_encoding('BINARY')
>
diff -r rubygems-v1.4.2/lib/rubygems/platform.rb macruby/lib/rubygems/platform.rb
68a69
> when /^macruby$/ then [ 'macruby', nil ]
diff -r rubygems-v1.4.2/lib/rubygems/remote_fetcher.rb macruby/lib/rubygems/remote_fetcher.rb
269a270,283
> # XXX MACRUBY a much faster / more stable downloader code path, using
> # Foundation instead of Net::HTTP
> framework 'Foundation'
> say "Fetching #{uri.to_s}" if Gem.configuration.really_verbose
> url = NSURL.URLWithString(uri.to_s)
> data = NSMutableData.dataWithContentsOfURL(url)
> if data.nil?
> raise Gem::RemoteFetcher::FetchError.new('error when fetching data', uri)
> end
> say "OK" if Gem.configuration.really_verbose
> data = String.new(data)
> data.force_encoding(Encoding::BINARY)
> return data
>
diff -r rubygems-v1.4.2/lib/rubygems/server.rb macruby/lib/rubygems/server.rb
571c571,572
< dep = Gem::Dependency.new $2, $3
---
> marshal_format, name, version, platform = $1, $2, $3, $4
> dep = Gem::Dependency.new name, version
573d573
< marshal_format = $1
575c575
< selector = [$2, $3, $4].map { |s| s.inspect }.join ' '
---
> selector = [name, version, platform].map { |s| s.inspect }.join ' '
577,578c577,578
< platform = if $4 then
< Gem::Platform.new $4.sub(/^-/, '')
---
> platform = if platform then
> Gem::Platform.new platform.sub(/^-/, '')
diff -r rubygems-v1.4.2/lib/rubygems/specification.rb macruby/lib/rubygems/specification.rb
725c725,727
< YAML.quick_emit object_id, opts do |out|
---
> # XXX MACRUBY our quick_emit is different than syck
> #YAML.quick_emit object_id, opts do |out|
> YAML.quick_emit nil do |out|