solrizer 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc ADDED
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # This is an RVM Project .rvmrc file, used to automatically load the ruby
4
+ # development environment upon cd'ing into the directory
5
+
6
+ ruby_string="ree-1.8.7"
7
+ gemset_name="solrizer"
8
+
9
+ #
10
+ rvm_install_on_use_flag=1
11
+
12
+ # Specify our desired <ruby>[@<gemset>], the @gemset name is optional.
13
+ environment_id="${ruby_string}@${gemset_name}"
14
+
15
+ # First, attempt to load the desired environment directly from the environment
16
+ # file. This is very fast and efficient compared to running through the entire
17
+ # CLI and selector. If you want feedback on which environment was used then
18
+ # insert the word 'use' after --create as this triggers verbose mode.
19
+ #
20
+ if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
21
+ && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]] ; then
22
+ \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
23
+ else
24
+ # If the environment file has not yet been created, use the RVM CLI to select.
25
+ rvm --create "$environment_id"
26
+ fi
27
+
28
+ #(
29
+ # Ensure that Bundler is installed, install it if it is not.
30
+ if ! command -v bundle ; then
31
+ printf "The rubygem 'bundler' is not installed, installing it now.\n"
32
+ gem install bundler
33
+ fi
34
+ #)&
35
+
data/Gemfile CHANGED
@@ -12,5 +12,8 @@ group :development, :test do
12
12
  gem 'ruby-debug'
13
13
  gem 'ruby-debug-base'
14
14
  gem 'rspec', '<2.0.0'
15
+ gem 'rcov'
15
16
  gem 'mocha'
17
+ gem 'yard'
18
+ gem 'RedCloth'
16
19
  end
data/Gemfile.lock CHANGED
@@ -1,6 +1,7 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
+ RedCloth (4.2.7)
4
5
  columnize (0.3.2)
5
6
  daemons (1.1.2)
6
7
  git (1.2.5)
@@ -16,6 +17,7 @@ GEM
16
17
  nokogiri (>= 1.4.2)
17
18
  om
18
19
  rake (0.8.7)
20
+ rcov (0.9.9)
19
21
  rspec (1.3.1)
20
22
  ruby-debug (0.10.4)
21
23
  columnize (>= 0.1)
@@ -24,19 +26,23 @@ GEM
24
26
  linecache (>= 0.3)
25
27
  stomp (1.1.8)
26
28
  xml-simple (1.0.15)
29
+ yard (0.6.8)
27
30
 
28
31
  PLATFORMS
29
32
  ruby
30
33
 
31
34
  DEPENDENCIES
35
+ RedCloth
32
36
  daemons
33
37
  jeweler
34
38
  mediashelf-loggable
35
39
  mocha
36
40
  nokogiri
37
41
  om (>= 1.0.0)
42
+ rcov
38
43
  rspec (< 2.0.0)
39
44
  ruby-debug
40
45
  ruby-debug-base
41
46
  stomp
42
47
  xml-simple
48
+ yard
data/Rakefile CHANGED
@@ -1,6 +1,9 @@
1
1
  require 'rubygems'
2
2
  require 'rake'
3
3
 
4
+ # load rake tasks in lib/tasks
5
+ Dir.glob('lib/tasks/*.rake').each { |r| import r }
6
+
4
7
  begin
5
8
  require 'jeweler'
6
9
  Jeweler::Tasks.new do |gem|
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.3
1
+ 1.0.4
@@ -268,7 +268,7 @@ module Solrizer
268
268
 
269
269
  # Add mapped name & value, unless it's a duplicate
270
270
  values = (results[name] ||= [])
271
- values << value unless values.contains?(value)
271
+ values << value unless values.include?(value)
272
272
  end
273
273
 
274
274
  results
@@ -71,7 +71,7 @@ module Solrizer::XML::TerminologyBasedSolrizer
71
71
  generic_field_name_base = OM::XML::Terminology.term_generic_name(*term_pointer)
72
72
 
73
73
  field_mapper.solr_names_and_values(generic_field_name_base, node_value, term.data_type, term.index_as).each do |field_name, field_value|
