blacklight-marc 5.0.0 → 5.4.0

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: 1d908859e48042b0e0b642132ae5ddfbf981897f
4
- data.tar.gz: 8120bcb5ea2d3d1735bde7396193e5dfc1aa68d4
3
+ metadata.gz: 0f0fb70263ceb51ccdd8cd3d861101dbc74bf1df
4
+ data.tar.gz: 7ef0b31a16dbcaafa8a4afa3c09c523f766e00aa
5
5
  SHA512:
6
- metadata.gz: 9c4e5a0134edfbe5f648dab763a857df5e7797cf664f607379ce6e45e2170b1b7a5279a2482706f88337d4c5d3e3ea6d6fef400016e2b4a9e3cb7e9a3b6d9495
7
- data.tar.gz: ced6d727659b9f0e2bad8f969d5f840a7a614f50fc8c65c660024768f4a9ae7c041fad71f625729b0b7076938881bc5469ff9f4b9b1058170a89ea2ba6eacadd
6
+ metadata.gz: 77bdd9fd66ca82d8f11fcde0c392105327772ba0eb44bc665aa9c868ad3df7d8e96f0a836139519055e74dfdcc42349ed573b061c3a91b357e944eb4af605389
7
+ data.tar.gz: 23bdcd829106648025d26239dd506ccbde04901707cf46ee354d3ea8bff32f25cee9bc3bbdb43e383fea4ad1dc4bd8779d97a12d1d5bc6f44203b9d833598ba8
data/.travis.yml CHANGED
@@ -2,7 +2,7 @@ notifications:
2
2
  email: false
3
3
 
4
4
  rvm:
5
- - 2.1.0
5
+ - 2.1.1
6
6
  - 2.0.0
7
7
  - 1.9.3
8
8
  - jruby-19mode
data/Gemfile CHANGED
@@ -1,15 +1,27 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in blacklight_marc.gemspec
4
- gemspec
3
+ # Please see blacklight_marc.gemspec for dependency information.
4
+ gemspec path: File.expand_path('..', __FILE__)
5
+
6
+
7
+ # Peg simplecov to < 0.8 until this is resolved:
8
+ # https://github.com/colszowka/simplecov/issues/281
9
+ gem 'simplecov', '~> 0.7.1', require: false
10
+ gem 'coveralls', require: false
11
+
12
+ gem 'engine_cart', '~> 0.3.0'
13
+
14
+ # pin to known-working versions of rails and dependencies
15
+ gem 'rails', '4.0.4'
16
+ gem 'sass', '~> 3.2.15'
17
+ gem 'sprockets', '~> 2.11.0'
5
18
 
6
19
  group :test do
7
- gem 'devise'
8
- gem "bootstrap-sass"
9
- gem 'turbolinks'
10
20
  gem 'activerecord-jdbcsqlite3-adapter', :platforms => :jruby
11
21
  end
12
22
 
13
- if File.exists?('spec/test_app_templates/Gemfile.extra')
14
- eval File.read('spec/test_app_templates/Gemfile.extra'), nil, 'spec/test_app_templates/Gemfile.extra'
23
+ file = File.expand_path("Gemfile", ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path("../spec/internal", __FILE__))
24
+ if File.exists?(file)
25
+ puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
26
+ instance_eval File.read(file)
15
27
  end
data/Rakefile CHANGED
@@ -1,21 +1,16 @@
1
1
  require "bundler/gem_tasks"
2
2
  ZIP_URL = "https://github.com/projectblacklight/blacklight-jetty/archive/v4.0.0.zip"
3
- APP_ROOT = File.expand_path("..", __FILE__)
4
-
5
- TEST_APP_TEMPLATES = 'spec/test_app_templates'
6
- TEST_APP = 'spec/internal'
7
3
 
8
4
  require 'jettywrapper'
9
5
  require 'rspec/core/rake_task'
6
+ require 'engine_cart/rake_task'
10
7
 
11
8
  RSpec::Core::RakeTask.new(:spec)
12
9
 
13
10
  task :default => [:ci]
14
11
 
