blacklight-oembed 1.0.1 → 1.1.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
  SHA256:
3
- metadata.gz: d61aec782640e66703f01c71dfcf3e7fd88445498ba35cc0edb1d69b6c2ca1c6
4
- data.tar.gz: 83f98a2143e5b2461fc0dbd057a7719c59053b758eae8e78b5d0f792d66191f2
3
+ metadata.gz: 5305c4c047c7deeee34c98b2d3197e69d584a6ca7308cb0d80ebebf81d666b9d
4
+ data.tar.gz: 695d6b4f7dce7c1b516f54653332f9c8b5bbe295c6151eff90be47da2f368fdf
5
5
  SHA512:
6
- metadata.gz: d945fc6e2b2f3802559876266251c908c8f6fc77e477952f6ba98179b84696295396cc34774bf6d4a50f253954519be973cca580f1d8575ebb8f8986c7c733af
7
- data.tar.gz: 4e5382c7b4f9ae02b32a974a4999058a8884494e89634d99bc093f5f07b84b5c8507fca3eb1eb2a4a80c5ece241ec58cc15e2e0dcf25f035fb9c1cbfe6fb165c
6
+ metadata.gz: 044130e650ac8243abe3f5390d1bdd7b93f94130ecc0a17b1504a071738c8ffbaf6f9cb9979c6e8ec114da60b38d5a657c819c9e536f0af5acb8538e1a09f6b4
7
+ data.tar.gz: de08d089681ea0fdec9f7446ba702f8f63b32c9e6758fa9f1446cbdb660ffc029abf17fd053e1f4e535036f90776655270e1b8cb00622051f92c18373e4d40c4
@@ -0,0 +1,35 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ ruby: [2.7, '3.0']
15
+ rails_version: ['6.1.7', '7.0.4']
16
+ blacklight_version: ['~> 7.0']
17
+ include:
18
+ - ruby: '3.1'
19
+ rails_version: '7.0.4'
20
+ - ruby: '3.1'
21
+ rails_version: '7.0.4'
22
+ blacklight_version: 'github'
23
+ env:
24
+ RAILS_VERSION: ${{ matrix.rails_version }}
25
+ BLACKLIGHT_VERSION: ${{ matrix.blacklight_version }}
26
+ steps:
27
+ - uses: actions/checkout@v2
28
+ - name: Set up Ruby ${{ matrix.ruby }}
29
+ uses: ruby/setup-ruby@v1
30
+ with:
31
+ ruby-version: ${{ matrix.ruby }}
32
+ - name: Install dependencies with Rails ${{ matrix.rails_version }}
33
+ run: bundle install
34
+ - name: Run tests
35
+ run: bundle exec rake
@@ -7,9 +7,9 @@ module Blacklight::Oembed
7
7
 
8
8
  private
9
9
 
10
- def get_embed_content(url, add_params)
10
+ ruby2_keywords def get_embed_content(url, add_params = {})
11
11
  begin
12
- OEmbed::Providers.get(url, **add_params.transform_values { |v| URI.encode(v) }).html.html_safe
12
+ OEmbed::Providers.get(url, add_params.transform_values { |v| CGI.escape(v) }).html.html_safe
13
13
  rescue OEmbed::NotFound
14
14
  response.status = 400
15
15
  ""
@@ -18,12 +18,12 @@ Gem::Specification.new do |spec|
18
18
  spec.require_paths = ["lib"]
19
19
 
20
20
  spec.add_dependency "rails"
21
- spec.add_dependency 'blacklight', '~> 7.0'
21
+ spec.add_dependency 'blacklight', '>= 7.0', '< 9'
22
22
  spec.add_dependency "ruby-oembed"
23
23
 
24
24
  spec.add_development_dependency "bundler", ">= 1.5"
25
25
  spec.add_development_dependency "rake"
26
- spec.add_development_dependency "rspec-rails", "~> 3.1"
26
+ spec.add_development_dependency "rspec-rails", "~> 6"
27
27
  spec.add_development_dependency "rspec-its"
28
28
  spec.add_development_dependency "rspec-activemodel-mocks"
29
29
  spec.add_development_dependency "rspec-collection_matchers"
@@ -1,5 +1,5 @@
1
1
  module Blacklight
2
2
  module Oembed
3
- VERSION = '1.0.1'
3
+ VERSION = '1.1.1'
4
4
  end
5
5
  end
@@ -18,6 +18,7 @@
18
18
 
19
19
  <!-- solr lib dirs -->
20
20
  <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib" />
21
+ <lib dir="${solr.install.dir:../../../..}/modules/analysis-extras/lib" />
21
22
  <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lucene-libs" />
22
23
 
23
24
  <dataDir>${solr.data.dir:}</dataDir>
@@ -30,13 +30,13 @@ describe Blacklight::Oembed::EmbedController do
30
30
  end
31
31
 
32
32
  it 'passes along configured additional keys' do
33
- allow(OEmbed::Providers).to receive(:get).with('http://some/uri', canvas_index: '5').and_return oembed_obj
33
+ allow(OEmbed::Providers).to receive(:get).with('http://some/uri', { canvas_index: '5' }).and_return oembed_obj
34
34
  get :show, params: { url: 'http://some/uri', canvas_index: '5' }
35
35
  expect(response.status).to eq 200
36
36
  end
37
37
 
38
38
  it 'URI encodes data from additional keys' do
39
- allow(OEmbed::Providers).to receive(:get).with('http://some/uri', suggested_search: 'ep%C3%A9e').and_return oembed_obj
39
+ allow(OEmbed::Providers).to receive(:get).with('http://some/uri', { suggested_search: 'ep%C3%A9e' }).and_return oembed_obj
40
40
  get :show, params: { url: 'http://some/uri', suggested_search: 'epée' }
41
41
  expect(response.status).to eq 200
42
42
  end
@@ -0,0 +1,5 @@
1
+ if ENV['BLACKLIGHT_VERSION'] == 'github'
2
+ gem 'blacklight', github: 'projectblacklight/blacklight'
3
+ elsif ENV['BLACKLIGHT_VERSION'] && !ENV['BLACKLIGHT_VERSION'].empty?
4
+ gem 'blacklight', ENV['BLACKLIGHT_VERSION']
5
+ end
@@ -3,15 +3,21 @@ require 'rails/generators'
3
3
  class TestAppGenerator < Rails::Generators::Base
4
4
  source_root File.expand_path("../../../../test_app_templates", __FILE__)
5
5
 
6
- def remove_index
6
+ def remove_index
7
7
  remove_file "public/index.html"
8
8
  end
9
9
 
10
10
  def run_blacklight_generator
11
- say_status("warning", "GENERATING BL", :yellow)
11
+ say_status("warning", "GENERATING BL", :yellow)
12
+
13
+ if ENV['BLACKLIGHT_VERSION'] == 'github'
14
+ gem 'blacklight', github: 'projectblacklight/blacklight'
15
+ elsif ENV['BLACKLIGHT_VERSION'].present?
16
+ gem 'blacklight', ENV['BLACKLIGHT_VERSION']
17
+ end
12
18
 
13
19
  Bundler.with_clean_env do
14
- run "bundle install"
20
+ run "bundle update"
15
21
  end
16
22
 
17
23
  generate 'blacklight:install'
@@ -21,4 +27,4 @@ class TestAppGenerator < Rails::Generators::Base
21
27
  generate 'blacklight_oembed:install'
22
28
  end
23
29
 
24
- end
30
+ 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: 1.0.1
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-21 00:00:00.000000000 Z
11
+ date: 2022-12-16 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: '7.0'
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '9'
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: '7.0'
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '9'
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: ruby-oembed
43
49
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +92,14 @@ dependencies:
86
92
  requirements:
87
93
  - - "~>"
88
94
  - !ruby/object:Gem::Version
89
- version: '3.1'
95
+ version: '6'
90
96
  type: :development
91
97
  prerelease: false
92
98
  version_requirements: !ruby/object:Gem::Requirement
93
99
  requirements:
94
100
  - - "~>"
95
101
  - !ruby/object:Gem::Version
96
- version: '3.1'
102
+ version: '6'
97
103
  - !ruby/object:Gem::Dependency
98
104
  name: rspec-its
99
105
  requirement: !ruby/object:Gem::Requirement
@@ -192,15 +198,15 @@ dependencies:
192
198
  - - ">="
193
199
  - !ruby/object:Gem::Version
194
200
  version: 1.5.0
195
- description:
201
+ description:
196
202
  email:
197
203
  - cabeer@stanford.edu
198
204
  executables: []
199
205
  extensions: []
200
206
  extra_rdoc_files: []
201
207
  files:
208
+ - ".github/workflows/ruby.yml"
202
209
  - ".gitignore"
203
- - ".travis.yml"
204
210
  - Gemfile
205
211
  - LICENSE
206
212
  - README.md
@@ -247,7 +253,7 @@ homepage: https://github.com/sul-dlss/blacklight-oembed
247
253
  licenses:
248
254
  - Apache 2.0
249
255
  metadata: {}
250
- post_install_message:
256
+ post_install_message:
251
257
  rdoc_options: []
252
258
  require_paths:
253
259
  - lib
@@ -262,8 +268,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
262
268
  - !ruby/object:Gem::Version
263
269
  version: '0'
264
270
  requirements: []
265
- rubygems_version: 3.1.2
266
- signing_key:
271
+ rubygems_version: 3.3.7
272
+ signing_key:
267
273
  specification_version: 4
268
274
  summary: Oembed display for Blacklight
269
275
  test_files:
data/.travis.yml DELETED
@@ -1,10 +0,0 @@
1
- notifications:
2
- email: false
3
-
4
- rvm:
5
- - 2.6.3
6
-
7
- env:
8
- global:
9
- - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
10
- - RAILS_VERSION=5.2.3