Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e79c0ea2dff9
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 394befd193b9
Choose a head ref
  • 4 commits
  • 3 files changed
  • 1 contributor

Commits on Sep 17, 2014

  1. Update tool/sync_ruby to match the new pathname.rb scheme

    * Also run it for pathname.rb
    * [ci skip]
    eregon committed Sep 17, 2014
    Copy the full SHA
    e587973 View commit details
  2. Update documentation in tool/sync_ruby.

    * [ci skip]
    eregon committed Sep 17, 2014
    Copy the full SHA
    f6eab4c View commit details
  3. Sort paths in tool/globals_2_1_0.rb.

    * [ci skip]
    eregon committed Sep 17, 2014
    Copy the full SHA
    ec540af View commit details
  4. Refactor tool/sync_ruby a bit.

    * Perfect occasion to use abort
    * Stricter version validation
    * Splat array in locals instead of indexing
    * [ci skip]
    eregon committed Sep 17, 2014
    Copy the full SHA
    394befd View commit details
Showing with 33 additions and 38 deletions.
  1. +0 −3 lib/ruby/2.1/pathname.rb
  2. +9 −9 tool/globals_2_1_0.rb
  3. +24 −26 tool/sync_ruby
3 changes: 0 additions & 3 deletions lib/ruby/2.1/pathname.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
## Merged from jruby-ruby_2_1_0 branch, file ext/pathname/lib/pathname.rb.
## This is similar to MRI, our native part is implemented in RubyPathname.
## The rest of this file is kept identical to the MRI version.
#
# = pathname.rb
#
18 changes: 9 additions & 9 deletions tool/globals_2_1_0.rb
Original file line number Diff line number Diff line change
@@ -38,7 +38,6 @@
optparse
optparse.rb
ostruct.rb
pathname.rb
pp.rb
prettyprint.rb
prime.rb
@@ -83,17 +82,18 @@

EXT_FILES = {
'ext/bigdecimal/lib/bigdecimal' => 'bigdecimal',
'ext/dl/lib/dl.rb' => 'dl.rb',
'ext/dl/lib/dl' => 'dl',
'ext/pty/lib/expect.rb' => 'expect.rb',
'ext/nkf/lib/kconv.rb' => 'kconv.rb',
'ext/digest/lib/digest' => 'digest',
'ext/digest/lib/digest.rb' => 'digest.rb',
'ext/digest/sha2/lib/sha2.rb' => 'digest/sha2.rb',
'ext/win32/lib/win32' => 'win32',
'ext/ripper/lib/ripper.rb' => 'ripper.rb',
'ext/dl/lib/dl' => 'dl',
'ext/dl/lib/dl.rb' => 'dl.rb',
'ext/nkf/lib/kconv.rb' => 'kconv.rb',
'ext/pathname/lib/pathname.rb' => 'pathname.rb',
'ext/psych/lib/psych' => 'psych',
'ext/psych/lib/psych.rb' => 'psych.rb',
'ext/pty/lib/expect.rb' => 'expect.rb',
'ext/ripper/lib/ripper' => 'ripper',
'ext/ripper/lib/ripper.rb' => 'ripper.rb',
'ext/socket/lib/socket.rb' => 'socket.rb',
'ext/psych/lib/psych.rb' => 'psych.rb',
'ext/psych/lib/psych' => 'psych'
'ext/win32/lib/win32' => 'win32'
}
50 changes: 24 additions & 26 deletions tool/sync_ruby
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
#!/usr/bin/env jruby
# -*- coding: utf-8 -*-
# Can also be run by any compliant ruby.

# This script is for use with JRuby, to copy the (patched) stdlib and external test files from
# various locations in MRI's layout to JRuby's layout. It should be used
# against the jruby-specific fork of MRI's repository at
# github.com/jruby/ruby.
# against the jruby-specific fork of MRI's repository at github.com/jruby/ruby.
#
# This script selects the branch to use against with the version number, i.e: jruby-ruby_1_8_7 or jruby-ruby_1_9_3.
# This script selects the branch to use against with the version number, i.e: jruby-ruby_2_1_0.
#
# usage: sync_ruby <tests|stdlib|all> <version(1_8_7|1_9_3|2_0_0)> <jruby ruby fork clone> <jruby dir>
# usage: sync_ruby <tests|stdlib|all> <version(1_8_7|1_9_3|2_0_0|2_1_0)> <jruby ruby fork clone> <jruby dir>
#
# Example:
#
# The JRuby ruby fork is in ../jruby-ruby, and jruby is in the current directory.
# We want to sync both 1.8.7 standard libraries.
#
#
# Suppose the JRuby ruby fork is in ../jruby-ruby, and jruby is in the current directory.
# We want to sync the 1.8.7 standard libraries.
#
# $ jruby tool/sync_ruby stdlib 1_8_7 ../jruby-ruby .
# ~/projects/jruby ➔ jruby tool/sync_ruby stdlib 1_8_7 ../jruby-ruby .
# Already on 'jruby-ruby_1_8_7'
# cp -r ../jruby-ruby/lib/English.rb ./lib/ruby/1.8
# cp -r ../jruby-ruby/lib/Env.rb ./lib/ruby/1.8
# ...
#
# Layout mapping lives in globals_<version>.rb.

require 'fileutils'

@@ -100,35 +101,32 @@ end

if $0 == __FILE__
if ARGV.size != 4
puts "usage: sync_ruby <tests|stdlib|rubygems|all> <version(1_8_7|1_9_3)> <jruby ruby(gems) fork clone> <jruby dir>"
exit 1
abort "usage: sync_ruby <tests|stdlib|rubygems|all> <version(1_8_7|1_9_3|2_0_0|2_1_0)> <jruby ruby(gems) fork clone> <jruby dir>"
end

if !%w{tests stdlib rubygems all}.include? ARGV[0]
puts "invalid source to sync: #{ARGV[0]}"
exit 1
what, version, source, target = ARGV

if !%w{tests stdlib rubygems all}.include? what
abort "invalid source to sync: #{what}"
end

if !(ARGV[1] =~ /\d+_\d+_\d+/)
puts "invalid version number: #{ARGV[1]}"
exit 1
if !(version =~ /^\d_\d_\d$/)
abort "invalid version number: #{version}"
end

if !File.exist?(ARGV[2]) || !File.directory?(ARGV[2])
puts "invalid source dir: #{ARGV[2]}"
exit 1
if !File.exist?(source) || !File.directory?(source)
abort "invalid source dir: #{source}"
end

if !File.exist?(ARGV[3]) || !File.directory?(ARGV[2])
puts "invalid target dir: #{ARGV[2]}"
exit 1
if !File.exist?(target) || !File.directory?(target)
abort "invalid target dir: #{target}"
end

sync = Sync.new(*ARGV)
if ARGV[0] == 'all'
sync = Sync.new(what, version, source, target)
if what == 'all'
sync.sync_tests
sync.sync_stdlib
else
sync.send(:"sync_#{ARGV[0]}")
sync.send(:"sync_#{what}")
end
end