marc2solr 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -16,6 +16,7 @@ begin
16
16
  gem.add_dependency 'marcspec', '>= 1.6.3'
17
17
  gem.add_dependency 'threach', '>= 0.2.0'
18
18
  gem.add_dependency 'logback-simple'
19
+ gem.add_dependency 'library_stdnums', '>=0.2.0'
19
20
 
20
21
  gem.add_development_dependency "rspec", ">= 1.2.9"
21
22
  gem.add_development_dependency "yard", ">= 0"
@@ -1,5 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'logback-simple'
3
+ require 'library_stdnums'
3
4
 
4
5
  module MARC2Solr
5
6
  module Custom
@@ -81,6 +82,18 @@ module MARC2Solr
81
82
  return data
82
83
  end
83
84
 
85
+ # Extract an ISBN from the given subfields of the 020 and provide
86
+ # both 10-character and 13-digit versions for each
87
+
88
+ def self.getISBNS codes=['a', 'z']
89
+ rv = []
90
+ r.find_by_tag('020').each do |f|
91
+ f.sub_values(codes).each do |v|
92
+ rv.concat StdNum::ISBN.allNormalizedValues(v)
93
+ end
94
+ end
95
+ return rv
96
+ end
84
97
 
85
98
  # An example of a DateOfPublication implementation
86
99
  # @param [hashlike] doc The document object being added to; allows you to leverage already-done work
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marc2solr
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - BillDueber
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-12 00:00:00 -04:00
18
+ date: 2010-10-13 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -97,9 +97,25 @@ dependencies:
97
97
  type: :runtime
98
98
  version_requirements: *id005
99
99
  - !ruby/object:Gem::Dependency
100
- name: rspec
100
+ name: library_stdnums
101
101
  prerelease: false
102
102
  requirement: &id006 !ruby/object:Gem::Requirement
103
+ none: false
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ hash: 23
108
+ segments:
109
+ - 0
110
+ - 2
111
+ - 0
112
+ version: 0.2.0
113
+ type: :runtime
114
+ version_requirements: *id006
115
+ - !ruby/object:Gem::Dependency
116
+ name: rspec
117
+ prerelease: false
118
+ requirement: &id007 !ruby/object:Gem::Requirement
103
119
  none: false
104
120
  requirements:
105
121
  - - ">="
@@ -111,11 +127,11 @@ dependencies:
111
127
  - 9
112
128
  version: 1.2.9
113
129
  type: :development
114
- version_requirements: *id006
130
+ version_requirements: *id007
115
131
  - !ruby/object:Gem::Dependency
116
132
  name: yard
117
133
  prerelease: false
118
- requirement: &id007 !ruby/object:Gem::Requirement
134
+ requirement: &id008 !ruby/object:Gem::Requirement
119
135
  none: false
120
136
  requirements:
121
137
  - - ">="
@@ -125,7 +141,7 @@ dependencies:
125
141
  - 0
126
142
  version: "0"
127
143
  type: :development
128
- version_requirements: *id007
144
+ version_requirements: *id008
129
145
  description: Given a file of MARC records, send them to Sorl for indexing based on a set of MARCSpecs
130
146
  email: bill@dueber.com
131
147
  executables: