revs-utils 2.1.3 → 2.1.4

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDRkZWEwZjdiN2ZiOTZiNDk2ODk1ZDI5NGVhMjhlMjQ1NGI0ZWJmZA==
4
+ Y2RjZDhhMzYxMmY5YjRlNDk0OGYyYzA3OTIyNjE3OTFkZGM2OTY5Mw==
5
5
  data.tar.gz: !binary |-
6
- ODVjYmExYjYyYjFhN2ExZWU5NjhlNTA2NWNjMjc5Y2U3NzljNzcxZA==
6
+ ZDRkOWQ3OGI0NWRhMGQ2NmEwM2MzOTY3YWM5M2FmZTA1ZWI1YmExOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Nzc4MTljMGViNjE2YzY4NjExYjdhNjg5MTk3YWExMGIzZjlkOTBlYzdhMmJk
10
- NmExMzM0MDNlNjEyYzRhMWVkN2I2ZmY1YzA1ZmFkNzJjNzZkZTNjNjM4Nzcy
11
- OTQzY2E1MmQzMjQyODkwYzRjNjEyYTA1N2Y0ODk0YjlkZTVjZmU=
9
+ YzYxZTczN2FiZDk0N2Y3YWM1ZGIzNDY1MWMyYWU2OTYzNmE4ZDk0MzcyYTY5
10
+ MTJlOWRmYjQxOTViMDgxZDgwZTI4OTcwMWE1MmQxYjczYjU1ZTU3MzdlN2M0
11
+ ODlhNjk4YzdmMWRkZDU3YWM5MjVkNGViZmJlYzg1ZWFlZTU3MDc=
12
12
  data.tar.gz: !binary |-
13
- OWIxZGE2YTBhZDBiODZiZmNlMWUyNDVlNDYzMWJhMjU5YzIxMTMyYTYwMmQy
14
- OWY1ZmM1YjQxMmFkMDU3N2ZlODI4ZWRlM2E1ZTFiYjBmMWExOTZmMGMxOTRl
15
- ZmM4NGY3YTVhODhlODY3YWM3OGJlZmZhMGMyZDU2NGEwMWI0OTg=
13
+ N2RhNDllNjliZjJiNjU5Y2JhMTU2YTYzYWU3MmJjOTBiZGIxMWYzMWQwZjQ3
14
+ MTIxYmQ1NmU1MWRiZGQ5ODc5NzM1YTNmYzM5ZjU0NGY2MjIyYjEwNGQ0NTBh
15
+ NGIyMDg4YjBkOWMwNjVjYzk5YWI2MTNkYzcxYmUxN2I4ZjViOGI=
data/README.rdoc CHANGED
@@ -23,7 +23,7 @@ Shared methods and functions used by revs-indexer, pre-assembly and bulk metadat
23
23
  - <b>2.0.2 and 2.0.3</b> Update valid for metadata method so it is not sensitive to blank or uppercase columns
24
24
  - <b>2.0.4</b> Fix issues with year parsing
25
25
  - <b>2.0.10</b> Update to latest version of actionpack
26
- - <b>2.1.0</b> Add field mapping and other common methods used in both revs digital library and revs-indexing
26
+ - <b>2.1.0 - 2.1.4</b> Add field mapping and other common methods used in both revs digital library and revs-indexing
27
27
 
28
28
  == Running tests
29
29
 
@@ -1,5 +1,5 @@
1
1
  module Revs
2
2
  module Utils
3
- VERSION = "2.1.3"
3
+ VERSION = "2.1.4"
4
4
  end
5
5
  end
data/lib/revs-utils.rb CHANGED
@@ -72,7 +72,7 @@ module Revs
72
72
 
73
73
  # these are used in the revs solr document in the main revs digital library rails app, as well as the revs-indexing-service app
74
74
  def revs_location(doc_hash)
75
- [doc_hash[:city_section_ssi],doc_hash[:cities_ssi],doc_hash[:states_ssi],doc_hash[:countries_ssi]].reject(&:blank?).join(', ')
75
+ [doc_hash[:city_sections_ssi],doc_hash[:cities_ssi],doc_hash[:states_ssi],doc_hash[:countries_ssi]].reject(&:blank?).join(', ')
76
76
  end
77
77
 
78
78
  # these are used in the revs solr document in the main revs digital library rails app, as well as the revs-indexing-service app
@@ -156,6 +156,13 @@ describe "Revs-Utils" do
156
156
  @revs.revs_get_state_name('IN').should == "Indiana"
157
157
  end
158
158
 
159
+ it "should parse locations" do
160
+ @revs.revs_location({:cities_ssi=>'Paris',:countries_ssi=>'France'}).should == 'Paris, France'
161
+ @revs.revs_location({:id=>'123',:title_tsi=>'Test'}).should == ''
162
+ @revs.revs_location({:city_sections_ssi=>'Rue Cool 123',:cities_ssi=>'Paris',:countries_ssi=>'France'}).should == 'Rue Cool 123, Paris, France'
163
+ @revs.revs_location({:city_sections_ssi=>'Cool Street',:cities_ssi=>'Paris',:states_ssi=>'Texas',:countries_ssi=>'USA'}).should == 'Cool Street, Paris, Texas, USA'
164
+ end
165
+
159
166
  it "should parse 1950s and 1950's correctly" do
160
167
 
161
168
  @revs.parse_years('1950s').should == ['1950','1951','1952','1953','1954','1955','1956','1957','1958','1959']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: revs-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 2.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Mangiafico