Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 2.0.0pre
Browse files Browse the repository at this point in the history
Conflicts:
	lib/ext/melbourne/visitor.cpp
	spec/tags/18/ruby/library/cgi/htmlextension/checkbox_group_tags.txt
	spec/tags/18/ruby/library/cgi/htmlextension/file_field_tags.txt
	spec/tags/18/ruby/library/cgi/htmlextension/img_tags.txt
	spec/tags/18/ruby/library/cgi/htmlextension/radio_group_tags.txt
	spec/tags/20/ruby/library/cgi/cookie/value_tags.txt
	spec/tags/20/ruby/library/cgi/queryextension/multipart_tags.txt
	spec/tags/20/ruby/library/set/sortedset/add_tags.txt
	spec/tags/20/ruby/library/set/sortedset/initialize_tags.txt
	vm/drivers/cli.cpp
  • Loading branch information
brixen committed Jun 16, 2011
2 parents 4a8b9a4 + 4b59fc2 commit 6c5b9a4
Show file tree
Hide file tree
Showing 107 changed files with 2,063 additions and 484 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ artifacts/
*.lo
*.o
*.rbc
.rbx
*.so
*.swp
*~
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
- Matthew Elder: { irc: mae }
- Matthias Reitinger:
- Matthijs Langenberg:
- Maximilian Lupke: { irc: malumalu }
- MenTaLguY: { irc: MenTaLguY }
- Michael Fellinger: { irc: manveru }
- Michael Klishin:
Expand Down
6 changes: 3 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ For more information about building and running Rubinius, run 'rake docs'.
To install Rubinius, use the following steps:

1. Ensure you have MRI 1.8.7+, rubygems, rake, and git installed
2. git clone git://github.com/evanphx/rubinius.git
2. git clone git://github.com/rubinius/rubinius.git
3. cd rubinius
4. ./configure --prefix=/path/to/install/dir
5. rake install
Expand All @@ -34,7 +34,7 @@ executable (bin) directory to your PATH.

Rubinius comes with RubyGems built-in. To install a gem, run the following:

rbx gem install <gem_name>
rbx -S gem install <gem_name>

After installing Rubinius, you can access the built-in documentation at any
time by running 'rbx docs'.
Expand Down Expand Up @@ -105,7 +105,7 @@ improves, overall performance of your code under Rubinius will improve.
6. Tickets

Please file tickets for bugs or problems that you encounter. The issue tracker
is: http://github.com/evanphx/rubinius/issues. Run 'rake docs' for more
is: http://github.com/rubinius/rubinius/issues. Run 'rake docs' for more
details.


Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if ENV["RUBYLIB"]
end

# Wipe out CDPATH, it interferes with building in some cases,
# see http://github.com/evanphx/rubinius/issues#issue/555
# see http://github.com/rubinius/rubinius/issues#issue/555
if ENV["CDPATH"]
ENV.delete("CDPATH")
end
Expand Down
2 changes: 1 addition & 1 deletion benchmark/bin/bm-automatic
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Commit

def benchmark
begin
execute "git clone git://github.com/evanphx/rubinius.git #{working_path}"
execute "git clone git://github.com/rubinius/rubinius.git #{working_path}"

Dir.chdir working_path
execute 'rake build'
Expand Down
62 changes: 62 additions & 0 deletions benchmark/core/date/bench_parse.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
require 'benchmark'
require 'benchmark/ips'
require 'date'

Benchmark.ips do |x|
iso_8601_date_only_locale_neutral = "2011-03-08"
iso_8601_date_only_modified = "2011-Mar-08"
rfc2822_date = "08 Mar 11"

format_c = "Fri Jan 02 2004"
format_d = "Fri, 02 Jan 2004"
format_e = "2011/03/08"

x.report "parse '#{iso_8601_date_only_locale_neutral}'" do |times|
i = 0
while i < times
Date.parse(iso_8601_date_only_locale_neutral)
i += 1
end
end

x.report "parse '#{iso_8601_date_only_modified}'" do |times|
i = 0
while i < times
Date.parse(iso_8601_date_only_modified)
i += 1
end
end

x.report "parse '#{rfc2822_date}'" do |times|
i = 0
while i < times
Date.parse(rfc2822_date)
i += 1
end
end

x.report "parse '#{format_c}'" do |times|
i = 0
while i < times
Date.parse(format_c)
i += 1
end
end