15
- task :ci => ['blacklight_marc:generate', 'jetty:clean'] do
16
- ENV['environment'] = "test"
17
- jetty_params = Jettywrapper.load_config
18
- jetty_params[:startup_wait]= 60
12
+ task :ci => ['blacklight_marc:clean', 'blacklight_marc:generate'] do
13
+ jetty_params = Jettywrapper.load_config('test')
19
14
  error = Jettywrapper.wrap(jetty_params) do
20
15
  Rake::Task["blacklight_marc:fixtures"].invoke
21
16
  Rake::Task['spec'].invoke
@@ -34,35 +29,11 @@ namespace :blacklight_marc do
34
29
  end
35
30
  end
36
31
 
37
- desc "Create the test rails app"
38
- task :generate do
39
- unless File.exists?('spec/internal/Rakefile')
40
- puts "Generating rails app"
41
- `rails new #{TEST_APP}`
42
- puts "Copying gemfile"
43
- open("#{TEST_APP}/Gemfile", 'a') do |f|
44
- f.write File.read(TEST_APP_TEMPLATES + "/Gemfile.extra")
45
- f.write "gem 'blacklight-marc', :path => '../../'"
46
- end
47
- puts "Copying generator"
48
- `cp -r #{TEST_APP_TEMPLATES}/lib/generators #{TEST_APP}/lib`
49
- within_test_app do
50
- puts "Bundle install"
51
- `bundle install`
52
- puts "running test_app_generator"
53
- system "rails generate test_app"
54
-
55
- puts "running migrations"
56
- puts `rake db:migrate db:test:prepare`
57
- end
58
- end
59
- puts "Done generating test app"
32
+ desc "Clean out the test rails app"
33
+ task :clean => ['engine_cart:clean', 'jetty:clean'] do
60
34
  end
61
- end
62
- def within_test_app
63
- FileUtils.cd(TEST_APP)
64
- Bundler.with_clean_env do
65
- yield
35
+
36
+ desc "Create the test rails app"
37
+ task :generate => ['engine_cart:generate'] do
66
38
  end
67
- FileUtils.cd(APP_ROOT)
68
39
  end
@@ -0,0 +1,3 @@
1
+ module BlacklightBookmarksHelper
2
+
3
+ end
@@ -1,11 +1,11 @@
1
1
  module BlacklightMarcHelper
2
-
2
+
3
3
  # puts together a collection of documents into one refworks export string
4
4
  def render_refworks_texts(documents)
5
5
  val = ''
6
6
  documents.each do |doc|
7
- if doc.respond_to?(:to_marc)
8
- val += doc.export_as_refworks_marc_txt + "\n"
7
+ if doc.exports_as? :refworks_marc_txt
8
+ val += doc.export_as(:refworks_marc_txt) + "\n"
9
9
  end
10
10
  end
11
11
  val
@@ -15,8 +15,8 @@ module BlacklightMarcHelper
15
15
  def render_endnote_texts(documents)
16
16
  val = ''
17
17
  documents.each do |doc|
18
- if doc.respond_to?(:to_marc)
19
- val += doc.export_as_endnote + "\n"
18
+ if doc.exports_as? :endnote
19
+ val += doc.export_as(:endnote) + "\n"
20
20
  end
21
21
  end
22
22
  val
@@ -1,3 +1,5 @@
1
- <li class="endnote">
2
- <%= link_to t('blacklight.tools.endnote'), endnote_catalog_path(:sort=>params[:sort], :per_page=>params[:per_page], :id => @bookmarks.collect {|doc| doc.document_id}, :format => 'endnote'), {:class => 'btn btn-default'}%>
3
- </li>
1
+ <% if @document_list.any? {|d| d.exports_as? :endnote } %>
2
+ <li class="endnote">
3
+ <%= link_to t('blacklight.tools.endnote'), bookmarks_path(:endnote, params_for_search), :class => "btn btn-default", :id => "endnoteLink" %>
4
+ </li>
5
+ <% end %>
@@ -0,0 +1,2 @@
1
+ <%= render 'endnote' %>
2
+ <%= render 'refworks' %>
@@ -1,3 +1,5 @@
1
- <li class="refworks">
2
- <%= render :partial => 'catalog/refworks_form', :locals => {:documents=>@document_list} %>
3
- </li>
1
+ <% if @document_list.any? {|d| d.exports_as? :refworks_marc_txt } %>
2
+ <li class="refworks">
3
+ <%= link_to t('blacklight.tools.refworks'), refworks_export_url(url: bookmarks_export_url(:refworks_marc_txt, params_for_search)), :class => "btn btn-default", :id => "refworksLink" %>
4
+ </li>
5
+ <% end %>
@@ -17,13 +17,14 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_dependency "blacklight", "~> 5.0"
20
+ spec.add_dependency "blacklight", ">= 5.4.0.rc1", "< 6.0"
21
21
 
