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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nwmls_client/listing.rb +12 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d80aab3e6dc9b3a4d76ec2c0f2cd464f817d708
4
- data.tar.gz: 5ee85cf4427a9f905dbc6578db2fa1a5158722e5
3
+ metadata.gz: 63359f21c1270feade883fbd225ff5803a60c119
4
+ data.tar.gz: 071304d090997796108886f965b6a4e826c9e3b1
5
5
  SHA512:
6
- metadata.gz: b624fe359b2023ce7eec5be850072d3e098031586379223cb58f5727ba2b7711c9c59fab4bad760621162afb27c7e0bf979ea902d626034f273f4c43f39c1d7c
7
- data.tar.gz: 34eb7b99c4cc42cda44abbd0331a81a274492bd8d005dd8868b5ffb3d38d5bd362428a55bc42dfa3b6f7da67d9764267c469fc12cae8e598596c3e09e1699f3b
6
+ metadata.gz: 8afe3aea9407b54c69758279c15e308cb7affcadf633ab98defe0344a76391e3a5fcdfbd1161932c4d236ba430df02f79d9ddaf4795d5d476be13e93ef75329d
7
+ data.tar.gz: 91e2f0357817bef38cec41cdabc833ecbfab0b8bbd7e309ef2e8065aff25f68e1c83702c072f083085996998484f764ea5f5e546f6205ab4ab7319606e339359
@@ -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 = "amenity.yml"
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
- begin
74
- amenity = YAML.load(File.open(AMENITY_FILE))
75
- rescue ArgumentError => e
76
- puts "Could not parse YAML: #{e.message}"
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nwmls_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - TJ Flynn