marc2solr 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/CHANGES +5 -0
  2. data/Rakefile +1 -1
  3. data/VERSION +1 -1
  4. data/bin/marc2solr +17 -8
  5. data/lib/marc2solr.rb +2 -1
  6. metadata +161 -184
data/CHANGES CHANGED
@@ -1,3 +1,8 @@
1
+ 0.1.7
2
+ Fixed use of --solrpath and --port on the command line
3
+ Check for configured index.rb (required) and tmapdir (optional; warning if
4
+ not present) for indexing
5
+
1
6
  0.1.6
2
7
  Changed to parameterized logging with jlogger 0.0.4 for faster non-logging
3
8
 
data/Rakefile CHANGED
@@ -13,7 +13,7 @@ begin
13
13
 
14
14
  gem.add_dependency 'marc4j4r', '>= 1.3.0'
15
15
  gem.add_dependency 'jruby_streaming_update_solr_server', '>=0.5.2'
16
- gem.add_dependency 'marcspec', '>= 1.6.5'
16
+ gem.add_dependency 'marcspec', '>= 1.6.6'
17
17
  gem.add_dependency 'threach', '>= 0.2.0'
18
18
  gem.add_dependency 'jlogger', '>=0.0.4'
19
19
  gem.add_dependency 'library_stdnums', '>=0.2.0'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.7
data/bin/marc2solr CHANGED
@@ -105,20 +105,29 @@ when "index"
105
105
  opts.print_command_help('index')
106
106
  end
107
107
 
108
+ # Make sure we've got an indexfile
109
+ unless opts[:indexfile]
110
+ LOG.error "Index configuration file (index.rb) is rquired."
111
+ raise ArgumentError, "Index configuraiton file (index.rb) is required"
112
+ end
108
113
 
109
114
  # Make sure everything can be opened
110
- unless File.readable? opts[:indexfile]
115
+ if File.readable? opts[:indexfile]
116
+ LOG.debug "Found index file #{opts[:indexfile]}"
117
+ else
111
118
  LOG.error "Index configuration file '#{opts[:indexfile]}' (set with --indexfile) cannot be found/read"
112
119
  raise ArgumentError, "Index configuration file '#{opts[:indexfile]}' (set with --indexfile) cannot be found/read"
113
- else
114
- LOG.debug "Found index file #{opts[:indexfile]}"
115
120
  end
116
121
 
117
- unless File.readable? opts[:tmapdir]
118
- LOG.error "Translation Map directory '#{opts[:tmapdir]}' (set with --tmapdir) cannot be found/read"
119
- raise ArgumentError, "Translation Map directory '#{opts[:tmapdir]}' (set with --tmapdir) cannot be found/read"
122
+ if opts[:tmapdir]
123
+ if File.readable? opts[:tmapdir]
124
+ LOG.debug "Found translation maps directory #{opts[:tmapdir]}"
125
+ else
126
+ LOG.error "Translation Map directory '#{opts[:tmapdir]}' (set with --tmapdir) cannot be found/read"
127
+ raise ArgumentError, "Translation Map directory '#{opts[:tmapdir]}' (set with --tmapdir) cannot be found/read"
128
+ end
120
129
  else
121
- LOG.debug "Found translation maps directory #{opts[:tmapdir]}"
130
+ LOG.warn "No translation maps defined; hope that's what you intended"
122
131
  end
123
132
 
124
133
  marcfiles.each do |filename|
@@ -161,7 +170,7 @@ when "index"
161
170
  # Create a specset
162
171
 
163
172
  ss = MARCSpec::SpecSet.new
164
- ss.loadMapsFromDir opts[:tmapdir]
173
+ ss.loadMapsFromDir opts[:tmapdir] if opts[:tmapdir]
165
174
  ss.buildSpecsFromDSLFile opts[:indexfile]
166
175
 
167
176
  # Set up if we're using threach or not
data/lib/marc2solr.rb CHANGED
@@ -81,6 +81,7 @@ module MARC2Solr
81
81
  :type => :int}],
82
82
  [:solrpath, {:desc => "URL path to solr",
83
83
  :short => '-P',
84
+ :type => String,
84
85
  }],
85
86
  [:javabin, {:desc => "Use javabin (presumes /update/bin is configured in schema.xml)",
86
87
  }],
@@ -362,7 +363,7 @@ module MARC2Solr
362
363
  raise ArgumentError, "Need solr path (--solrpath)"
363
364
  end
364
365
 
365
- url = 'http://' + machine + ':' + port + '/' + path.gsub(/^\//, '')
366
+ url = 'http://' + machine + ':' + port.to_s + '/' + path.gsub(/^\//, '')
366
367
  end
367
368
 
368
369
  def suss
metadata CHANGED
@@ -1,222 +1,199 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marc2solr
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
5
4
  prerelease: false
6
5
  segments:
7
- - 0
8
- - 1
9
- - 6
10
- version: 0.1.6
6
+ - 0
7
+ - 1
8
+ - 7
9
+ version: 0.1.7
11
10
  platform: ruby
12
11
  authors:
13
- - BillDueber
12
+ - BillDueber
14
13
  autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2010-10-15 00:00:00 -04:00
17
+ date: 2010-10-18 00:00:00 -04:00
19
18
  default_executable:
20
19
  dependencies:
21
- - !ruby/object:Gem::Dependency
22
- name: marc4j4r
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 27
30
- segments:
31
- - 1
32
- - 3
33
- - 0
34
- version: 1.3.0
35
- type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: jruby_streaming_update_solr_server
39
- prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: 15
46
- segments:
47
- - 0
48
- - 5
49
- - 2
50
- version: 0.5.2
51
- type: :runtime
52
- version_requirements: *id002
53
- - !ruby/object:Gem::Dependency
54
- name: marcspec
55
- prerelease: false
56
- requirement: &id003 !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- hash: 5
62
- segments:
63
- - 1
64
- - 6
65
- - 5
66
- version: 1.6.5
67
- type: :runtime
68
- version_requirements: *id003
69
- - !ruby/object:Gem::Dependency
70
- name: threach
71
- prerelease: false
72
- requirement: &id004 !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- hash: 23
78
- segments:
79
- - 0
80
- - 2
81
- - 0
82
- version: 0.2.0
83
- type: :runtime
84
- version_requirements: *id004
85
- - !ruby/object:Gem::Dependency
86
- name: jlogger
87
- prerelease: false
88
- requirement: &id005 !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ">="
92
- - !ruby/object:Gem::Version
93
- hash: 23
94
- segments:
95
- - 0
96
- - 0
97
- - 4
98
- version: 0.0.4
99
- type: :runtime
100
- version_requirements: *id005
101
- - !ruby/object:Gem::Dependency
102
- name: library_stdnums
103
- prerelease: false
104
- requirement: &id006 !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
107
- - - ">="
108
- - !ruby/object:Gem::Version
109
- hash: 23
110
- segments:
111
- - 0
112
- - 2
113
- - 0
114
- version: 0.2.0
115
- type: :runtime
116
- version_requirements: *id006
117
- - !ruby/object:Gem::Dependency
118
- name: trollop
119
- prerelease: false
120
- requirement: &id007 !ruby/object:Gem::Requirement
121
- none: false
122
- requirements:
123
- - - ">="
124
- - !ruby/object:Gem::Version
125
- hash: 3
126
- segments:
127
- - 0
128
- version: "0"
129
- type: :runtime
130
- version_requirements: *id007
131
- - !ruby/object:Gem::Dependency
132
- name: rspec
133
- prerelease: false
134
- requirement: &id008 !ruby/object:Gem::Requirement
135
- none: false
136
- requirements:
137
- - - ">="
138
- - !ruby/object:Gem::Version
139
- hash: 13
140
- segments:
141
- - 1
142
- - 2
143
- - 9
144
- version: 1.2.9
145
- type: :development
146
- version_requirements: *id008
147
- - !ruby/object:Gem::Dependency
148
- name: yard
149
- prerelease: false
150
- requirement: &id009 !ruby/object:Gem::Requirement
151
- none: false
152
- requirements:
153
- - - ">="
154
- - !ruby/object:Gem::Version
155
- hash: 3
156
- segments:
157
- - 0
158
- version: "0"
159
- type: :development
160
- version_requirements: *id009
20
+ - !ruby/object:Gem::Dependency
21
+ name: marc4j4r
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 3
30
+ - 0
31
+ version: 1.3.0
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: jruby_streaming_update_solr_server
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 0
43
+ - 5
44
+ - 2
45
+ version: 0.5.2
46
+ type: :runtime
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: marcspec
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ segments:
56
+ - 1
57
+ - 6
58
+ - 6
59
+ version: 1.6.6
60
+ type: :runtime
61
+ version_requirements: *id003
62
+ - !ruby/object:Gem::Dependency
63
+ name: threach
64
+ prerelease: false
65
+ requirement: &id004 !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ segments:
70
+ - 0
71
+ - 2
72
+ - 0
73
+ version: 0.2.0
74
+ type: :runtime
75
+ version_requirements: *id004
76
+ - !ruby/object:Gem::Dependency
77
+ name: jlogger
78
+ prerelease: false
79
+ requirement: &id005 !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ segments:
84
+ - 0
85
+ - 0
86
+ - 4
87
+ version: 0.0.4
88
+ type: :runtime
89
+ version_requirements: *id005
90
+ - !ruby/object:Gem::Dependency
91
+ name: library_stdnums
92
+ prerelease: false
93
+ requirement: &id006 !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ segments:
98
+ - 0
99
+ - 2
100
+ - 0
101
+ version: 0.2.0
102
+ type: :runtime
103
+ version_requirements: *id006
104
+ - !ruby/object:Gem::Dependency
105
+ name: trollop
106
+ prerelease: false
107
+ requirement: &id007 !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ segments:
112
+ - 0
113
+ version: "0"
114
+ type: :runtime
115
+ version_requirements: *id007
116
+ - !ruby/object:Gem::Dependency
117
+ name: rspec
118
+ prerelease: false
119
+ requirement: &id008 !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ segments:
124
+ - 1
125
+ - 2
126
+ - 9
127
+ version: 1.2.9
128
+ type: :development
129
+ version_requirements: *id008
130
+ - !ruby/object:Gem::Dependency
131
+ name: yard
132
+ prerelease: false
133
+ requirement: &id009 !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ segments:
138
+ - 0
139
+ version: "0"
140
+ type: :development
141
+ version_requirements: *id009
161
142
  description: Given a file of MARC records, send them to Sorl for indexing based on a set of MARCSpecs
162
143
  email: bill@dueber.com
163
144
  executables:
164
- - marc2solr
165
- - solrmarc_to_marc2solr
145
+ - marc2solr
146
+ - solrmarc_to_marc2solr
166
147
  extensions: []
167
148
 
168
149
  extra_rdoc_files:
169
- - LICENSE
170
- - README.md
150
+ - LICENSE
151
+ - README.md
171
152
  files:
172
- - .document
173
- - .gitignore
174
- - CHANGES
175
- - LICENSE
176
- - README.md
177
- - Rakefile
178
- - VERSION
179
- - bin/marc2solr
180
- - bin/solrmarc_to_marc2solr
181
- - lib/marc2solr.rb
182
- - lib/marc2solr/marc2solr_custom.rb
183
- - spec/marc2solr_spec.rb
184
- - spec/spec.opts
185
- - spec/spec_helper.rb
153
+ - .document
154
+ - .gitignore
155
+ - CHANGES
156
+ - LICENSE
157
+ - README.md
158
+ - Rakefile
159
+ - VERSION
160
+ - bin/marc2solr
161
+ - bin/solrmarc_to_marc2solr
162
+ - lib/marc2solr.rb
163
+ - lib/marc2solr/marc2solr_custom.rb
164
+ - spec/marc2solr_spec.rb
165
+ - spec/spec.opts
166
+ - spec/spec_helper.rb
186
167
  has_rdoc: true
187
168
  homepage: http://github.com/billdueber/marc2solr
188
169
  licenses: []
189
170
 
190
171
  post_install_message:
191
172
  rdoc_options:
192
- - --charset=UTF-8
173
+ - --charset=UTF-8
193
174
  require_paths:
194
- - lib
175
+ - lib
195
176
  required_ruby_version: !ruby/object:Gem::Requirement
196
- none: false
197
177
  requirements:
198
- - - ">="
199
- - !ruby/object:Gem::Version
200
- hash: 3
201
- segments:
202
- - 0
203
- version: "0"
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ segments:
181
+ - 0
182
+ version: "0"
204
183
  required_rubygems_version: !ruby/object:Gem::Requirement
205
- none: false
206
184
  requirements:
207
- - - ">="
208
- - !ruby/object:Gem::Version
209
- hash: 3
210
- segments:
211
- - 0
212
- version: "0"
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ segments:
188
+ - 0
189
+ version: "0"
213
190
  requirements: []
214
191
 
215
192
  rubyforge_project:
216
- rubygems_version: 1.3.7
193
+ rubygems_version: 1.3.6
217
194
  signing_key:
218
195
  specification_version: 3
219
196
  summary: "MARC2Solr: Get MARC into Solr via JRuby"
220
197
  test_files:
221
- - spec/marc2solr_spec.rb
222
- - spec/spec_helper.rb
198
+ - spec/marc2solr_spec.rb
199
+ - spec/spec_helper.rb