22
22
  spec.add_development_dependency "bundler", "~> 1.3"
23
23
  spec.add_development_dependency "rake"
24
24
  spec.add_development_dependency "rspec"
25
25
  spec.add_development_dependency "rspec-rails"
26
26
  spec.add_development_dependency "jettywrapper"
27
+ spec.add_development_dependency "capybara"
27
28
  spec.add_dependency "rails"
28
29
  # Let's allow future versions of marc, count on
29
30
  # them to be backwards compat until 1.1
@@ -1,5 +1,5 @@
1
1
  module Blacklight
2
2
  module Marc
3
- VERSION = "5.0.0"
3
+ VERSION = "5.4.0"
4
4
  end
5
5
  end
@@ -11,20 +11,19 @@ class TestAppGenerator < Rails::Generators::Base
11
11
  end
12
12
  end
13
13
 
14
- def copy_blacklight_test_app_rake_task
15
- copy_file "lib/tasks/blacklight_test_app.rake"
16
- end
17
-
18
14
  def remove_index
19
15
  remove_file "public/index.html"
20
- remove_file 'app/assets/images/rails.png'
21
16
  end
22
-
17
+
23
18
  def run_blacklight_generator
24
19
  say_status("warning", "GENERATING BL", :yellow)
20
+ gem 'blacklight', "5.4.0"
25
21
 
26
- generate 'blacklight:install'
27
- generate 'blacklight_marc:marc'
22
+ Bundler.with_clean_env do
23
+ run "bundle install"
24
+ end
25
+
26
+ generate 'blacklight:install', '--devise --jettywrapper'
28
27
  end
29
28
 
30
29
  def run_test_support_generator
@@ -32,4 +31,8 @@ class TestAppGenerator < Rails::Generators::Base
32
31
 
33
32
  generate 'blacklight:test_support'
34
33
  end
34
+
35
+ def run_blacklight_marc_generator
36
+ generate 'blacklight_marc:marc'
37
+ end
35
38
  end
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe 'bookmarks/_endnote.html.erb' do
4
4
  it "should have a link" do
5
- assign(:bookmarks, [mock_model(Bookmark, document_id: 7), mock_model(Bookmark, document_id: 8)])
5
+ assign(:document_list, [mock_model(Bookmark, document_id: 7, exports_as?: true), mock_model(Bookmark, document_id: 8, exports_as?: true)])
6
6
  render
7
7
  expect(rendered).to have_link "Export to EndNote"
8
8
  end
@@ -2,9 +2,10 @@ require 'spec_helper'
2
2
 
3
3
  describe 'bookmarks/_refworks.html.erb' do
4
4
  it "should have a link" do
5
- assign(:document_list, [mock_model(Bookmark, document_id: 7), mock_model(Bookmark, document_id: 8)])
5
+ view.stub(encrypt_user_id: 1)
6
+ view.stub(current_or_guest_user: mock_model(User))
7
+ assign(:document_list, [mock_model(Bookmark, document_id: 7, exports_as?: true), mock_model(Bookmark, document_id: 8, exports_as?: true)])
6
8
  render
7
- expect(rendered).to have_button "Export to Refworks"
9
+ expect(rendered).to have_link "Export to Refworks"
8
10
  end
9
11
  end
