ruby-oembed 0.16.1 → 0.18.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
  SHA256:
3
- metadata.gz: dfcdff2a45ff8d739d78d8b44f0694735d6bb962b01ff6e0fef85e0a089d1d23
4
- data.tar.gz: 3fdef0f50c4d9f65a316099e069fde6e50c3dcdd52bb3251fa3c97d300736dbb
3
+ metadata.gz: 657a2bb7e88539ae0374eb8cbb9344b7a41b4c8bf1c7e7ee3e3e7912c7a958ee
4
+ data.tar.gz: b1d9474d8ff3a5c974b75056722e69d3b45620a50207e9b3b8d0c46b96a31f32
5
5
  SHA512:
6
- metadata.gz: a6f93f4aa24f1cbf281c94657d2f58749599f1b7628e835475feb61eed2136333736478ce34f82bff209b9557ce70dd6ef1214ddaffdd99ba36fcdd6bb1a3793
7
- data.tar.gz: bd3bdbd9a24b06c715498ca90691998d13fb05b13332f698b1f4065cd639d46db9644404328ef4f0d7a74cc46488008f1d36688b89f8b99324df6c6ed4ca48a2
6
+ metadata.gz: 268482f4dfb73808af059f84c44deea8b70794e58baf1c594953259ce76fd79b6af9e0e7f1c0ae13713e6d78252eabfc714b44a7811d4e8c0aeb8c819e86b49b
7
+ data.tar.gz: f93bb90ae26808eaac26cf9bc61829cbeaf874d14c46745a12d4fa97895a8c2087266fdf507d1663a20abc21417e4cd082ec10bef9723a1e6fcaa9b2ef74b774
@@ -0,0 +1,38 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ "master" ]
13
+ pull_request:
14
+ branches: [ "master" ]
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ jobs:
20
+ test:
21
+
22
+ runs-on: ubuntu-latest
23
+ strategy:
24
+ matrix:
25
+ ruby-version: ['2.6', '3.0', '3.2']
26
+
27
+ steps:
28
+ - uses: actions/checkout@v3
29
+ - name: Set up Ruby
30
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
31
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
32
+ # uses: ruby/setup-ruby@v1
33
+ uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
34
+ with:
35
+ ruby-version: ${{ matrix.ruby-version }}
36
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
37
+ - name: Run tests
38
+ run: bundle exec rake
data/CHANGELOG.rdoc CHANGED
@@ -1,6 +1,17 @@
1
1
  = CHANGELOG
2
2
 
3
- == Unreleased (0.16.2)
3
+ == Unreleased (0.18.1)
4
+
5
+ == 0.18.0 - 31 August 2024
6
+
7
+ * Add support for `x.com` URLs to `OEmbed::Providers::Twitter`; Pull #97 (Maxime)
8
+ * Refresh a few test casettes; Pull #96 (Marcos Wright-Kuhns)
9
+
10
+ == 0.17.0 - 25 February 2024
11
+
12
+ * Add a built-in Matterport provider; Pull #93 (Nathan Papes)
13
+ * Updated tests to run with Ruby 2.6, 3.0, & 3.2
14
+ * Switched to using GitHub Actions for CI instead of Travis CI
4
15
 
5
16
  == 0.16.1 - 13 January 2022
6
17
 
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # ruby-oembed
2
2
 
