-
Notifications
You must be signed in to change notification settings - Fork 21.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only require builder at startup if we need to monkey with its String#…
…to_xs demands
- Loading branch information
Showing
3 changed files
with
10 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
begin | ||
# See http://bogomips.org/fast_xs/ by Eric Wong | ||
# See http://bogomips.org/fast_xs/ by Eric Wong. | ||
# Also included with hpricot. | ||
require 'fast_xs' | ||
rescue LoadError | ||
# fast_xs extension unavailable | ||
else | ||
begin | ||
require 'builder' | ||
rescue LoadError | ||
# builder demands the first shot at defining String#to_xs | ||
end | ||
|
||
class String | ||
alias_method :original_xs, :to_xs if method_defined?(:to_xs) | ||
alias_method :to_xs, :fast_xs | ||
end | ||
rescue LoadError | ||
# fast_xs extension unavailable. | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
require 'abstract_unit' | ||
require 'builder' | ||
|
||
class HashExtTest < Test::Unit::TestCase | ||
def setup | ||
|