blacklight 4.5.0.rc1 → 4.5.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: 8939b4f8da0fd45881552613dba681ddcec93083
4
- data.tar.gz: 6207de54f96ee4794e2c051f0086691575d4fea4
3
+ metadata.gz: 0d0587369df20fe60865e7e145ee2331b24bb10e
4
+ data.tar.gz: 45af7e3cca647a11de41d7d87c5b9d29bfe84585
5
5
  SHA512:
6
- metadata.gz: 146016cf9d6b18fd08741e700a1be242d25adc78d83a8a299dbad03443a7b0f8c83d852e1f88b447442e24bd2dfd8cf92abdf47e323c7d26dfbae7d6950c70b4
7
- data.tar.gz: 10b7fe255b81f6e4effdb5d2199478c4c8c2b8f702f0e21661ea2130fb3eea7714cacee66dc9ab4a58c808d934dadd307c2fcc521b1f038087372e0bcdbd1681
6
+ metadata.gz: 6e3916a1be5e25e6d1455de5a76bdea0102fada96d69e1ccb182b8e674d45968f36509f25e2a163e6533d3ef3caa65474867aa91ece5de100eb54674b156ec4e
7
+ data.tar.gz: db866f3d02c5a0e8b2a9a5c773c999308cb8f68fdd3cf79d366efecaefd2e41b279df6774ee5f5237a6097bf7ee122be82d5ab8b63f353012cd52e2bf4293b5b
data/Rakefile CHANGED
@@ -7,11 +7,12 @@ rescue LoadError
7
7
  end
8
8
 
9
9
  Bundler::GemHelper.install_tasks
10
+ require 'rspec/core/rake_task'
11
+ RSpec::Core::RakeTask.new(:spec)
10
12
 
11
13
  # load rake tasks defined in lib/tasks that are not loaded in lib/active_fedora.rb
12
14
  load "tasks/blacklight.rake"
13
15
 
14
16
  task :default => [:ci]
15
- task :spec => ['blacklight:spec']
16
17
  task :clean => ['blacklight:clean']
17
18
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.5.0.rc1
1
+ 4.5.0
@@ -189,7 +189,7 @@ module Blacklight::BlacklightHelperBehavior
189
189
  value = options[:value] || get_field_values(document, field, field_config, options)
190
190
 
191
191
 
192
- render_field_value value
192
+ render_field_value value, field_config
193
193
  end
194
194
 
195
195
  # Used in the show view for displaying the main solr document heading
@@ -312,7 +312,7 @@ module Blacklight::BlacklightHelperBehavior
312
312
  field_config = document_show_fields(document)[field]
313
313
  value = options[:value] || get_field_values(document, field, field_config, options)
314
314
 
315
- render_field_value value
315
+ render_field_value value, field_config
316
316
  end
317
317
 
318
318
  ##
@@ -335,7 +335,7 @@ module Blacklight::BlacklightHelperBehavior
335
335
  end
336
336
 
337
337
  Array(document.get(field, :sep => nil)).map do |v|
338
- link_to render_field_value(v), search_action_url(add_facet_params(link_field, v, {}))
338
+ link_to render_field_value(v, field_config), search_action_url(add_facet_params(link_field, v, {}))
339
339
  end if field
340
340
  when (field_config and field_config.highlight)
341
341
  document.highlight_field(field_config.field).map { |x| x.html_safe } if document.has_highlight_field? field_config.field
@@ -349,10 +349,9 @@ module Blacklight::BlacklightHelperBehavior
349
349
  (document.has_highlight_field? solr_field.field if solr_field.highlight)
350
350
  end
351
351
 
352
- def render_field_value value=nil
353
- value = [value] unless value.is_a? Array
354
- value = value.collect { |x| x.respond_to?(:force_encoding) ? x.force_encoding("UTF-8") : x}
355
- return value.map { |v| html_escape v }.join(field_value_separator).html_safe
352
+ def render_field_value value=nil, field_config=nil
353
+ safe_values = Array(value).collect { |x| x.respond_to?(:force_encoding) ? x.force_encoding("UTF-8") : x }
354
+ safe_join(safe_values, (field_config.separator if field_config) || field_value_separator)
356
355
  end
357
356
 