x.report "parse '#{format_d}'" do |times|
i = 0
while i < times
Date.parse(format_d)
i += 1
end
end

x.report "parse '#{format_e}'" do |times|
i = 0
while i < times
Date.parse(format_e)
i += 1
end
end

end
8 changes: 8 additions & 0 deletions benchmark/core/string/bench_split.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
x.report "mismatched delimiter" do
string.split('.')
end

x.report "matching delimiter regexp" do
string.split(/\|/)
end

x.report "mismatched delimiter regexp" do
string.split(/\./)
end

irc_str = ":irc.malkier.net UID UqdTi59atgtYoV9NUKvE7qMOwG2Fl 1 1305135275 +x UqdTi59atgtYoV9NUKvE7qMOwG2Fl UqdTi59atgtYoV9NUKvE7qMOwG2Fl 127.0.0.1 XXX :fake omg"

Expand Down
17 changes: 17 additions & 0 deletions benchmark/core/string/bench_sub.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@
end
end

x.report "gsub single character" do |times|
i = 0
while i < times
para_string.gsub(/./, 'X')
i += 1
end
end

x.report "gsub! single character" do |times|
i = 0
para_string2 = para_string.dup
while i < times
para_string2.gsub(/./, 'X')
i += 1
end
end

x.report "gsub to shorter size" do |times|
i = 0
while i < times
Expand Down
2 changes: 1 addition & 1 deletion benchmark/results/templates/rubinius.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<div id="site-subtitle">Use Ruby &#8482;</div>

<div id="site-download"><a href="http://github.com/evanphx/rubinius/tree/master"><img src="http://74.217.48.135/assets/2/down_24.png" alt="download git" /> Download with git</a></div>
<div id="site-download"><a href="http://github.com/rubinius/rubinius/tree/master"><img src="http://74.217.48.135/assets/2/down_24.png" alt="download git" /> Download with git</a></div>
</div>
</div>

Expand Down
8 changes: 4 additions & 4 deletions kernel/common/marshal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,6 @@ def construct_array
obj = []
store_unique_object obj

construct_integer.times do
obj << construct
end

if @user_class
cls = get_user_class()
if cls < Array
Expand All @@ -415,6 +411,10 @@ def construct_array
end
end

construct_integer.times do
obj << construct
end

obj
end

Expand Down
2 changes: 1 addition & 1 deletion kernel/common/process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def self.fork

# Do not use Kernel.exit. This raises a SystemExit exception, which
# will run ensure blocks. This is not what MRI does and causes bugs
# in programs. See issue http://github.com/evanphx/rubinius/issues#issue/289 for
# in programs. See issue http://github.com/rubinius/rubinius/issues#issue/289 for
# an example

Kernel.exit! status
Expand Down
41 changes: 19 additions & 22 deletions kernel/common/string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class String

attr_accessor :data
attr_accessor :num_bytes
attr_accessor :characters

alias_method :__data__, :data
alias_method :__data__=, :data=
Expand All @@ -16,7 +15,6 @@ def self.allocate
str = super()
str.__data__ = Rubinius::CharArray.new(1)
str.num_bytes = 0
str.characters = 0
str
end

Expand Down Expand Up @@ -521,7 +519,7 @@ def chomp!(sep=undefined)

# don't use modify! because it will dup the data when we don't need to.
@hash_value = nil
@num_bytes = @characters = @num_bytes - 1
@num_bytes = @num_bytes - 1
return self
end

Expand All @@ -540,7 +538,7 @@ def chomp!(sep=undefined)

# don't use modify! because it will dup the data when we don't need to.
@hash_value = nil
@num_bytes = @characters = @num_bytes - 1
@num_bytes = @num_bytes - 1
elsif sep.size == 0
size = @num_bytes
while size > 0 && @data[size-1] == ?\n
Expand All @@ -557,7 +555,7 @@ def chomp!(sep=undefined)

# don't use modify! because it will dup the data when we don't need to.
@hash_value = nil
@num_bytes = @characters = size
@num_bytes = size
else
size = sep.size
return if size > @num_bytes || sep.compare_substring(self, -size, size) != 0
Expand All @@ -566,7 +564,7 @@ def chomp!(sep=undefined)

# don't use modify! because it will dup the data when we don't need to.
@hash_value = nil
@num_bytes = @characters = @num_bytes - size
@num_bytes = @num_bytes - size
end

return self
Expand Down Expand Up @@ -598,9 +596,9 @@ def chop!