74
- unless field_value.join("").strip.blank?
74
+ unless field_value.join("").strip.empty?
75
75
  ::Solrizer::Extractor.insert_solr_field_value(solr_doc, field_name, field_value)
76
76
  end
77
77
  end
@@ -79,7 +79,7 @@ module Solrizer::XML::TerminologyBasedSolrizer
79
79
  if term_pointer.length > 1
80
80
  hierarchical_field_name_base = OM::XML::Terminology.term_hierarchical_name(*term_pointer)
81
81
  field_mapper.solr_names_and_values(hierarchical_field_name_base, node_value, term.data_type, term.index_as).each do |field_name, field_value|
82
- unless field_value.join("").strip.blank?
82
+ unless field_value.join("").strip.empty?
83
83
  ::Solrizer::Extractor.insert_solr_field_value(solr_doc, field_name, field_value)
84
84
  end
85
85
  end
@@ -1,5 +1,29 @@
1
- namespace :solrizer do
2
-
1
+ desc "Task to execute builds on a Hudson Continuous Integration Server."
2
+ task :hudson do
3
+ Rake::Task["doc"].invoke
4
+ Rake::Task["solrizer:rspec"].invoke
5
+ end
6
+
7
+ # Use yard to build docs
8
+ begin
9
+ require 'yard'
10
+ require 'yard/rake/yardoc_task'
11
+ project_root = File.expand_path("#{File.dirname(__FILE__)}/../../")
12
+ doc_destination = File.join(project_root, 'doc')
13
+
14
+ YARD::Rake::YardocTask.new(:doc) do |yt|
15
+ yt.files = Dir.glob(File.join(project_root, 'lib', '**', '*.rb')) +
16
+ [ File.join(project_root, 'README.textile') ]
17
+ yt.options = ['--output-dir', doc_destination, '--readme', 'README.textile']
18
+ end
19
+ rescue LoadError
20
+ desc "Generate YARD Documentation"
21
+ task :doc do
22
+ abort "Please install the YARD gem to generate rdoc."
23
+ end
24
+ end
25
+
26
+ namespace :solrizer do
3
27
  desc 'Placeholder for generic solrization task.'
4
28
  task :solrize do
5
29
  puts "Nobody here. Possibly you meant to run rake solrizer:fedora:solrize PID=..."
@@ -9,5 +33,13 @@ namespace :solrizer do
9
33
  task :solrize_objects do
10
34
  puts "Nobody here. Possibly you meant to run rake solrizer:fedora:solrize_objects"
11
35
  end
12
-
36
+
37
+ Spec::Rake::SpecTask.new(:rspec) do |t|
38
+ t.spec_files = FileList['spec/**/*_spec.rb']
39
+ t.rcov = true
40
+ t.rcov_opts = lambda do
41
+ IO.readlines("spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
42
+ end
43
+ end
44
+
13
45
  end
data/solrizer.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{solrizer}
8
- s.version = "1.0.3"
8
+ s.version = "1.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Matt Zumwalt"]
12
- s.date = %q{2011-04-18}
12
+ s.date = %q{2011-05-02}
13
13
  s.description = %q{Use solrizer to populate solr indexes from Fedora repository content or from other sources. You can run solrizer from within your apps, using the provided rake tasks, or as a JMS listener}
14
14
  s.email = %q{matt.zumwalt@yourmediashelf.com}
15
15
  s.executables = ["solrizer", "solrizerd"]
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
18
18
  "README.textile"
19
19
  ]
20
20
  s.files = [
21
+ ".rvmrc",
21
22
  "Gemfile",
22
23
  "Gemfile.lock",
23
24
  "History.txt",
@@ -87,7 +88,10 @@ Gem::Specification.new do |s|
87
88
  s.add_development_dependency(%q<ruby-debug>, [">= 0"])
88
89
  s.add_development_dependency(%q<ruby-debug-base>, [">= 0"])
89
90
  s.add_development_dependency(%q<rspec>, ["< 2.0.0"])
91
+ s.add_development_dependency(%q<rcov>, [">= 0"])
90
92
  s.add_development_dependency(%q<mocha>, [">= 0"])
93
+ s.add_development_dependency(%q<yard>, [">= 0"])
94
+ s.add_development_dependency(%q<RedCloth>, [">= 0"])
91
95
  s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
92
96
  s.add_runtime_dependency(%q<om>, [">= 0"])
93
97
  s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
@@ -108,7 +112,10 @@ Gem::Specification.new do |s|
108
112
  s.add_dependency(%q<ruby-debug>, [">= 0"])
109
113
  s.add_dependency(%q<ruby-debug-base>, [">= 0"])
110
114
  s.add_dependency(%q<rspec>, ["< 2.0.0"])
115
+ s.add_dependency(%q<rcov>, [">= 0"])
111
116
  s.add_dependency(%q<mocha>, [">= 0"])
117
+ s.add_dependency(%q<yard>, [">= 0"])
118
+ s.add_dependency(%q<RedCloth>, [">= 0"])
112
119
  s.add_dependency(%q<nokogiri>, [">= 0"])
113
120
  s.add_dependency(%q<om>, [">= 0"])
114
121
  s.add_dependency(%q<nokogiri>, [">= 0"])
@@ -130,7 +137,10 @@ Gem::Specification.new do |s|
130
137
  s.add_dependency(%q<ruby-debug>, [">= 0"])
131
138
  s.add_dependency(%q<ruby-debug-base>, [">= 0"])
132
139
  s.add_dependency(%q<rspec>, ["< 2.0.0"])
140
+ s.add_dependency(%q<rcov>, [">= 0"])
133
141
  s.add_dependency(%q<mocha>, [">= 0"])
142
+ s.add_dependency(%q<yard>, [">= 0"])
143
+ s.add_dependency(%q<RedCloth>, [">= 0"])
134
144
  s.add_dependency(%q<nokogiri>, [">= 0"])
135
145
  s.add_dependency(%q<om>, [">= 0"])
136
146
  s.add_dependency(%q<nokogiri>, [">= 0"])
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solrizer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 3
10
- version: 1.0.3
9
+ - 4
10
+ version: 1.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matt Zumwalt
@@ -15,12 +15,12 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-18 00:00:00 -04:00
18
+ date: 2011-05-02 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- type: :runtime
23
22
  prerelease: false
23
+ type: :runtime
24
24
  name: nokogiri
25
25
  version_requirements: &id001 !ruby/object:Gem::Requirement
26
26
  none: false
@@ -33,8 +33,8 @@ dependencies:
33
33
  version: "0"
34
34
  requirement: *id001
35
35
  - !ruby/object:Gem::Dependency
36
- type: :runtime
37
36
  prerelease: false
37
+ type: :runtime
38
38
  name: xml-simple
39
39
  version_requirements: &id002 !ruby/object:Gem::Requirement
40
40
  none: false
@@ -47,8 +47,8 @@ dependencies:
47
47
  version: "0"
48
48
  requirement: *id002
49
49
  - !ruby/object:Gem::Dependency
50
- type: :runtime
51
50
  prerelease: false
51
+ type: :runtime
52
52
  name: om
53
53
  version_requirements: &id003 !ruby/object:Gem::Requirement
54
54
  none: false
@@ -63,8 +63,8 @@ dependencies:
63
63
  version: 1.0.0
64
64
  requirement: *id003
65
65
  - !ruby/object:Gem::Dependency
66
- type: :runtime
67
66
  prerelease: false
67
+ type: :runtime
68
68
  name: mediashelf-loggable
69
69
  version_requirements: &id004 !ruby/object:Gem::Requirement
70
70
  none: false
@@ -77,8 +77,8 @@ dependencies:
77
77
  version: "0"
78
78
  requirement: *id004
79
79
  - !ruby/object:Gem::Dependency
80
- type: :runtime
81
80
  prerelease: false
81
+ type: :runtime
82
82
  name: stomp
83
83
  version_requirements: &id005 !ruby/object:Gem::Requirement
84
84
  none: false
@@ -91,8 +91,8 @@ dependencies:
91
91
  version: "0"
92
92
  requirement: *id005
93
93
  - !ruby/object:Gem::Dependency
94
- type: :runtime
95
94
  prerelease: false
95
+ type: :runtime
96
96
  name: daemons
97
97
  version_requirements: &id006 !ruby/object:Gem::Requirement
98
98
  none: false
@@ -105,8 +105,8 @@ dependencies:
105
105
  version: "0"
106
106
  requirement: *id006
107
107
  - !ruby/object:Gem::Dependency
108
- type: :development
109
108
  prerelease: false
109
+ type: :development
110
110
  name: jeweler
111
111
  version_requirements: &id007 !ruby/object:Gem::Requirement
112
112
  none: false
@@ -119,8 +119,8 @@ dependencies:
119
119
  version: "0"
120
120
  requirement: *id007
121
121
  - !ruby/object:Gem::Dependency
122
- type: :development
123
122
  prerelease: false
123
+ type: :development
124
124
  name: ruby-debug
125
125
  version_requirements: &id008 !ruby/object:Gem::Requirement
126
126
  none: false
@@ -133,8 +133,8 @@ dependencies:
133
133
  version: "0"
134
134
  requirement: *id008
135
135
  - !ruby/object:Gem::Dependency
136
- type: :development
137
136
  prerelease: false
137
+ type: :development
138
138
  name: ruby-debug-base
139
139
  version_requirements: &id009 !ruby/object:Gem::Requirement
140
140
  none: false
@@ -147,8 +147,8 @@ dependencies:
147
147
  version: "0"
148
148
  requirement: *id009
149
149
  - !ruby/object:Gem::Dependency
150
- type: :development
151
150
  prerelease: false
151
+ type: :development
152
152
  name: rspec
153
153
  version_requirements: &id010 !ruby/object:Gem::Requirement
154
154
  none: false
@@ -163,9 +163,9 @@ dependencies:
163
163
  version: 2.0.0
164
164
  requirement: *id010
165
165
  - !ruby/object:Gem::Dependency
166
- type: :development
167
166
  prerelease: false
168
- name: mocha
167
+ type: :development
168
+ name: rcov
169
169
  version_requirements: &id011 !ruby/object:Gem::Requirement
170
170
  none: false
171
171
  requirements:
@@ -177,9 +177,9 @@ dependencies:
177
177
  version: "0"
178
178
  requirement: *id011
179
179
  - !ruby/object:Gem::Dependency
180
- type: :runtime
181
180
  prerelease: false
182
- name: nokogiri
181
+ type: :development
182
+ name: mocha
183
183
  version_requirements: &id012 !ruby/object:Gem::Requirement
184
184
  none: false
185
185
  requirements:
@@ -191,9 +191,9 @@ dependencies:
191
191
  version: "0"
192
192
  requirement: *id012
193
193
  - !ruby/object:Gem::Dependency
194
- type: :runtime
195
194
  prerelease: false
196
- name: om
195
+ type: :development
196
+ name: yard
197
197
  version_requirements: &id013 !ruby/object:Gem::Requirement
198
198
  none: false
199
199
  requirements:
@@ -205,9 +205,9 @@ dependencies:
205
205
  version: "0"
206
206
  requirement: *id013
207
207
  - !ruby/object:Gem::Dependency
208
- type: :runtime
209
208
  prerelease: false
210
- name: nokogiri
209
+ type: :development
210
+ name: RedCloth
211
211
  version_requirements: &id014 !ruby/object:Gem::Requirement
212
212
  none: false
213
213
  requirements:
@@ -219,9 +219,9 @@ dependencies:
219
219
  version: "0"
220
220
  requirement: *id014
221
221
  - !ruby/object:Gem::Dependency
222
- type: :runtime
223
222
  prerelease: false
224
- name: mediashelf-loggable
223
+ type: :runtime
224
+ name: nokogiri
225
225
  version_requirements: &id015 !ruby/object:Gem::Requirement
226
226
  none: false
227
227
  requirements:
@@ -233,9 +233,9 @@ dependencies:
233
233
  version: "0"
234
234
  requirement: *id015
235
235
  - !ruby/object:Gem::Dependency
236
- type: :development
237
236
  prerelease: false
238
- name: jeweler
237
+ type: :runtime
238
+ name: om
239
239
  version_requirements: &id016 !ruby/object:Gem::Requirement
240
240
  none: false
241
241
  requirements:
@@ -247,9 +247,9 @@ dependencies:
247
247
  version: "0"
248
248
  requirement: *id016
249
249
  - !ruby/object:Gem::Dependency
250
- type: :development
251
250
  prerelease: false
252
- name: ruby-debug
251
+ type: :runtime
252
+ name: nokogiri
253
253
  version_requirements: &id017 !ruby/object:Gem::Requirement
254
254
  none: false
255
255
  requirements:
@@ -261,9 +261,9 @@ dependencies:
261
261
  version: "0"
262
262
  requirement: *id017
263
263
  - !ruby/object:Gem::Dependency
264
- type: :development
265
264
  prerelease: false
266
- name: ruby-debug-base
265
+ type: :runtime
266
+ name: mediashelf-loggable
267
267
  version_requirements: &id018 !ruby/object:Gem::Requirement
268
268
  none: false
269
269
  requirements:
@@ -275,10 +275,52 @@ dependencies:
275
275
  version: "0"
276
276
  requirement: *id018
277
277
  - !ruby/object:Gem::Dependency
278
+ prerelease: false
278
279
  type: :development
280
+ name: jeweler
281
+ version_requirements: &id019 !ruby/object:Gem::Requirement
282
+ none: false
283
+ requirements:
284
+ - - ">="
285
+ - !ruby/object:Gem::Version
286
+ hash: 3
287
+ segments:
288
+ - 0
289
+ version: "0"
290
+ requirement: *id019
291
+ - !ruby/object:Gem::Dependency
279
292
  prerelease: false
293
+ type: :development
294
+ name: ruby-debug
295
+ version_requirements: &id020 !ruby/object:Gem::Requirement
296
+ none: false
297
+ requirements:
298
+ - - ">="
299
+ - !ruby/object:Gem::Version
300
+ hash: 3
301
+ segments:
302
+ - 0
303
+ version: "0"
304
+ requirement: *id020
305
+ - !ruby/object:Gem::Dependency
306
+ prerelease: false
307
+ type: :development
308
+ name: ruby-debug-base
309
+ version_requirements: &id021 !ruby/object:Gem::Requirement
310
+ none: false
311
+ requirements:
312
+ - - ">="
313
+ - !ruby/object:Gem::Version
314
+ hash: 3
315
+ segments:
316
+ - 0
317
+ version: "0"
318
+ requirement: *id021
319
+ - !ruby/object:Gem::Dependency
320
+ prerelease: false
321
+ type: :development
280
322
  name: rspec
281
- version_requirements: &id019 !ruby/object:Gem::Requirement
323
+ version_requirements: &id022 !ruby/object:Gem::Requirement
282
324
  none: false
283
325
  requirements:
284
326
  - - <
@@ -289,12 +331,12 @@ dependencies:
289
331
  - 0
290
332
  - 0
291
333
  version: 2.0.0
292
- requirement: *id019
334
+ requirement: *id022
293
335
  - !ruby/object:Gem::Dependency
294
- type: :development
295
336
  prerelease: false
337
+ type: :development
296
338
  name: mocha
297
- version_requirements: &id020 !ruby/object:Gem::Requirement
339
+ version_requirements: &id023 !ruby/object:Gem::Requirement
298
340
  none: false
299
341
  requirements:
300
342
  - - ">="
@@ -303,7 +345,7 @@ dependencies:
303
345
  segments:
304
346
  - 0
305
347
  version: "0"
306
- requirement: *id020
348
+ requirement: *id023
307
349
  description: Use solrizer to populate solr indexes from Fedora repository content or from other sources. You can run solrizer from within your apps, using the provided rake tasks, or as a JMS listener
308
350
  email: matt.zumwalt@yourmediashelf.com
309
351
  executables:
@@ -315,6 +357,7 @@ extra_rdoc_files:
315
357
  - LICENSE
316
358
  - README.textile
317
359
  files:
360
+ - .rvmrc
318
361
  - Gemfile
319
362
  - Gemfile.lock
320
363
  - History.txt