blacklight_unapi 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/.travis.yml +15 -0
- data/Gemfile +21 -0
- data/README.rdoc +2 -5
- data/Rakefile +42 -0
- data/VERSION +1 -1
- data/app/helpers/blacklight_unapi_helper.rb +5 -2
- data/app/views/catalog/_microformat_default.html.erb +2 -0
- data/app/views/catalog/formats.xml.builder +6 -0
- data/blacklight_unapi.gemspec +11 -5
- data/config/routes.rb +2 -3
- data/lib/blacklight_unapi.rb +0 -11
- data/lib/blacklight_unapi/controller_extension.rb +16 -30
- data/lib/blacklight_unapi/engine.rb +1 -5
- data/lib/generators/blacklight_unapi/install_generator.rb +38 -0
- data/spec/features/integration_spec.rb +32 -0
- data/spec/spec_helper.rb +16 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +24 -0
- metadata +128 -29
- data/app/views/unapi/_microformat.html.erb +0 -1
- data/app/views/unapi/formats.xml.builder +0 -6
- data/lib/blacklight_unapi/route_sets.rb +0 -12
- data/lib/blacklight_unapi/view_helper_extension.rb +0 -5
- data/lib/generators/blacklight_unapi/blacklight_unapi_generator.rb +0 -35
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6740283234ea80abfba733f02e508cfd35baff86
|
4
|
+
data.tar.gz: 9b8db6a9e2f2c0b4a1b9d9ecb1f175cbd8a8dc29
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0e835a00df8179640536efdb0fc1cabcee3fda776ef5c4e12602671bbf5f000c4c045f1a7321f013d51fee3e9c2ae96189185386f51151479deebbfc9626477b
|
7
|
+
data.tar.gz: 100bf662702734e99c12e126c78109f860f1421a28c2eb42151c4bba673377d828f837e0fe9a6d8275c675f052ea8a9b9004c5dc5113736f823ac62cea75ee60
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
notifications:
|
2
|
+
email: false
|
3
|
+
|
4
|
+
rvm:
|
5
|
+
- 2.1.0
|
6
|
+
|
7
|
+
notifications:
|
8
|
+
irc: "irc.freenode.org#blacklight"
|
9
|
+
email:
|
10
|
+
- blacklight-commits@googlegroups.com
|
11
|
+
|
12
|
+
env:
|
13
|
+
global:
|
14
|
+
- JRUBY_OPTS="-J-Xms512m -J-Xmx1024m"
|
15
|
+
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
data/Gemfile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
gem 'byebug'
|
6
|
+
file = File.expand_path("Gemfile", ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path("../spec/internal", __FILE__))
|
7
|
+
if File.exists?(file)
|
8
|
+
puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
|
9
|
+
instance_eval File.read(file)
|
10
|
+
else
|
11
|
+
gem 'rails', ENV['RAILS_VERSION']
|
12
|
+
|
13
|
+
# explicitly include sass-rails to get compatible sprocket dependencies
|
14
|
+
if ENV['RAILS_VERSION'] and ENV['RAILS_VERSION'] =~ /^4.2/
|
15
|
+
gem 'sass-rails', ">= 5.0.0"
|
16
|
+
gem 'responders', "~> 2.0"
|
17
|
+
else
|
18
|
+
gem 'sass-rails', '< 5.0'
|
19
|
+
gem 'coffee-rails', "~> 4.0.0"
|
20
|
+
end
|
21
|
+
end
|
data/README.rdoc
CHANGED
@@ -18,7 +18,7 @@ Add
|
|
18
18
|
|
19
19
|
to your Gemfile and run "bundle install".
|
20
20
|
|
21
|
-
Then, run "rails generate blacklight_unapi" to install the unAPI configuration and hooks into the CatalogController.
|
21
|
+
Then, run "rails generate blacklight_unapi:install" to install the unAPI configuration and hooks into the CatalogController.
|
22
22
|
|
23
23
|
= Configuration
|
24
24
|
|
@@ -26,7 +26,7 @@ See ./config/initializers/blacklight_config for unAPI configuration options, whe
|
|
26
26
|
|
27
27
|
Out of the box, only the OAI Dublin Core XML format is advertised as it can be be automatically generated from the Blacklight "semantic fields" configuration. Other common export formats must be defined within the Blacklight configuration. Implementors SHOULD customize this list using the [[Blacklight.config[:unapi]|https://github.com/projectblacklight/blacklight/blob/master/config/initializers/blacklight_config.rb#L263]] hash, which is formatted as the [Blacklight::Solr::Document#export_formats](https://github.com/projectblacklight/blacklight/blob/master/lib/blacklight/solr/document.rb#L155) output, e.g.:
|
28
28
|
|
29
|
-
config
|
29
|
+
config.unapi = {
|
30
30
|
'oai_dc_xml' => { :content_type => 'text/xml' },
|
31
31
|
'marc' => { :content_type => 'application/marc' },
|
32
32
|
'jpg' => { :content_type => 'image/jpg' }
|
@@ -69,9 +69,6 @@ Provides a list of object formats available for all objects.
|
|
69
69
|
|
70
70
|
Provides a list of object formats available for the object identified by "IDENTIFIER". The object formats are generated from the Document Extension Framework [Blacklight::Solr::Document#export_formats](https://github.com/projectblacklight/blacklight/blob/master/lib/blacklight/solr/document.rb#L155).
|
71
71
|
|
72
|
-
In the future, Blacklight may provide mechanisms within the Document Extension Framework for filtering the list of object formats (see [CODEBASE-301](http://jira.projectblacklight.org/jira/browse/CODEBASE-301)). In the meantime, to filter this list of object formats, implementors are encouraged to override [./app/views/catalog/unapi.xml.builder](https://github.com/projectblacklight/blacklight/blob/master/app/views/catalog/unapi.xml.builder) (or CatalogController#unapi) locally.
|
73
|
-
|
74
|
-
|
75
72
|
<?xml version="1.0" encoding="UTF-8"?>
|
76
73
|
<formats id="u1">
|
77
74
|
<format type="text/plain" name="refworks_marc_txt"/>
|
data/Rakefile
CHANGED
@@ -3,3 +3,45 @@ require 'bundler'
|
|
3
3
|
|
4
4
|
Bundler::GemHelper.install_tasks
|
5
5
|
|
6
|
+
|
7
|
+
ZIP_URL = "https://github.com/projectblacklight/blacklight-jetty/archive/v4.10.2.zip"
|
8
|
+
APP_ROOT = File.dirname(__FILE__)
|
9
|
+
|
10
|
+
require 'rspec/core/rake_task'
|
11
|
+
require 'engine_cart/rake_task'
|
12
|
+
|
13
|
+
require 'jettywrapper'
|
14
|
+
|
15
|
+
task :default => :ci
|
16
|
+
|
17
|
+
desc "Run specs"
|
18
|
+
RSpec::Core::RakeTask.new do |t|
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
desc "Load fixtures"
|
23
|
+
task :fixtures => ['engine_cart:generate'] do
|
24
|
+
within_test_app do
|
25
|
+
system "rake blacklight:solr:seed RAILS_ENV=test"
|
26
|
+
abort "Error running fixtures" unless $?.success?
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
desc "Execute Continuous Integration build"
|
31
|
+
task :ci => ['jetty:clean', 'engine_cart:generate'] do
|
32
|
+
|
33
|
+
require 'jettywrapper'
|
34
|
+
jetty_params = {
|
35
|
+
:jetty_home => File.expand_path(File.dirname(__FILE__) + '/jetty'),
|
36
|
+
:quiet => false,
|
37
|
+
:jetty_port => 8888,
|
38
|
+
:solr_home => File.expand_path(File.dirname(__FILE__) + '/jetty/solr'),
|
39
|
+
:startup_wait => 30
|
40
|
+
}
|
41
|
+
|
42
|
+
error = Jettywrapper.wrap(jetty_params) do
|
43
|
+
Rake::Task['fixtures'].invoke
|
44
|
+
Rake::Task['spec'].invoke
|
45
|
+
end
|
46
|
+
raise "test failures: #{error}" if error
|
47
|
+
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
0.1.0
|
@@ -1,5 +1,8 @@
|
|
1
1
|
module BlacklightUnapiHelper
|
2
|
-
def
|
3
|
-
|
2
|
+
def inject_auto_discovery_link_tag
|
3
|
+
content_for(:head) do
|
4
|
+
auto_discovery_link_tag(:unapi, unapi_url, type: 'application/xml', rel: 'unapi-server', title: 'unAPI' )
|
5
|
+
end unless @injected_auto_discovery_link_tag
|
6
|
+
@injected_auto_discovery_link_tag = true
|
4
7
|
end
|
5
8
|
end
|
data/blacklight_unapi.gemspec
CHANGED
@@ -6,19 +6,25 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.version = BlacklightUnapi::VERSION
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ["Chris Beer"]
|
9
|
-
s.email = ["
|
9
|
+
s.email = ["chris@cbeer.info"]
|
10
10
|
s.homepage = "http://projectblacklight.org/"
|
11
11
|
s.summary = "Blacklight unapi plugin"
|
12
12
|
|
13
|
-
s.rubyforge_project = "blacklight"
|
14
|
-
|
15
13
|
s.files = `git ls-files`.split("\n")
|
16
14
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
15
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
16
|
s.require_paths = ["lib"]
|
19
17
|
|
20
18
|
|
21
|
-
s.add_dependency "rails"
|
22
|
-
s.add_dependency "blacklight", "
|
19
|
+
s.add_dependency "rails"
|
20
|
+
s.add_dependency "blacklight", "~> 5.0"
|
21
|
+
|
22
|
+
s.add_development_dependency "bundler", "~> 1.5"
|
23
|
+
s.add_development_dependency "rake"
|
24
|
+
s.add_development_dependency "rspec-rails", "~> 3.1"
|
25
|
+
s.add_development_dependency "jettywrapper"
|
26
|
+
s.add_development_dependency "engine_cart"
|
27
|
+
s.add_development_dependency "capybara"
|
28
|
+
s.add_development_dependency "poltergeist", ">= 1.5.0"
|
23
29
|
end
|
24
30
|
|
data/config/routes.rb
CHANGED
data/lib/blacklight_unapi.rb
CHANGED
@@ -2,19 +2,8 @@
|
|
2
2
|
|
3
3
|
module BlacklightUnapi
|
4
4
|
autoload :ControllerExtension, 'blacklight_unapi/controller_extension'
|
5
|
-
autoload :ViewHelperExtension, 'blacklight_unapi/view_helper_extension'
|
6
|
-
autoload :RouteSets, 'blacklight_unapi/route_sets'
|
7
5
|
|
8
6
|
require 'blacklight_unapi/version'
|
9
7
|
require 'blacklight_unapi/engine'
|
10
8
|
|
11
|
-
@omit_inject = {}
|
12
|
-
|
13
|
-
def self.omit_inject=(value)
|
14
|
-
value = Hash.new(true) if value == true
|
15
|
-
@omit_inject = value
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.omit_inject ; @omit_inject ; end
|
19
|
-
|
20
9
|
end
|
@@ -1,46 +1,32 @@
|
|
1
1
|
# Meant to be applied on top of a controller that implements
|
2
2
|
# Blacklight::SolrHelper.
|
3
3
|
module BlacklightUnapi::ControllerExtension
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
some_class.before_filter do
|
9
|
-
extra_head_content << view_context.auto_discovery_link_tag(:unapi, unapi_url, {:type => 'application/xml', :rel => 'unapi-server', :title => 'unAPI' })
|
10
|
-
end
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
included do
|
7
|
+
helper BlacklightUnapiHelper
|
11
8
|
end
|
12
9
|
|
13
10
|
def unapi
|
14
|
-
@export_formats =
|
11
|
+
@export_formats = blacklight_config.unapi
|
15
12
|
@format = params[:format]
|
16
13
|
|
17
14
|
if params[:id]
|
18
|
-
@response, @document = get_solr_response_for_doc_id
|
15
|
+
@response, @document = get_solr_response_for_doc_id params[:id]
|
19
16
|
@export_formats = @document.export_formats
|
20
17
|
end
|
21
18
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
send_data @document.export_as(@format), :type => @document.export_formats[@format][:content_type], :disposition => 'inline' if @document.will_export_as @format
|
19
|
+
if params[:format]
|
20
|
+
respond_to do |format|
|
21
|
+
format.all do
|
22
|
+
if @document.will_export_as @format
|
23
|
+
send_data @document.export_as(@format), type: @document.export_formats[@format][:content_type], disposition: 'inline'
|
24
|
+
end
|
25
|
+
end
|
30
26
|
end
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
# Uses Blacklight.config, needs to be modified when
|
35
|
-
# that changes to be controller-based. This is the only method
|
36
|
-
# in this plugin that accesses Blacklight.config, single point
|
37
|
-
# of contact.
|
38
|
-
def unapi_config
|
39
|
-
self.blacklight_config[:unapi] || {}
|
40
|
-
end
|
41
|
-
|
42
|
-
def unapi_default_export_formats
|
43
|
-
unapi_config
|
27
|
+
else
|
28
|
+
render template: 'catalog/formats.xml'
|
29
|
+
end
|
44
30
|
end
|
45
31
|
|
46
32
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
|
4
|
+
module BlacklightUnapi
|
5
|
+
class Install < Rails::Generators::Base
|
6
|
+
include Rails::Generators::Migration
|
7
|
+
source_root File.expand_path('../templates', __FILE__)
|
8
|
+
|
9
|
+
|
10
|
+
argument :controller_name, :type => :string, :default => "CatalogController"
|
11
|
+
|
12
|
+
def inject_catalog_controller_extension
|
13
|
+
file_path = "app/controllers/#{controller_name.underscore}.rb"
|
14
|
+
if File.exists? file_path
|
15
|
+
inject_into_file file_path, :after => "include Blacklight::Catalog" do
|
16
|
+
"\n include BlacklightUnapi::ControllerExtension\n"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def inject_unapi_configuration
|
22
|
+
insert_into_file 'app/controllers/catalog_controller.rb', :after => "config.spell_max = 5\n" do <<-EOF
|
23
|
+
|
24
|
+
# Add documents to the list of object formats that are supported for all objects.
|
25
|
+
# This parameter is a hash, identical to the Blacklight::Solr::Document#export_formats
|
26
|
+
# output; keys are format short-names that can be exported. Hash includes:
|
27
|
+
# :content-type => mime-content-type
|
28
|
+
|
29
|
+
config.unapi = {
|
30
|
+
'oai_dc_xml' => { :content_type => 'text/xml' }
|
31
|
+
}
|
32
|
+
config.index.partials << 'microformat'
|
33
|
+
config.show.partials << 'microformat'
|
34
|
+
EOF
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Unapi", type: :feature do
|
4
|
+
|
5
|
+
it "should have an abbr tag for the unapi id" do
|
6
|
+
visit catalog_index_path(q: 'medicine')
|
7
|
+
|
8
|
+
expect(page).to have_selector 'abbr.unapi-id'
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should have an autodiscovery link" do
|
12
|
+
visit catalog_index_path(q: 'medicine')
|
13
|
+
expect(page).to have_selector 'link[rel="unapi-server"]', visible: false
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should have unapi formats content" do
|
17
|
+
visit unapi_path
|
18
|
+
expect(page).to have_selector "format[name='oai_dc_xml']"
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should have unapi document-specific formats content" do
|
22
|
+
visit unapi_path id: 2008308201
|
23
|
+
expect(page).to have_selector "format[name='oai_dc_xml']"
|
24
|
+
expect(page).to have_selector "format[name='dc_xml']"
|
25
|
+
expect(page).to have_selector "format[name='xml']"
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should deliver the document format" do
|
29
|
+
visit unapi_path id: 2008308201, format: 'xml'
|
30
|
+
expect(page).to have_selector 'dc'
|
31
|
+
end
|
32
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
ENV["RAILS_ENV"] ||= 'test'
|
2
|
+
|
3
|
+
require 'engine_cart'
|
4
|
+
EngineCart.load_application!
|
5
|
+
|
6
|
+
require 'rspec/rails'
|
7
|
+
|
8
|
+
require 'capybara/poltergeist'
|
9
|
+
Capybara.javascript_driver = :poltergeist
|
10
|
+
|
11
|
+
require 'blacklight'
|
12
|
+
require 'blacklight_unapi'
|
13
|
+
|
14
|
+
RSpec.configure do |c|
|
15
|
+
c.infer_spec_type_from_file_location!
|
16
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
class TestAppGenerator < Rails::Generators::Base
|
4
|
+
source_root File.expand_path("../../../../test_app_templates", __FILE__)
|
5
|
+
|
6
|
+
def remove_index
|
7
|
+
remove_file "public/index.html"
|
8
|
+
end
|
9
|
+
|
10
|
+
def run_blacklight_generator
|
11
|
+
say_status("warning", "GENERATING BL", :yellow)
|
12
|
+
|
13
|
+
Bundler.with_clean_env do
|
14
|
+
run "bundle install"
|
15
|
+
end
|
16
|
+
|
17
|
+
generate 'blacklight:install'
|
18
|
+
end
|
19
|
+
|
20
|
+
def run_gallery_install
|
21
|
+
generate 'blacklight_unapi:install'
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
metadata
CHANGED
@@ -1,93 +1,192 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight_unapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Chris Beer
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-01-14 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rails
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version: '
|
19
|
+
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
26
|
+
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: blacklight
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version: '
|
33
|
+
version: '5.0'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version: '
|
40
|
+
version: '5.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.5'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.5'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec-rails
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.1'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.1'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: jettywrapper
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: engine_cart
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: capybara
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: poltergeist
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 1.5.0
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 1.5.0
|
46
139
|
description:
|
47
140
|
email:
|
48
|
-
-
|
141
|
+
- chris@cbeer.info
|
49
142
|
executables: []
|
50
143
|
extensions: []
|
51
144
|
extra_rdoc_files: []
|
52
145
|
files:
|
146
|
+
- ".gitignore"
|
147
|
+
- ".travis.yml"
|
148
|
+
- Gemfile
|
53
149
|
- MIT-LICENSE
|
54
150
|
- README.rdoc
|
55
151
|
- Rakefile
|
56
152
|
- VERSION
|
57
153
|
- app/helpers/blacklight_unapi_helper.rb
|
58
|
-
- app/views/
|
59
|
-
- app/views/
|
154
|
+
- app/views/catalog/_microformat_default.html.erb
|
155
|
+
- app/views/catalog/formats.xml.builder
|
60
156
|
- blacklight_unapi.gemspec
|
61
157
|
- config/routes.rb
|
62
158
|
- lib/blacklight_unapi.rb
|
63
159
|
- lib/blacklight_unapi/controller_extension.rb
|
64
160
|
- lib/blacklight_unapi/engine.rb
|
65
|
-
- lib/blacklight_unapi/route_sets.rb
|
66
161
|
- lib/blacklight_unapi/version.rb
|
67
|
-
- lib/blacklight_unapi/
|
68
|
-
-
|
162
|
+
- lib/generators/blacklight_unapi/install_generator.rb
|
163
|
+
- spec/features/integration_spec.rb
|
164
|
+
- spec/spec_helper.rb
|
165
|
+
- spec/test_app_templates/lib/generators/test_app_generator.rb
|
69
166
|
homepage: http://projectblacklight.org/
|
70
167
|
licenses: []
|
168
|
+
metadata: {}
|
71
169
|
post_install_message:
|
72
170
|
rdoc_options: []
|
73
171
|
require_paths:
|
74
172
|
- lib
|
75
173
|
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
-
none: false
|
77
174
|
requirements:
|
78
|
-
- -
|
175
|
+
- - ">="
|
79
176
|
- !ruby/object:Gem::Version
|
80
177
|
version: '0'
|
81
178
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
|
-
none: false
|
83
179
|
requirements:
|
84
|
-
- -
|
180
|
+
- - ">="
|
85
181
|
- !ruby/object:Gem::Version
|
86
182
|
version: '0'
|
87
183
|
requirements: []
|
88
|
-
rubyforge_project:
|
89
|
-
rubygems_version:
|
184
|
+
rubyforge_project:
|
185
|
+
rubygems_version: 2.4.5
|
90
186
|
signing_key:
|
91
|
-
specification_version:
|
187
|
+
specification_version: 4
|
92
188
|
summary: Blacklight unapi plugin
|
93
|
-
test_files:
|
189
|
+
test_files:
|
190
|
+
- spec/features/integration_spec.rb
|
191
|
+
- spec/spec_helper.rb
|
192
|
+
- spec/test_app_templates/lib/generators/test_app_generator.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= content_tag :abbr, '', :class => 'unapi-id', :title => document.id %>
|
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'rails/generators'
|
2
|
-
require 'rails/generators/base'
|
3
|
-
require 'rails/generators/migration'
|
4
|
-
|
5
|
-
class BlacklightUnapiGenerator < Rails::Generators::Base
|
6
|
-
include Rails::Generators::Migration
|
7
|
-
source_root File.expand_path('../templates', __FILE__)
|
8
|
-
|
9
|
-
|
10
|
-
argument :controller_name, :type => :string, :default => "CatalogController"
|
11
|
-
|
12
|
-
def inject_catalog_controller_extension
|
13
|
-
file_path = "app/controllers/#{controller_name.underscore}.rb"
|
14
|
-
if File.exists? file_path
|
15
|
-
inject_into_file file_path, :after => "include Blacklight::Catalog" do
|
16
|
-
"\n include BlacklightUnapi::ControllerExtension\n"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def inject_unapi_configuration
|
22
|
-
insert_into_file 'config/initializers/blacklight_config.rb', :after => "config[:spell_max] = 5\n" do <<EOF
|
23
|
-
|
24
|
-
# Add documents to the list of object formats that are supported for all objects.
|
25
|
-
# This parameter is a hash, identical to the Blacklight::Solr::Document#export_formats
|
26
|
-
# output; keys are format short-names that can be exported. Hash includes:
|
27
|
-
# :content-type => mime-content-type
|
28
|
-
|
29
|
-
config[:unapi] = {
|
30
|
-
'oai_dc_xml' => { :content_type => 'text/xml' }
|
31
|
-
}
|
32
|
-
EOF
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|