base_indexer 0.1.4 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +45 -24
- data/app/controllers/base_indexer/items_controller.rb +1 -1
- data/lib/base_indexer/collection.rb +2 -2
- data/lib/base_indexer/main_indexer_engine.rb +1 -1
- data/lib/base_indexer/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1220e752bf2216ae1aaff3753ec171f099ae45eb
|
4
|
+
data.tar.gz: 045aedb65c90aef594d1fdfc93157d770a09d068
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40898053ee492e35d690f5bbbd31b2337cdbf3301a2dfc9a3b517b089afa7fb3b13563fc2b7c69b8bf9e5800ba640244ff8974bb640a960e517420fb8a41a66a
|
7
|
+
data.tar.gz: b772fde1333708f8321d97c2a8e8d2fec83e54071ac41cda08a051a29a66c360597caa90ed3e97d49c88c5dfe52406e4cd4201eb5215948ea645f043263f7071
|
data/Rakefile
CHANGED
@@ -4,36 +4,57 @@ rescue LoadError
|
|
4
4
|
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
5
|
end
|
6
6
|
|
7
|
-
require '
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
require 'rspec/core'
|
8
|
+
require 'rspec/core/rake_task'
|
9
|
+
require 'yard'
|
10
|
+
require 'yard/rake/yardoc_task'
|
11
|
+
require 'engine_cart/rake_task'
|
12
|
+
|
13
|
+
Bundler::GemHelper.install_tasks
|
14
|
+
|
15
|
+
|
16
|
+
# Travis ci task
|
17
|
+
task :default => :ci
|
18
|
+
task :ci => ['engine_cart:generate'] do
|
19
|
+
# run the tests
|
20
|
+
RAILS_ENV = 'test'
|
21
|
+
Rake::Task['spec'].invoke
|
22
|
+
RSpec::Core::RakeTask.new(:rspec) do |spec|
|
23
|
+
spec.rspec_opts = ["-c", "-f progress", "--tty", "-r ./spec/spec_helper.rb"]
|
24
|
+
end
|
25
|
+
|
15
26
|
end
|
16
27
|
|
17
|
-
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
18
|
-
load 'rails/tasks/engine.rake'
|
19
28
|
|
20
|
-
|
29
|
+
require 'rspec/core/rake_task'
|
30
|
+
|
31
|
+
RSpec::Core::RakeTask.new(:spec)
|
21
32
|
|
22
|
-
#
|
33
|
+
#desc "run continuous integration suite (tests, coverage, docs)"
|
34
|
+
#task :ci => [:rspec, :doc]
|
23
35
|
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
28
|
-
# t.verbose = false
|
36
|
+
# Run rspec
|
37
|
+
#task :spec => :rspec
|
38
|
+
#RSpec::Core::RakeTask.new(:rspec) do |spec|
|
39
|
+
# spec.rspec_opts = ["-c", "-f progress", "--tty", "-r ./spec/spec_helper.rb"]
|
29
40
|
#end
|
30
41
|
|
42
|
+
# Use yard to build docs
|
43
|
+
begin
|
44
|
+
project_root = File.expand_path(File.dirname(__FILE__))
|
45
|
+
doc_dest_dir = File.join(project_root, 'doc')
|
46
|
+
|
47
|
+
YARD::Rake::YardocTask.new(:doc) do |yt|
|
48
|
+
yt.files = Dir.glob(File.join(project_root, 'lib', '**', '*.rb')) +
|
49
|
+
[ File.join(project_root, 'README.rdoc') ]
|
50
|
+
yt.options = ['--output-dir', doc_dest_dir, '--readme', 'README.rdoc', '--title', 'Discovery Indexer Documentation']
|
51
|
+
end
|
52
|
+
rescue LoadError
|
53
|
+
desc "Generate YARD Documentation"
|
54
|
+
task :doc do
|
55
|
+
abort "Please install the YARD gem to generate rdoc."
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
31
59
|
|
32
|
-
#task default: :test
|
33
60
|
|
34
|
-
Dir[File.join(File.dirname(__FILE__), 'tasks/**/*.rake')].each {|f| load f }
|
35
|
-
require 'rspec/core'
|
36
|
-
require 'rspec/core/rake_task'
|
37
|
-
desc "Run all specs in spec directory (excluding plugin specs)"
|
38
|
-
RSpec::Core::RakeTask.new(:spec => 'app:db:test:prepare')
|
39
|
-
task :default => :spec
|
@@ -33,7 +33,7 @@ module BaseIndexer
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def report_failure method_symbol, params, e
|
36
|
-
return "#{method_symbol} #{params}\n\n#{e.inspect}\n#{e.
|
36
|
+
return "#{method_symbol} #{params}\n\n#{e.inspect}\n#{e.message}\n#{e.backtrace}"
|
37
37
|
end
|
38
38
|
|
39
39
|
def report_success
|
@@ -32,8 +32,8 @@ module BaseIndexer
|
|
32
32
|
Rails.cache.write(collection_druid, purl_model.label, expires_in: 1.hours)
|
33
33
|
purl_model.label
|
34
34
|
end
|
35
|
-
rescue
|
36
|
-
Rails.logger.error "There is a problem in retrieving collection name for #{collection_druid}. #{e.inspect}\n#{e.
|
35
|
+
rescue => e
|
36
|
+
Rails.logger.error "There is a problem in retrieving collection name for #{collection_druid}. #{e.inspect}\n#{e.message }\n#{e.backtrace}"
|
37
37
|
return nil
|
38
38
|
end
|
39
39
|
end
|
@@ -33,7 +33,7 @@ module BaseIndexer
|
|
33
33
|
collection_names = get_collection_names(purl_model.collection_druids)
|
34
34
|
|
35
35
|
# Map the input to solr_doc
|
36
|
-
solr_doc = BaseIndexer.mapper_class_name.constantize.new(druid, mods_model, purl_model, collection_names).
|
36
|
+
solr_doc = BaseIndexer.mapper_class_name.constantize.new(druid, mods_model, purl_model, collection_names).convert_to_solr_doc
|
37
37
|
|
38
38
|
# Get target list
|
39
39
|
targets_hash={}
|
data/lib/base_indexer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: base_indexer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ahmed Alsum
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -212,7 +212,7 @@ files:
|
|
212
212
|
- lib/tasks/base_indexer_tasks.rake
|
213
213
|
homepage:
|
214
214
|
licenses:
|
215
|
-
-
|
215
|
+
- Apache 2
|
216
216
|
metadata: {}
|
217
217
|
post_install_message:
|
218
218
|
rdoc_options: []
|