10
-
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-marc
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-05 00:00:00.000000000 Z
11
+ date: 2014-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: blacklight
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 5.4.0.rc1
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: '5.0'
22
+ version: '6.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
- version: '5.0'
29
+ version: 5.4.0.rc1
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '6.0'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: bundler
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +100,20 @@ dependencies:
94
100
  - - ">="
95
101
  - !ruby/object:Gem::Version
96
102
  version: '0'
103
+ - !ruby/object:Gem::Dependency
104
+ name: capybara
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
97
117
  - !ruby/object:Gem::Dependency
98
118
  name: rails
99
119
  requirement: !ruby/object:Gem::Requirement
@@ -141,8 +161,10 @@ files:
141
161
  - LICENSE
142
162
  - README.md
143
163
  - Rakefile
164
+ - app/helpers/blacklight_bookmarks_helper.rb
144
165
  - app/helpers/blacklight_marc_helper.rb
145
166
  - app/views/bookmarks/_endnote.html.erb
167
+ - app/views/bookmarks/_marc_tools.html.erb
146
168
  - app/views/bookmarks/_refworks.html.erb
147
169
  - app/views/catalog/_marc_view.html.erb
148
170
  - app/views/catalog/endnote.endnote.erb
@@ -184,9 +206,7 @@ files:
184
206
  - spec/lib/tasks/solr_marc_task_spec.rb
185
207
  - spec/routing/routes_spec.rb
186
208
  - spec/spec_helper.rb
187
- - spec/test_app_templates/Gemfile.extra
188
209
  - spec/test_app_templates/lib/generators/test_app_generator.rb
189
- - spec/test_app_templates/lib/tasks/blacklight_test_app.rake
190
210
  - spec/views/bookmarks/_endnote.html.erb_spec.rb
191
211
  - spec/views/bookmarks/_refworks.html.erb_spec.rb
192
212
  - test_support/data/test_data.utf8.mrc
@@ -210,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
210
230
  version: '0'
211
231
  requirements: []
212
232
  rubyforge_project:
213
- rubygems_version: 2.2.0
233
+ rubygems_version: 2.2.2
214
234
  signing_key:
215
235
  specification_version: 4
216
236
  summary: MARC support for Blacklight
@@ -224,8 +244,6 @@ test_files:
224
244
  - spec/lib/tasks/solr_marc_task_spec.rb
225
245
  - spec/routing/routes_spec.rb
226
246
  - spec/spec_helper.rb
227
- - spec/test_app_templates/Gemfile.extra
228
247
  - spec/test_app_templates/lib/generators/test_app_generator.rb
229
- - spec/test_app_templates/lib/tasks/blacklight_test_app.rake
230
248
  - spec/views/bookmarks/_endnote.html.erb_spec.rb
231
249
  - spec/views/bookmarks/_refworks.html.erb_spec.rb
@@ -1,21 +0,0 @@
1
- platforms :jruby do
2
- gem 'jdbc-sqlite3'
3
- gem 'mediashelf-loggable', '>= 0.4.8'
4
- gem 'therubyrhino'
5
- end
6
-
7
- platforms :ruby do
8
- gem 'sqlite3'
9
- end
10
-
11
- gem 'jquery-rails'
12
-
13
- group :test do
14
- gem 'rspec-rails', '~> 2.13'
15
- gem 'generator_spec'
16
- gem 'capybara'
17
- gem 'simplecov', :platform => :mri_19
18
- end
19
-
20
- gem 'blacklight' #, github: 'projectblacklight/blacklight'
21
- gem 'jettywrapper', '>= 1.2.0'
@@ -1,14 +0,0 @@
1
- require 'rspec/core/rake_task'
2
-
3
- desc "run the blacklight gem spec"
4
- gem_home = File.expand_path('../../../../..', __FILE__)
5
-
6
- namespace :blacklight_test_app do
7
-
8
- RSpec::Core::RakeTask.new(:spec) do |t|
9
- t.pattern = gem_home + '/spec/**/*_spec.rb'
10
- t.rspec_opts = "--colour"
11
- t.ruby_opts = "-I#{gem_home}/spec"
12
- end
13
-
14
- end