3
3
  [![Gem](https://img.shields.io/gem/v/ruby-oembed.svg)](https://rubygems.org/gems/ruby-oembed)
4
- [![Travis CI](https://img.shields.io/travis/com/ruby-oembed/ruby-oembed.svg)](https://app.travis-ci.com/github/ruby-oembed/ruby-oembed)
4
+ [![Test Coverage](https://github.com/ruby-oembed/ruby-oembed/actions/workflows/ruby.yml/badge.svg)](https://github.com/ruby-oembed/ruby-oembed/actions/workflows/ruby.yml)
5
5
  [![Code Climate](https://img.shields.io/codeclimate/maintainability/ruby-oembed/ruby-oembed.svg)](https://codeclimate.com/github/ruby-oembed/ruby-oembed)
6
6
  [![Coveralls](https://coveralls.io/repos/github/ruby-oembed/ruby-oembed/badge.svg?branch=coveralls)](https://coveralls.io/github/ruby-oembed/ruby-oembed?branch=coveralls)
7
- ![Maintenance](https://img.shields.io/maintenance/yes/2022.svg)
7
+ ![Maintenance](https://img.shields.io/maintenance/yes/2024.svg)
8
8
 
9
9
 
10
10
  An oEmbed consumer library written in Ruby, letting you easily get embeddable HTML representations of supported web pages, based on their URLs. See [oembed.com](http://oembed.com) for more about the protocol.
@@ -125,7 +125,7 @@ If you encounter any bug, feel free to [create an Issue](https://github.com/ruby
125
125
 
126
126
  We gladly accept pull requests! Just [fork](http://help.github.com/forking/) the library and commit your changes along with relevant tests. Once you're happy with the changes, [send a pull request](http://help.github.com/pull-requests/).
127
127
 
128
- We do our best to [keep our tests green](https://app.travis-ci.com/github/ruby-oembed/ruby-oembed)
128
+ We do our best to [keep our tests green](https://github.com/ruby-oembed/ruby-oembed/actions/workflows/ruby.yml)
129
129
 
130
130
  # Contributors
131
131
 
@@ -50,6 +50,11 @@ module OEmbed
50
50
  self.backend = old_backend
51
51
  end
52
52
 
53
+ def reset_backend
54
+ @backend = nil
55
+ remove_instance_variable(:@backend)
56
+ end
57
+
53
58
  private
54
59
 
55
60
  # Makes sure the given backend can correctly parse values using the decode
@@ -108,4 +113,4 @@ module OEmbed
108
113
 
109
114
  end # SharedMethods
110
115
  end
111
- end
116
+ end
@@ -4,10 +4,10 @@ module OEmbed
4
4
  module JSON
5
5
  # A Array of all available backends, listed in order of preference.
6
6
  DECODERS = %w(ActiveSupportJSON JSONGem Yaml)
7
-
7
+
8
8
  class << self
9
9
  include ::OEmbed::Formatter::Base
10
-
10
+
11
11
  # Returns the current JSON backend.
12
12
  def backend
13
13
  set_default_backend unless defined?(@backend)
@@ -26,21 +26,21 @@ module OEmbed
26
26
  end
27
27
  end
28
28
  end
29
-
29
+
30
30
  private
31
-
31
+
32
32
  def backend_path
33
33
  'json/backends'
34
34
  end
35
-
35
+
36
36
  def test_value
37
37
  <<-JSON
38
38
  {"version":"1.0", "string":"test", "int":42,"html":"<i>Cool's</i>\\n the \\"word\\"\\u0021"}
39
39
  JSON
40
40
  end
41
-
41
+
42
42
  end # self
43
-
43
+
44
44
  end # JSON
45
45
  end
46
- end
46
+ end
@@ -5,6 +5,7 @@
5
5
  require 'oembed/providers/facebook_post'
6
6
  require 'oembed/providers/facebook_video'
7
7
  require 'oembed/providers/instagram'
8
+ require 'oembed/providers/matterport'
8
9
  require 'oembed/providers/tiktok'
9
10
 
10
11
  module OEmbed
@@ -75,6 +76,7 @@ module OEmbed
75
76
  # https://dev.twitter.com/rest/reference/get/statuses/oembed
76
77
  Twitter = OEmbed::Provider.new("https://publish.twitter.com/oembed", format: :json)
77
78
  Twitter << "https://*.twitter.com/*/status/*"
79
+ Twitter << "https://*.x.com/*/status/*"
78
80
  add_official_provider(Twitter)
79
81
 
80
82
  # Provider for vine.co
@@ -0,0 +1,12 @@
1
+ module OEmbed
2
+ class Providers
3
+ # Provider for my.matterport.com
4
+ Matterport = OEmbed::Provider.new(
5
+ "https://my.matterport.com/api/v1/models/oembed/",
6
+ format: :json
7
+ )
8
+ Matterport << "https://*.matterport.com/show/*"
9
+
10
+ add_official_provider(Matterport)
11
+ end
12
+ end
@@ -1,8 +1,8 @@
1
1
  module OEmbed
2
2
  class Version
3
3
  MAJOR = 0
4
- MINOR = 16
5
- PATCH = 1
4
+ MINOR = 18
5
+ PATCH = 0
6
6
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
7
7
 
8
8
  class << self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-oembed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.1
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Magnus Holm
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2022-01-13 00:00:00.000000000 Z
14
+ date: 2024-08-31 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: xml-simple
@@ -51,9 +51,8 @@ extra_rdoc_files:
51
51
  - CHANGELOG.rdoc
52
52
  - LICENSE
53
53
  files:
54
- - ".coveralls.yml"
54
+ - ".github/workflows/ruby.yml"
55
55
  - ".gitignore"
56
- - ".travis.yml"
57
56
  - ".yardopts"
58
57
  - CHANGELOG.rdoc
59
58
  - Gemfile
@@ -84,6 +83,7 @@ files:
84
83
  - lib/oembed/providers/facebook_post.rb
85
84
  - lib/oembed/providers/facebook_video.rb
86
85
  - lib/oembed/providers/instagram.rb
86
+ - lib/oembed/providers/matterport.rb
87
87
  - lib/oembed/providers/tiktok.rb
88
88
  - lib/oembed/response.rb
89
89
  - lib/oembed/response/link.rb
@@ -103,7 +103,7 @@ rdoc_options:
103
103
  - "--main"
104
104
  - README.rdoc
105
105
  - "--title"
106
- - ruby-oembed-0.16.1
106
+ - ruby-oembed-0.18.0
107
107
  - "--inline-source"
108
108
  - "--exclude"
109
109
  - tasks
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  requirements: []
124
- rubygems_version: 3.1.4
124
+ rubygems_version: 3.3.3
125
125
  signing_key:
126
126
  specification_version: 4
127
127
  summary: oEmbed for Ruby
data/.coveralls.yml DELETED
@@ -1 +0,0 @@
1
- service_name: travis-ci
data/.travis.yml DELETED
@@ -1,12 +0,0 @@
1
- language: ruby
2
- sudo: false
3
- before_install:
4
- - gem install bundler
5
- bundler_args: --without guard
6
- cache: bundler
7
- rvm:
8
- - 2.6.9
9
- - 3.0.3
10
- env:
11
- global:
12
- - RUN_ALL_TESTS=true