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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b056140c6cfe391b49aad7992cfaa1c4ab45890
4
- data.tar.gz: c724ef56d8706a91a7fcc319f6998980b2bf3807
3
+ metadata.gz: 1220e752bf2216ae1aaff3753ec171f099ae45eb
4
+ data.tar.gz: 045aedb65c90aef594d1fdfc93157d770a09d068
5
5
  SHA512:
6
- metadata.gz: f3fd112bd2d2b2ec962a164adebce21611636b131280106b6ebd2f2aa4ddef1ecfadc162edb6946446df48fa43e9dadb5cc63cd00ebbad8bc10748d79d300816
7
- data.tar.gz: ff4b8426cd63e3e76f606c0756917a802a37f832745517fb8b85662a59d7f7ced0ea6d152b0c0059da62bbad7547c479ad96edfc14452f7b57650a31ea35f5c1
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 'rdoc/task'
8
-
9
- RDoc::Task.new(:rdoc) do |rdoc|
10
- rdoc.rdoc_dir = 'rdoc'
11
- rdoc.title = 'BaseIndexer'
12
- rdoc.options << '--line-numbers'
13
- rdoc.rdoc_files.include('README.rdoc')
14
- rdoc.rdoc_files.include('lib/**/*.rb')
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
- Bundler::GemHelper.install_tasks
29
+ require 'rspec/core/rake_task'
30
+
31
+ RSpec::Core::RakeTask.new(:spec)
21
32
 
22
- #require 'rake/testtask'
33
+ #desc "run continuous integration suite (tests, coverage, docs)"
34
+ #task :ci => [:rspec, :doc]
23
35
 
24
- #Rake::TestTask.new(:test) do |t|
25
- # t.libs << 'lib'
26
- # t.libs << 'test'
27
- # t.pattern = 'test/**/*_test.rb'
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.cause.inspect }\n#{e.backtrace}"
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 Exception => e
36
- Rails.logger.error "There is a problem in retrieving collection name for #{collection_druid}. #{e.inspect}\n#{e.cause.inspect }\n#{e.backtrace}"
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).map
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={}
@@ -1,3 +1,3 @@
1
1
  module BaseIndexer
2
- VERSION = "0.1.4"
2
+ VERSION = "0.2"
3
3
  end
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.1.4
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-03-30 00:00:00.000000000 Z
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
- - MIT
215
+ - Apache 2
216
216
  metadata: {}
217
217
  post_install_message:
218
218
  rdoc_options: []