josephholsten-rets4r 1.1.15 → 1.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :build:
3
- :minor: 1
4
- :patch: 15
5
3
  :major: 1
4
+ :minor: 1
5
+ :patch: 16
@@ -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(file)
6
+ def parse_results(io)
7
7
  doc = CompactDocument.new
8
8
  parser = Nokogiri::XML::SAX::Parser.new(doc)
9
- parser.parse_file(file)
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
@@ -8,7 +8,7 @@ class LoaderTest < Test::Unit::TestCase
8
8
  file = File.expand_path(File.join('test', 'data', '1.5', 'search_compact.xml'))
9
9
 
10
10
  listings = []
11
- RETS4R::Loader.load(file) do |record|
11
+ RETS4R::Loader.load(open(file)) do |record|
12
12
  listings << record
13
13
  end
14
14
 
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.15
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-01-22 00:00:00 -06:00
15
+ date: 2010-02-05 00:00:00 -06:00
16
16
  default_executable:
17
17
  dependencies: []
18
18