marc2solr 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,6 @@
1
+ 0.1.4
2
+ Add dependency on Trollop to Rakefile
3
+
1
4
  0.1.3
2
5
  ...and fixed signature for getISBNs
3
6
 
data/Rakefile CHANGED
@@ -17,7 +17,7 @@ begin
17
17
  gem.add_dependency 'threach', '>= 0.2.0'
18
18
  gem.add_dependency 'logback-simple'
19
19
  gem.add_dependency 'library_stdnums', '>=0.2.0'
20
-
20
+ gem.add_dependency 'trollop'
21
21
  gem.add_development_dependency "rspec", ">= 1.2.9"
22
22
  gem.add_development_dependency "yard", ">= 0"
23
23
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
data/bin/marc2solr CHANGED
@@ -200,9 +200,7 @@ when "index"
200
200
  reader = opts.reader(filename)
201
201
  reader.send(method, *args) do |r, i|
202
202
  Thread.current[:index] = i
203
-
204
- $LOG.debug("Indexing record with 001 {}", r['001'])
205
-
203
+
206
204
  doc = ss.doc_from_marc(r, opts[:benchmark])
207
205
 
208
206
  # Send it to solr
@@ -83,13 +83,19 @@ module MARC2Solr
83
83
  end
84
84
 
85
85
  # Extract an ISBN from the given subfields of the 020 and provide
86
- # both 10-character and 13-digit versions for each
86
+ # both 10-character and 13-digit versions for each. If they appear
87
+ # to not be ISBNs, just return the original value
87
88
 
88
89
  def self.getISBNS doc, r, codes=['a', 'z']
89
90
  rv = []
90
91
  r.find_by_tag('020').each do |f|
91
92
  f.sub_values(codes).each do |v|
92
- rv.concat StdNum::ISBN.allNormalizedValues(v)
93
+ std = StdNum::ISBN.allNormalizedValues(v)
94
+ if std.size > 0
95
+ rv.concat std
96
+ else
97
+ rv << v
98
+ end
93
99
  end
94
100
  end
95
101
  return rv
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 3
9
- version: 0.1.3
8
+ - 4
9
+ version: 0.1.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - BillDueber
@@ -100,9 +100,21 @@ dependencies:
100
100
  type: :runtime
101
101
  version_requirements: *id006
102
102
  - !ruby/object:Gem::Dependency
103
- name: rspec
103
+ name: trollop
104
104
  prerelease: false
105
105
  requirement: &id007 !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ segments:
110
+ - 0
111
+ version: "0"
112
+ type: :runtime
113
+ version_requirements: *id007
114
+ - !ruby/object:Gem::Dependency
115
+ name: rspec
116
+ prerelease: false
117
+ requirement: &id008 !ruby/object:Gem::Requirement
106
118
  requirements:
107
119
  - - ">="
108
120
  - !ruby/object:Gem::Version
@@ -112,11 +124,11 @@ dependencies:
112
124
  - 9
113
125
  version: 1.2.9
114
126
  type: :development
115
- version_requirements: *id007
127
+ version_requirements: *id008
116
128
  - !ruby/object:Gem::Dependency
117
129
  name: yard
118
130
  prerelease: false
119
- requirement: &id008 !ruby/object:Gem::Requirement
131
+ requirement: &id009 !ruby/object:Gem::Requirement
120
132
  requirements:
121
133
  - - ">="
122
134
  - !ruby/object:Gem::Version
@@ -124,7 +136,7 @@ dependencies:
124
136
  - 0
125
137
  version: "0"
126
138
  type: :development
127
- version_requirements: *id008
139
+ version_requirements: *id009
128
140
  description: Given a file of MARC records, send them to Sorl for indexing based on a set of MARCSpecs
129
141
  email: bill@dueber.com
130
142
  executables: