blacklight-oembed 0.0.4 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/.travis.yml +1 -10
- data/Gemfile +21 -11
- data/README.md +34 -5
- data/Rakefile +3 -3
- data/app/controllers/blacklight/oembed/embed_controller.rb +4 -4
- data/blacklight-oembed.gemspec +2 -2
- data/lib/blacklight/oembed/version.rb +1 -1
- data/spec/controllers/embed_controller_spec.rb +3 -0
- metadata +15 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db9d87b367dffd26913c0d1a57db4a08e2da50b2
|
4
|
+
data.tar.gz: 1544b62ac3ab14deadbd1e11cea9d39563e60dbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b800826445f20a4e9293daf0748e1d6281b972cf102a1cb79353680aec07c1b01b61d230b7f9cd8331ed4a7bb13c0154cc45f77af873f6514a5ecc28e5171072
|
7
|
+
data.tar.gz: c78c6fa174c2da2b4f8ecb434041bad4e8489e40fb7861ea35c65bdd8a4502f545df2214f21d38f902437025fd50dd4569276c830e7451e247f5147d0515f09c
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -2,17 +2,8 @@ notifications:
|
|
2
2
|
email: false
|
3
3
|
|
4
4
|
rvm:
|
5
|
-
- 2.
|
6
|
-
- 2.0.0
|
7
|
-
- 1.9.3
|
8
|
-
- jruby-19mode
|
9
|
-
|
10
|
-
notifications:
|
11
|
-
irc: "irc.freenode.org#blacklight"
|
12
|
-
email:
|
13
|
-
- blacklight-commits@googlegroups.com
|
5
|
+
- 2.2.4
|
14
6
|
|
15
7
|
env:
|
16
8
|
global:
|
17
|
-
- JRUBY_OPTS="-J-Xms512m -J-Xmx1024m"
|
18
9
|
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
data/Gemfile
CHANGED
@@ -3,19 +3,29 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in blacklight-gallery.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
# BEGIN ENGINE_CART BLOCK
|
7
|
+
# engine_cart: 0.8.0
|
8
|
+
# engine_cart stanza: 0.8.0
|
9
|
+
# the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
|
10
|
+
file = File.expand_path("Gemfile", ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path(".internal_test_app", File.dirname(__FILE__)))
|
11
|
+
if File.exist?(file)
|
12
|
+
begin
|
13
|
+
eval_gemfile file
|
14
|
+
rescue Bundler::GemfileError => e
|
15
|
+
Bundler.ui.warn '[EngineCart] Skipping Rails application dependencies:'
|
16
|
+
Bundler.ui.warn e.message
|
17
|
+
end
|
10
18
|
else
|
11
|
-
|
19
|
+
Bundler.ui.warn "[EngineCart] Unable to find test application dependencies in #{file}, using placeholder dependencies"
|
20
|
+
|
21
|
+
gem 'rails', ENV['RAILS_VERSION'] if ENV['RAILS_VERSION']
|
12
22
|
|
13
|
-
|
14
|
-
if ENV['RAILS_VERSION'] and ENV['RAILS_VERSION'] =~ /^4.2/
|
15
|
-
gem 'sass-rails', ">= 5.0.0.beta1"
|
23
|
+
if ENV['RAILS_VERSION'].nil? || ENV['RAILS_VERSION'] =~ /^4.2/
|
16
24
|
gem 'responders', "~> 2.0"
|
25
|
+
gem 'sass-rails', ">= 5.0"
|
17
26
|
else
|
18
|
-
gem 'sass-rails
|
19
|
-
gem '
|
27
|
+
gem 'bootstrap-sass', '< 3.3.5' # 3.3.5 requires sass 3.3, incompatible with sass-rails 4.x
|
28
|
+
gem 'sass-rails', "< 5.0"
|
20
29
|
end
|
21
|
-
end
|
30
|
+
end
|
31
|
+
# END ENGINE_CART BLOCK
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Blacklight::Oembed
|
2
2
|
[](http://badge.fury.io/rb/blacklight-oembed)
|
3
3
|
|
4
|
-
|
4
|
+
blacklight-oembed adds [OEmbed](http://oembed.info) displays for Blacklight's search results views.
|
5
5
|
|
6
6
|
## Installation
|
7
7
|
|
@@ -19,17 +19,46 @@ Or install it yourself as:
|
|
19
19
|
|
20
20
|
## Usage
|
21
21
|
|
22
|
-
Run the
|
22
|
+
Run the blacklight-oembed generator:
|
23
23
|
|
24
24
|
$ rails g blacklight_oembed:install
|
25
25
|
|
26
|
-
|
26
|
+
The generator will provide reasonable defaults and inject oembed configuration into your `CatalogController`.
|
27
27
|
|
28
|
-
|
28
|
+
In your solr index, you need a field containing the URL to an oembeddable object. `blacklight-oembed` will use that URL to render the oembed viewer on your `catalog#show` page. The name of the field can be configured in your Blacklight configuration:
|
29
|
+
|
30
|
+
```
|
31
|
+
# app/controllers/catalog_controller
|
32
|
+
class CatalogController
|
33
|
+
...
|
34
|
+
configure_blacklight do |config|
|
35
|
+
# these are generated into your configuration by the install generator.
|
36
|
+
config.show.oembed_field = :oembed_url_ssm
|
37
|
+
config.show.partials.insert(1, :oembed)
|
38
|
+
end
|
39
|
+
...
|
40
|
+
end
|
41
|
+
```
|
42
|
+
|
43
|
+
In an initializer, you may want to register additional oembed providers for the [`ruby-oembed`](https://github.com/judofyr/ruby-oembed), e.g.:
|
44
|
+
|
45
|
+
```
|
46
|
+
# config/initializers/oembed_providers
|
47
|
+
require 'oembed'
|
48
|
+
|
49
|
+
OEmbed::providers.register_all
|
50
|
+
|
51
|
+
purl_provider = OEmbed::Provider.new("http://purl.stanford.edu/embed.{format}?&hide_title=true")
|
52
|
+
purl_provider << "http://purl.stanford.edu/*"
|
53
|
+
OEmbed::Providers.register(purl_provider)
|
54
|
+
```
|
55
|
+
|
56
|
+
|
57
|
+
You need a solr field containing a URL to an embeddable object.
|
29
58
|
|
30
59
|
## Contributing
|
31
60
|
|
32
|
-
1. Fork it ( http://github.com
|
61
|
+
1. Fork it ( http://github.com/sul-dlss/blacklight-oembed/fork )
|
33
62
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
34
63
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
35
64
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
|
3
|
-
ZIP_URL = "https://github.com/projectblacklight/blacklight-jetty/archive/v4.10.
|
3
|
+
ZIP_URL = "https://github.com/projectblacklight/blacklight-jetty/archive/v4.10.4.zip"
|
4
4
|
APP_ROOT = File.dirname(__FILE__)
|
5
5
|
|
6
6
|
require 'rspec/core/rake_task'
|
@@ -18,7 +18,7 @@ end
|
|
18
18
|
desc "Load fixtures"
|
19
19
|
task :fixtures => ['engine_cart:generate'] do
|
20
20
|
within_test_app do
|
21
|
-
system "rake blacklight:
|
21
|
+
system "rake blacklight:index:seed RAILS_ENV=test"
|
22
22
|
abort "Error running fixtures" unless $?.success?
|
23
23
|
end
|
24
24
|
end
|
@@ -54,7 +54,7 @@ task :server do
|
|
54
54
|
|
55
55
|
Jettywrapper.wrap(jetty_params) do
|
56
56
|
within_test_app do
|
57
|
-
system "rake blacklight:
|
57
|
+
system "rake blacklight:index:seed"
|
58
58
|
system "bundle exec rails s"
|
59
59
|
end
|
60
60
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Blacklight::Oembed
|
2
|
-
class EmbedController < ActionController::
|
2
|
+
class EmbedController < ActionController::Base
|
3
|
+
|
3
4
|
def show
|
4
|
-
|
5
|
-
self.response_body = { html: get_embed_content(params[:url]) }.to_json
|
5
|
+
render json: { html: get_embed_content(params[:url]) }
|
6
6
|
end
|
7
7
|
|
8
8
|
private
|
@@ -11,7 +11,7 @@ module Blacklight::Oembed
|
|
11
11
|
begin
|
12
12
|
OEmbed::Providers.get(url).html.html_safe
|
13
13
|
rescue OEmbed::NotFound
|
14
|
-
|
14
|
+
response.status = 400
|
15
15
|
""
|
16
16
|
end
|
17
17
|
end
|
data/blacklight-oembed.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
20
|
spec.add_dependency "rails"
|
21
|
-
spec.add_dependency "blacklight", "
|
21
|
+
spec.add_dependency "blacklight", ">= 5.0", "< 7"
|
22
22
|
spec.add_dependency "bootstrap-sass", "~> 3.0"
|
23
23
|
spec.add_dependency "ruby-oembed"
|
24
24
|
|
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_development_dependency "rspec-activemodel-mocks"
|
30
30
|
spec.add_development_dependency "rspec-collection_matchers"
|
31
31
|
spec.add_development_dependency "jettywrapper"
|
32
|
-
spec.add_development_dependency "engine_cart"
|
32
|
+
spec.add_development_dependency "engine_cart", "~> 0.8"
|
33
33
|
spec.add_development_dependency "capybara"
|
34
34
|
spec.add_development_dependency "poltergeist", ">= 1.5.0"
|
35
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight-oembed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-21 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.0'
|
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.0'
|
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
|
@@ -168,16 +174,16 @@ dependencies:
|
|
168
174
|
name: engine_cart
|
169
175
|
requirement: !ruby/object:Gem::Requirement
|
170
176
|
requirements:
|
171
|
-
- - "
|
177
|
+
- - "~>"
|
172
178
|
- !ruby/object:Gem::Version
|
173
|
-
version: '0'
|
179
|
+
version: '0.8'
|
174
180
|
type: :development
|
175
181
|
prerelease: false
|
176
182
|
version_requirements: !ruby/object:Gem::Requirement
|
177
183
|
requirements:
|
178
|
-
- - "
|
184
|
+
- - "~>"
|
179
185
|
- !ruby/object:Gem::Version
|
180
|
-
version: '0'
|
186
|
+
version: '0.8'
|
181
187
|
- !ruby/object:Gem::Dependency
|
182
188
|
name: capybara
|
183
189
|
requirement: !ruby/object:Gem::Requirement
|
@@ -258,7 +264,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
258
264
|
version: '0'
|
259
265
|
requirements: []
|
260
266
|
rubyforge_project:
|
261
|
-
rubygems_version: 2.
|
267
|
+
rubygems_version: 2.4.5.1
|
262
268
|
signing_key:
|
263
269
|
specification_version: 4
|
264
270
|
summary: Oembed display for Blacklight
|