josephholsten-rets4r 1.1.15 → 1.1.16
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +2 -2
- data/lib/rets4r/client/parsers/compact_nokogiri.rb +2 -2
- data/test/compact_nokogiri_test.rb +2 -2
- data/test/loader_test.rb +1 -1
- metadata +2 -2
data/VERSION.yml
CHANGED
@@ -3,10 +3,10 @@ require 'nokogiri'
|
|
3
3
|
module RETS4R
|
4
4
|
class Client
|
5
5
|
class CompactNokogiriParser < Nokogiri::XML::SAX::Document
|
6
|
-
def parse_results(
|
6
|
+
def parse_results(io)
|
7
7
|
doc = CompactDocument.new
|
8
8
|
parser = Nokogiri::XML::SAX::Parser.new(doc)
|
9
|
-
parser.
|
9
|
+
parser.parse(io)
|
10
10
|
doc.results
|
11
11
|
end
|
12
12
|
class CompactDocument < Nokogiri::XML::SAX::Document
|
@@ -6,13 +6,13 @@ require 'rets4r'
|
|
6
6
|
class CompactNokogiriTest < Test::Unit::TestCase
|
7
7
|
def test_should_do_stuff
|
8
8
|
file = File.expand_path(File.join('test', 'data', '1.5', 'search_compact.xml'))
|
9
|
-
listings = RETS4R::Client::CompactNokogiriParser.new.parse_results(file)
|
9
|
+
listings = RETS4R::Client::CompactNokogiriParser.new.parse_results(open(file))
|
10
10
|
assert_equal({"Third"=>"Datum3", "Second"=>"Datum2", "First"=>"Datum1"}, listings[0])
|
11
11
|
assert_equal({"Third"=>"Datum6", "Second"=>"Datum5", "First"=>"Datum4"}, listings[1])
|
12
12
|
end
|
13
13
|
def test_should_handle_big_data
|
14
14
|
file = File.expand_path(File.join('test', 'data', '1.5', 'bad_compact.xml'))
|
15
|
-
listings = RETS4R::Client::CompactNokogiriParser.new.parse_results(file)
|
15
|
+
listings = RETS4R::Client::CompactNokogiriParser.new.parse_results(open(file))
|
16
16
|
assert_equal 1, listings.length
|
17
17
|
assert_equal 79, listings.first.keys.length
|
18
18
|
end
|
data/test/loader_test.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: josephholsten-rets4r
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Patterson
|
@@ -12,7 +12,7 @@ autorequire:
|
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
14
|
|
15
|
-
date: 2010-
|
15
|
+
date: 2010-02-05 00:00:00 -06:00
|
16
16
|
default_executable:
|
17
17
|
dependencies: []
|
18
18
|
|