358
357
  def field_value_separator
data/blacklight.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.homepage = "http://projectblacklight.org/"
11
11
  s.summary = "Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr) index."
12
12
  s.description = %q{Blacklight is an open source Solr user interface discovery platform. You can use Blacklight to enable searching and browsing of your collections. Blacklight uses the Apache Solr search engine to search full text and/or metadata.}
13
-
13
+ s.license = "Apache 2.0"
14
14
  s.rubyforge_project = "blacklight"
15
15
 
16
16
  s.files = `git ls-files`.split("\n")
@@ -31,4 +31,5 @@ Gem::Specification.new do |s|
31
31
  s.add_dependency "bootstrap-sass", ">= 2.2.0", "< 2.4"
32
32
  s.add_development_dependency "jettywrapper", ">= 1.4.1"
33
33
  s.add_development_dependency "rspec-rails"
34
+ s.add_development_dependency 'engine_cart', ">= 0.1.0"
34
35
  end
@@ -8,10 +8,15 @@ gem 'simplecov-rcov', :platform => :mri
8
8
 
9
9
  gem 'rails', "~> 3.2"
10
10
 
11
+ gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
12
+
11
13
  group :test do
12
14
  gem 'devise'
15
+ gem 'devise-guests'
13
16
  gem "bootstrap-sass"
14
17
  gem 'turbolinks'
18
+ gem 'uglifier'
19
+ gem 'poltergeist'
15
20
  gem "unicode", :platforms => [:mri_18, :mri_19]
16
21
  end
17
22
 
@@ -8,10 +8,14 @@ gem 'simplecov-rcov', :platform => :mri
8
8
 
9
9
  gem 'rails', '~> 4.0.0'
10
10
 
11
+ gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
12
+
11
13
  group :test do
12
14
  gem 'devise'
15
+ gem 'devise-guests'
13
16
  gem "bootstrap-sass"
14
17
  gem 'turbolinks'
18
+ gem 'poltergeist'
15
19
  gem "unicode", :platforms => [:mri_18, :mri_19]
16
20
  end
17
21
 
@@ -679,4 +679,19 @@ describe BlacklightHelper do
679
679
  describe "render_grouped_document_index" do
680
680
 
681
681
  end
682
+
683
+ describe "render_field_value" do
684
+ it "should join and html-safe values" do
685
+ expect(helper.render_field_value(['a', 'b'])).to eq "a, b"
686
+ end
687
+
688
+ it "should join values using the field_value_separator" do
689
+ helper.stub(:field_value_separator).and_return(" -- ")
690
+ expect(helper.render_field_value(['a', 'b'])).to eq "a -- b"
691
+ end
692
+
693
+ it "should use the separator from the Blacklight field configuration by default" do
694
+ expect(helper.render_field_value(['c', 'd'], double(:separator => '; '))).to eq "c; d"
695
+ end
696
+ end
682
697
  end
data/spec/spec_helper.rb CHANGED
@@ -16,9 +16,8 @@ if ENV['COVERAGE'] and RUBY_VERSION =~ /^1.9/ and ruby_engine != "jruby"
16
16
  end
17
17
  end
18
18
 
19
- # version that works with our blacklight:spec stuff that calls specs
20
- # in a remote directory.
21
- require File.expand_path("config/environment", ENV['RAILS_ROOT'] || File.expand_path("../internal", __FILE__))
19
+ require 'engine_cart'
20
+ EngineCart.load_application!
22
21
 
23
22
  require 'rspec/rails'
24
23
  require 'capybara/rspec'
@@ -1,12 +1,7 @@
1
1
  ZIP_URL = "https://github.com/projectblacklight/blacklight-jetty/archive/v4.0.0.zip"
2
- APP_ROOT = File.expand_path("../..", __FILE__)
3
-
4
- TEST_APP_TEMPLATES = 'spec/test_app_templates'
5
- TEST_APP = 'spec/internal'
6
2
 
7
3
  require 'jettywrapper'
8
- require 'rspec/core/rake_task'
9
-
4
+ require 'engine_cart/rake_task'
10
5
 
11
6
  task :ci => 'jetty:clean' do
12
7
  ENV['environment'] = "test"
@@ -30,61 +25,18 @@ namespace :blacklight do
30
25
  end
