nwmls_client 1.0.4 → 1.0.5
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.
- checksums.yaml +4 -4
- data/lib/nwmls_client/listing.rb +12 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63359f21c1270feade883fbd225ff5803a60c119
|
4
|
+
data.tar.gz: 071304d090997796108886f965b6a4e826c9e3b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8afe3aea9407b54c69758279c15e308cb7affcadf633ab98defe0344a76391e3a5fcdfbd1161932c4d236ba430df02f79d9ddaf4795d5d476be13e93ef75329d
|
7
|
+
data.tar.gz: 91e2f0357817bef38cec41cdabc833ecbfab0b8bbd7e309ef2e8065aff25f68e1c83702c072f083085996998484f764ea5f5e546f6205ab4ab7319606e339359
|
data/lib/nwmls_client/listing.rb
CHANGED
@@ -12,7 +12,7 @@ module NwmlsClient
|
|
12
12
|
MLS = 'NWMLS'
|
13
13
|
DEFAULT_PTYP = 'RESI'
|
14
14
|
IMAGE_SCHEMA = 'NWMLS:EverNet:ImageData:1.0'
|
15
|
-
AMENITY_FILE =
|
15
|
+
AMENITY_FILE = 'amenity.yml'
|
16
16
|
|
17
17
|
attr_accessor :criteria
|
18
18
|
attr_accessor :schema_name
|
@@ -70,10 +70,17 @@ module NwmlsClient
|
|
70
70
|
return
|
71
71
|
end
|
72
72
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
73
|
+
amenity_file = File.join(File.dirname(__FILE__), AMENITY_FILE)
|
74
|
+
if not File.exist?(amenity_file)
|
75
|
+
puts "Required file not found: #{amenity_file}"
|
76
|
+
return
|
77
|
+
end
|
78
|
+
|
79
|
+
begin
|
80
|
+
amenity = YAML.load_file(amenity_file)
|
81
|
+
rescue Exception
|
82
|
+
puts "Failed to load file (#{AMENITY_FILE}): #{$!}"
|
83
|
+
return
|
77
84
|
end
|
78
85
|
|
79
86
|
# TODO: Is there a way to load the listing data and replace both
|