Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 68789c9702
Fetching contributors…

Cannot retrieve contributors at this time

41 lines (35 sloc) 1.528 kb
using System;
using System.Text;
using IronRuby.Builtins;
using IronRuby.Runtime;
using Microsoft.Scripting;
using Microsoft.Scripting.Runtime;
namespace IronRuby.Libraries.Hpricot {
[RubyModule("Hpricot")]
public static class Hpricot {
[RubyMethod("scan", RubyMethodAttributes.PublicSingleton)]
public static Object Scan(ConversionStorage<MutableString>/*!*/ toMutableStringStorage, RespondToStorage/*!*/ respondsTo,
BinaryOpStorage/*!*/ readIOStorage, BlockParam/*!*/ block, RubyModule/*!*/ self, Object/*!*/ source) {
if (block == null) {
throw RubyExceptions.NoBlockGiven();
}
HpricotScanner scanner = new HpricotScanner(respondsTo, toMutableStringStorage, readIOStorage, block);
return scanner.Scan(source);
}
[RubyMethod("buffer_size", RubyMethodAttributes.PublicSingleton)]
public static Int32? GetBufferSize(RubyModule/*!*/ self) {
return HpricotScanner.BufferSize;
}
[RubyMethod("buffer_size=", RubyMethodAttributes.PublicSingleton)]
public static void SetBufferSize(RubyModule/*!*/ self, Int32 bufferSize) {
// TODO: thread safety
HpricotScanner.BufferSize = bufferSize;
}
[RubyClass("ParseError")]
public class ParserException : SystemException {
public ParserException(String message) :
base(message) {
}
}
}
}
Jump to Line
Something went wrong with that request. Please try again.