31
26
  end
32
27
 
33
-
34
28
  desc "Run tests with coverage"
35
29
  task :coverage do
36
30
  ENV['COVERAGE'] = 'true'
37
- Rake::Task["blacklight:spec"].invoke
38
- end
39
-
40
- desc "Run specs"
41
- task :spec => [:generate] do |t|
42
- spec_options = ENV['SPEC'] ? " SPEC=#{File.join(GEM_ROOT, ENV['SPEC'])}" : ''
43
- within_test_app do
44
- system "rake blacklight_test_app:spec#{spec_options}"
45
- abort "Error running spec" unless $?.success?
46
- end
31
+ Rake::Task["spec"].invoke
47
32
  end
48
33
 
49
34
  desc "Clean out the test rails app"
50
- task :clean do
51
- puts "Removing sample rails app"
52
- `rm -rf #{TEST_APP}`
35
+ task :clean => ['engine_cart:clean'] do
53
36
  end
54
37
 
55
38
  desc "Create the test rails app"
56
- task :generate do
57
- unless File.exists?('spec/internal/Rakefile')
58
- puts "Generating rails app"
59
- `rails new #{TEST_APP}`
60
- puts "Copying gemfile"
61
- open("#{TEST_APP}/Gemfile", 'a') do |f|
62
- f.write File.read(TEST_APP_TEMPLATES + "/Gemfile.extra")
63
- f.write "gem 'blacklight', :path => '../../'"
64
- end
65
- puts "Copying generator"
66
- `cp -r #{TEST_APP_TEMPLATES}/lib/generators #{TEST_APP}/lib`
67
- within_test_app do
68
- puts "Bundle install"
69
- `bundle install`
70
- puts "running test_app_generator"
71
- system "rails generate test_app"
72
-
73
- puts "running migrations"
74
- puts `rake db:migrate db:test:prepare`
75
- end
76
- end
77
- puts "Done generating test app"
39
+ task :generate => ['engine_cart:generate'] do
78
40
  end
79
-
80
-
81
-
82
41
  end
83
42
 
84
- def within_test_app
85
- FileUtils.cd(TEST_APP)
86
- Bundler.with_clean_env do
87
- yield
88
- end
89
- FileUtils.cd(APP_ROOT)
90
- end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.5.0.rc1
4
+ version: 4.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Rochkind
@@ -17,7 +17,7 @@ authors:
17
17
  autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
- date: 2013-10-18 00:00:00.000000000 Z
20
+ date: 2013-10-24 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rails
@@ -163,6 +163,20 @@ dependencies:
163
163
  - - '>='
164
164
  - !ruby/object:Gem::Version
165
165
  version: '0'
166
+ - !ruby/object:Gem::Dependency
167
+ name: engine_cart
168
+ requirement: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - '>='
171
+ - !ruby/object:Gem::Version
172
+ version: 0.1.0
173
+ type: :development
174
+ prerelease: false
175
+ version_requirements: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - '>='
178
+ - !ruby/object:Gem::Version
179
+ version: 0.1.0
166
180
  description: Blacklight is an open source Solr user interface discovery platform.
167
181
  You can use Blacklight to enable searching and browsing of your collections. Blacklight
168
182
  uses the Apache Solr search engine to search full text and/or metadata.
@@ -481,7 +495,8 @@ files:
481
495
  - tasks/blacklight.rake
482
496
  - test_support/data/test_data.utf8.mrc
483
497
  homepage: http://projectblacklight.org/
484
- licenses: []
498
+ licenses:
499
+ - Apache 2.0
485
500
  metadata: {}
486
501
  post_install_message:
487
502
  rdoc_options: []
@@ -494,12 +509,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
494
509
  version: '0'
495
510
  required_rubygems_version: !ruby/object:Gem::Requirement
496
511
  requirements:
497
- - - '>'
512
+ - - '>='
498
513
  - !ruby/object:Gem::Version
499
- version: 1.3.1
514
+ version: '0'
500
515
  requirements: []
501
516
  rubyforge_project: blacklight
502
- rubygems_version: 2.1.7
517
+ rubygems_version: 2.0.3
503
518
  signing_key:
504
519
  specification_version: 4
505
520
  summary: Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr)