blacklight-gallery 0.4.0 → 0.4.1

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: ffbe838ae6acb0682381c6675b8f83d379241cba
4
- data.tar.gz: ae99ff328fbc8528374b32533c0763893c499fa9
3
+ metadata.gz: a53aff88a47da1ba281d332cd1daea53020e37b4
4
+ data.tar.gz: 1f81070bc809fe402b42db61a4a54bfe88c866b9
5
5
  SHA512:
6
- metadata.gz: 3fc0b5dc2b4816f8157f3d8024863ed83bff0ddcffffd71933e76f7cac88db4d7b7f54c38be4ea3f6809eda16ff66ddd3dfe1a35361c22784f01cd16387eba4b
7
- data.tar.gz: ce17f6276395d0cb397f958a9b2799b719c3ca42912559d37daa899778b38210d0636d93e26efc9ac710738640bbb2ef872fe2514b024e7511b631793f59ad39
6
+ metadata.gz: cd5380372da4752fe3233febf9477e6308a53caf432a14b3ed954675fbfb9f69377bd08582cfeaaea94006e334e709d5de71d81cd29f659ddf730ee086d4606c
7
+ data.tar.gz: 058d3d596e076e0713ce7ed9c4c74e26f1db0e8dad0ad49078d9c2dfa41d73a1ffa4a276568964db1597f8b06436d4c11f7f3b848bfb2dc8c265ce90c9421f01
data/.gitignore CHANGED
@@ -16,4 +16,5 @@ test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
18
  jetty
19
- spec/internal
19
+ spec/internal
20
+ .internal_test_app
data/Gemfile CHANGED
@@ -5,19 +5,30 @@ gemspec
5
5
 
6
6
  gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
7
7
 
8
- file = File.expand_path("Gemfile", ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path("../spec/internal", __FILE__))
9
- if File.exists?(file)
10
- puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
11
- instance_eval File.read(file)
8
+ # BEGIN ENGINE_CART BLOCK
9
+ # engine_cart: 0.8.0
10
+ # engine_cart stanza: 0.8.0
11
+ # the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
12
+ file = File.expand_path("Gemfile", ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path(".internal_test_app", File.dirname(__FILE__)))
13
+ if File.exist?(file)
14
+ begin
15
+ eval_gemfile file
16
+ rescue Bundler::GemfileError => e
17
+ Bundler.ui.warn '[EngineCart] Skipping Rails application dependencies:'
18
+ Bundler.ui.warn e.message
19
+ end
12
20
  else
13
- gem 'rails', ENV['RAILS_VERSION']
21
+ Bundler.ui.warn "[EngineCart] Unable to find test application dependencies in #{file}, using placeholder dependencies"
22
+
23
+ gem 'rails', ENV['RAILS_VERSION'] if ENV['RAILS_VERSION']
14
24
 
15
- # explicitly include sass-rails to get compatible sprocket dependencies
16
- if ENV['RAILS_VERSION'] and ENV['RAILS_VERSION'] =~ /^4.2/
17
- gem 'sass-rails', ">= 5.0.0"
25
+ if ENV['RAILS_VERSION'].nil? || ENV['RAILS_VERSION'] =~ /^4.2/
26
+ gem 'bootstrap-sass', '>= 3.3.5.1'
18
27
  gem 'responders', "~> 2.0"
28
+ gem 'sass-rails', ">= 5.0"
19
29
  else
20
- gem 'sass-rails', '< 5.0'
21
- gem 'coffee-rails', "~> 4.0.0"
30
+ gem 'bootstrap-sass', '< 3.3.5' # 3.3.5 requires sass 3.3, incompatible with sass-rails 4.x
31
+ gem 'sass-rails', "< 5.0"
22
32
  end
23
- end
33
+ end
34
+ # END ENGINE_CART BLOCK
@@ -1,7 +1,7 @@
1
1
  module Blacklight::Gallery::OpenseadragonSolrDocument
2
- def to_openseadragon view_config = nil
3
- if view_config and view_config.tile_source_field
4
- Array(fetch(view_config.tile_source_field))
5
- end
2
+ def to_openseadragon(view_config = nil)
3
+ return unless view_config.try(:tile_source_field) &&
4
+ fetch(view_config.tile_source_field, nil)
5
+ Array(fetch(view_config.tile_source_field))
6
6
  end
7
7
  end
@@ -18,18 +18,19 @@ Gem::Specification.new do |spec|
18
18
  spec.require_paths = ["lib"]
19
19
 
20
20
  spec.add_dependency "rails"
21
- spec.add_dependency "blacklight", "~> 5.12"
21
+ spec.add_dependency 'blacklight', '>= 5.12', '< 7'
22
22
  spec.add_dependency "bootstrap-sass", "~> 3.0"
23
23
  spec.add_dependency "openseadragon", ">= 0.2.0"
24
24
 
25
25
  spec.add_development_dependency "bundler", "~> 1.5"
26
26
  spec.add_development_dependency "rake"
27
+ spec.add_development_dependency 'sqlite3'
27
28
  spec.add_development_dependency "rspec-rails", "~> 3.1"
28
29
  spec.add_development_dependency "rspec-its"
29
30
  spec.add_development_dependency "rspec-activemodel-mocks"
30
31
  spec.add_development_dependency "rspec-collection_matchers"
31
32
  spec.add_development_dependency "jettywrapper"
32
- spec.add_development_dependency "engine_cart", "~> 0.6"
33
+ spec.add_development_dependency "engine_cart", "~> 0.8"
33
34
  spec.add_development_dependency "capybara"
34
35
  spec.add_development_dependency "poltergeist", ">= 1.5.0"
35
36
  end
@@ -1,5 +1,5 @@
1
1
  module Blacklight
2
2
  module Gallery
3
- VERSION = "0.4.0"
3
+ VERSION = "0.4.1"
4
4
  end
5
5
  end
@@ -0,0 +1,37 @@
1
+ require 'spec_helper'
2
+
3
+ describe Blacklight::Gallery::OpenseadragonSolrDocument do
4
+ subject { SolrDocument.new(fields).to_openseadragon(view_config) }
5
+
6
+ context 'when configured for the view' do
7
+ let(:fields) { { some_field: 'data' } }
8
+ let(:view_config) { double('ViewConfig', tile_source_field: :some_field) }
9
+ it 'returns the data from the document as an array' do
10
+ expect(subject).to eq ['data']
11
+ end
12
+ end
13
+
14
+ context 'when not configured for the view' do
15
+ let(:fields) { { some_field: 'data' } }
16
+ let(:view_config) { double('ViewConfig') }
17
+ it 'returns nil' do
18
+ expect(subject).to be_nil
19
+ end
20
+ end
21
+
22
+ context 'when the document has the field' do
23
+ let(:fields) { { some_field: 'data' } }
24
+ let(:view_config) { double('ViewConfig', tile_source_field: :some_field) }
25
+ it 'returns the data from the document as an array' do
26
+ expect(subject).to eq ['data']
27
+ end
28
+ end
29
+
30
+ context 'when the document does not have the field' do
31
+ let(:fields) { { some_other_field: 'data' } }
32
+ let(:view_config) { double('ViewConfig', tile_source_field: :some_field) }
33
+ it 'returns the data from the document as an array' do
34
+ expect(subject).to be_nil
35
+ end
36
+ end
37
+ end
@@ -1,8 +1,6 @@
1
1
  require 'rails/generators'
2
2
 
3
3
  class TestAppGenerator < Rails::Generators::Base
4
- source_root File.expand_path("../../../../test_app_templates", __FILE__)
5
-
6
4
  def remove_index
7
5
  remove_file "public/index.html"
8
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-gallery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-10 00:00:00.000000000 Z
11
+ date: 2016-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -28,16 +28,22 @@ dependencies:
28
28
  name: blacklight
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '5.12'
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '7'
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
- - - "~>"
41
+ - - ">="
39
42
  - !ruby/object:Gem::Version
40
43
  version: '5.12'
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '7'
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: bootstrap-sass
43
49
  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: sqlite3
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: rspec-rails
99
119
  requirement: !ruby/object:Gem::Requirement
@@ -170,14 +190,14 @@ dependencies:
170
190
  requirements:
171
191
  - - "~>"
172
192
  - !ruby/object:Gem::Version
173
- version: '0.6'
193
+ version: '0.8'
174
194
  type: :development
175
195
  prerelease: false
176
196
  version_requirements: !ruby/object:Gem::Requirement
177
197
  requirements:
178
198
  - - "~>"
179
199
  - !ruby/object:Gem::Version
180
- version: '0.6'
200
+ version: '0.8'
181
201
  - !ruby/object:Gem::Dependency
182
202
  name: capybara
183
203
  requirement: !ruby/object:Gem::Requirement
@@ -258,6 +278,7 @@ files:
258
278
  - spec/features/masonry_spec.rb
259
279
  - spec/features/slideshow_spec.rb
260
280
  - spec/helpers/blacklight/gallery_helper_spec.rb
281
+ - spec/models/concerns/openseadragon_solr_document_spec.rb
261
282
  - spec/spec_helper.rb
262
283
  - spec/test_app_templates/lib/generators/test_app_generator.rb
263
284
  - spec/views/catalog/_document_slideshow.html.erb_spec.rb
@@ -286,7 +307,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
286
307
  version: '0'
287
308
  requirements: []
288
309
  rubyforge_project:
289
- rubygems_version: 2.4.5
310
+ rubygems_version: 2.4.5.1
290
311
  signing_key:
291
312
  specification_version: 4
292
313
  summary: Gallery display for Blacklight
@@ -295,6 +316,7 @@ test_files:
295
316
  - spec/features/masonry_spec.rb
296
317
  - spec/features/slideshow_spec.rb
297
318
  - spec/helpers/blacklight/gallery_helper_spec.rb
319
+ - spec/models/concerns/openseadragon_solr_document_spec.rb
298
320
  - spec/spec_helper.rb
299
321
  - spec/test_app_templates/lib/generators/test_app_generator.rb
300
322
  - spec/views/catalog/_document_slideshow.html.erb_spec.rb