Permalink
Browse files

Passing around instances of IronRuby.Runtime.RespondToStorage is not …

…needed anymore with now that IronRuby.Runtime.RubyContext has the method RespondTo().
  • Loading branch information...
1 parent 1677894 commit 904a1506489de41ec7a8c7a739dd121a34577613 @nrk committed Jul 17, 2010
Showing with 5 additions and 8 deletions.
  1. +1 −1 src/Hpricot.cs
  2. +4 −7 src/HpricotScanner.cs
View
@@ -36,7 +36,7 @@ public static class Hpricot {
}
//NOTE: block can be null as of Hpricot 0.7, see HpricotScanner.ELE
- HpricotScanner scanner = new HpricotScanner(respondsTo, toMutableStringStorage, readIOStorage, block);
+ HpricotScanner scanner = new HpricotScanner(toMutableStringStorage, readIOStorage, block);
return scanner.Scan(source, options, elementContent as Hash);
}
View
@@ -23,7 +23,6 @@ public class HpricotScanner {
private RubyContext/*!*/ _currentContext;
private BlockParam/*!*/ _blockParam;
- private RespondToStorage/*!*/ _respondToStorage;
private ConversionStorage<MutableString> _toMutableString;
private BinaryOpStorage _readIOStorage;
@@ -977,10 +976,8 @@ public class HpricotScanner {
#region constructors
- public HpricotScanner(RespondToStorage/*!*/ respondToStorage, ConversionStorage<MutableString>/*!*/ toMutableString,
- BinaryOpStorage/*!*/ readIOStorage, BlockParam block) {
- _currentContext = respondToStorage.Context;
- _respondToStorage = respondToStorage;
+ public HpricotScanner(ConversionStorage<MutableString>/*!*/ toMutableString, BinaryOpStorage/*!*/ readIOStorage, BlockParam block) {
+ _currentContext = toMutableString.Context;
_toMutableString = toMutableString;
_readIOStorage = readIOStorage;
_blockParam = block;
@@ -1477,13 +1474,13 @@ public class HpricotScanner {
taint = _currentContext.IsObjectTainted(source);
- bool sourceRespondsToRead = Protocols.RespondTo(_respondToStorage, source, "read");
+ bool sourceRespondsToRead = _currentContext.RespondTo(source, "read");
RubyIOReadCallSite readIOCallSite = null;
if (sourceRespondsToRead) {
readIOCallSite = _readIOStorage.GetCallSite("read", 1);
}
- else if (Protocols.RespondTo(_respondToStorage, source, "to_str")) {
+ else if (_currentContext.RespondTo(source, "to_str")) {
source = Protocols.CastToString(_toMutableString, source);
}
else {

0 comments on commit 904a150

Please sign in to comment.