if @num_bytes > 1 and @data[@num_bytes-1] == ?\n \
and @data[@num_bytes-2] == ?\r
@num_bytes = @characters = @num_bytes - 2
@num_bytes = @num_bytes - 2
else
@num_bytes = @characters = @num_bytes - 1
@num_bytes = @num_bytes - 1
end

self
Expand Down Expand Up @@ -964,7 +962,7 @@ def gsub(pattern, replacement=undefined)
raise RuntimeError, "string modified"
end
else
ret.append replacement.to_sub_replacement(match)
replacement.to_sub_replacement(ret, match)
end

tainted ||= val.tainted?
Expand Down Expand Up @@ -1045,7 +1043,7 @@ def gsub!(pattern, replacement=undefined)

raise RuntimeError, "string modified" unless @num_bytes == orig_len
else
ret.append replacement.to_sub_replacement(match)
replacement.to_sub_replacement(ret, match)
end

tainted ||= val.tainted?
Expand Down Expand Up @@ -1259,7 +1257,7 @@ def lstrip!
return if start == 0

modify!
@num_bytes = @characters = @num_bytes - start
@num_bytes = @num_bytes - start
@data.move_bytes start, @num_bytes, 0
self
end
Expand Down Expand Up @@ -1313,7 +1311,6 @@ def replace(other)
other.shared!
@data = other.__data__
@num_bytes = other.num_bytes
@characters = other.characters
@hash_value = nil

taint if other.tainted?
Expand Down Expand Up @@ -1407,7 +1404,7 @@ def rindex(sub, finish=undefined)
# "hello".partition("x") #=> ["hello", "", ""]
#
def partition(pattern=nil)
return super() if block_given?
return super() if pattern == nil && block_given?

if pattern.kind_of? Regexp
if m = pattern.match(self)
Expand Down Expand Up @@ -1510,7 +1507,7 @@ def rstrip!
return if (stop += 1) == @num_bytes

modify!
@num_bytes = @characters = stop
@num_bytes = stop
self
end

Expand Down Expand Up @@ -1927,15 +1924,16 @@ def sub(pattern, replacement=undefined)
if replacement.equal?(undefined)
replacement = yield(match[0].dup).to_s
out.taint if replacement.tainted?
out << replacement << match.post_match
else
out.taint if replacement.tainted?
replacement = StringValue(replacement).to_sub_replacement(match)
StringValue(replacement).to_sub_replacement(out, match)
out << match.post_match
end

# We have to reset it again to match the specs
Regexp.last_match = match

out << replacement << match.post_match
out.taint if self.tainted?
else
out = self
Expand Down Expand Up @@ -1975,15 +1973,16 @@ def sub!(pattern, replacement=undefined)
if replacement.equal?(undefined)
replacement = yield(match[0].dup).to_s
out.taint if replacement.tainted?
out << replacement << match.post_match
else
out.taint if replacement.tainted?
replacement = StringValue(replacement).to_sub_replacement(match)
replacement = StringValue(replacement).to_sub_replacement(out, match)
out << match.post_match
end

# We have to reset it again to match the specs
Regexp.last_match = match

out << replacement << match.post_match
out.taint if self.tainted?
else
out = self
Expand Down Expand Up @@ -2318,9 +2317,8 @@ def tr_trans(source, replacement, squeeze)
return modified ? self : nil
end

def to_sub_replacement(match)
def to_sub_replacement(result, match)
index = 0
result = ""
while index < @num_bytes
current = index
while current < @num_bytes && @data[current] != ?\\
Expand Down Expand Up @@ -2356,7 +2354,6 @@ def to_sub_replacement(match)
end
index += 1
end
return result
end

def to_inum(base, check)
Expand Down Expand Up @@ -2561,7 +2558,7 @@ def suffix?(other)
def shorten!(size)
self.modify!
return if @num_bytes == 0
@num_bytes = @characters = @num_bytes - size
@num_bytes = @num_bytes - size
end

def dump
Expand Down
2 changes: 1 addition & 1 deletion kernel/platform/library.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def ffi_lib(*names)

# If .new worked, then lib is set and we can use it.
unless lib
raise LoadError, "Unable to find libary among: #{x.inspect}"
raise LoadError, "Unable to find library among: #{x.inspect}"
end

lib
Expand Down
Loading

0 comments on commit 6c5b9a4

Please sign in to comment.