ruby-oembed 0.18.0 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 657a2bb7e88539ae0374eb8cbb9344b7a41b4c8bf1c7e7ee3e3e7912c7a958ee
4
- data.tar.gz: b1d9474d8ff3a5c974b75056722e69d3b45620a50207e9b3b8d0c46b96a31f32
3
+ metadata.gz: c83a8f1301e5e14b7d7b29d6b72bff7a8d42020cee1c93e2f2a70f00c6571643
4
+ data.tar.gz: 4b5ccf5830989c354b2bce0fe1b38303c0618104badc88530496f4c936f49463
5
5
  SHA512:
6
- metadata.gz: 268482f4dfb73808af059f84c44deea8b70794e58baf1c594953259ce76fd79b6af9e0e7f1c0ae13713e6d78252eabfc714b44a7811d4e8c0aeb8c819e86b49b
7
- data.tar.gz: f93bb90ae26808eaac26cf9bc61829cbeaf874d14c46745a12d4fa97895a8c2087266fdf507d1663a20abc21417e4cd082ec10bef9723a1e6fcaa9b2ef74b774
6
+ metadata.gz: 7750049c6c040c9ae6b58d04ede3494c587fde54e058aa28b32633200579ae072ae3a046785fc8acfd9e8652541a3ae4f951e9aae07ef153d3a3be3d247e3aae
7
+ data.tar.gz: 584d894b68b0bdfa3ede4a35deaf6f1cf9e5b28e427b849c924fc071271070821629bf80a34aa03891f4df701dc0e1204a4a55a55674755a7b609bd47255e679
@@ -22,15 +22,12 @@ jobs:
22
22
  runs-on: ubuntu-latest
23
23
  strategy:
24
24
  matrix:
25
- ruby-version: ['2.6', '3.0', '3.2']
25
+ ruby-version: ['2.7', '3.0', '3.4', '4.0']
26
26
 
27
27
  steps:
28
- - uses: actions/checkout@v3
28
+ - uses: actions/checkout@v7
29
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
30
+ uses: ruby/setup-ruby@v1
34
31
  with:
35
32
  ruby-version: ${{ matrix.ruby-version }}
36
33
  bundler-cache: true # runs 'bundle install' and caches installed gems automatically
data/CHANGELOG.rdoc CHANGED
@@ -1,6 +1,25 @@
1
1
  = CHANGELOG
2
2
 
3
- == Unreleased (0.18.1)
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on {Keep a Changelog}[https://keepachangelog.com/en/1.0.0/],
6
+ and this project adheres to {Semantic Versioning}[https://semver.org/spec/v2.0.0.html].
7
+
8
+ == Unreleased (1.0.1)
9
+
10
+ == 1.0.0 - 15 November 2026
11
+
12
+ Welcome to 1.0.0 and {semver}[https://semver.org/spec/v2.0.0.html]!
13
+
14
+ * Set the gem `required_ruby_version` to `>= 2.0`
15
+ * Otherwise 1.0.0 is identical to the 0.18.1 version of this gem
16
+
17
+ There are some minor breaking changes coming up and I decided that was a great reason to finally use semantic versioning.
18
+
19
+ == 0.18.1 - 25 November 2024
20
+
21
+ * Fix the built-in Spotify provider; Pull #95 & #92 (Lewis Buckley)
22
+ * Update the built-in Spotify provider to use a new API endpoint; Pull #95 (Marcos Wright-Kuhns)
4
23
 
5
24
  == 0.18.0 - 31 August 2024
6
25
 
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
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/2024.svg)
7
+ ![Maintenance](https://img.shields.io/maintenance/yes/2025.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.
@@ -13,9 +13,10 @@ module OEmbed
13
13
  def http_get(uri, options = {})
14
14
  found = false
15
15
  remaining_redirects = options[:max_redirects] ? options[:max_redirects].to_i : 4
16
+ scheme, host, port = uri.scheme, uri.host, uri.port
16
17
  until found
17
- http = Net::HTTP.new(uri.host, uri.port)
18
- http.use_ssl = uri.scheme == 'https'
18
+ http = Net::HTTP.new(host, port)
19
+ http.use_ssl = scheme == 'https'
19
20
  http.verify_mode = OpenSSL::SSL::VERIFY_PEER
20
21
  http.read_timeout = http.open_timeout = options[:timeout] if options[:timeout]
21
22
 
@@ -33,6 +34,10 @@ module OEmbed
33
34
  found = true
34
35
  elsif res.is_a?(Net::HTTPRedirection) && res.header['location']
35
36
  uri = URI.parse(res.header['location'])
37
+ # If the 'location' is a relative path, keep the last scheme, host, & port.
38
+ scheme = uri.scheme || scheme
39
+ host = uri.host || host
40
+ port = uri.port || port
36
41
  remaining_redirects -= 1
37
42
  else
38
43
  found = true
@@ -6,6 +6,7 @@ require 'oembed/providers/facebook_post'
6
6
  require 'oembed/providers/facebook_video'
7
7
  require 'oembed/providers/instagram'
8
8
  require 'oembed/providers/matterport'
9
+ require 'oembed/providers/spotify'
9
10
  require 'oembed/providers/tiktok'
10
11
 
11
12
  module OEmbed
@@ -183,17 +184,6 @@ module OEmbed
183
184
  SoundCloud << "https://*.soundcloud.com/*"
184
185
  add_official_provider(SoundCloud)
185
186
 
186
- # Provider for spotify.com
187
- # https://twitter.com/nicklas2k/status/330094611202723840
188
- # http://blog.embed.ly/post/45149936446/oembed-for-spotify
189
- Spotify = OEmbed::Provider.new("https://embed.spotify.com/oembed/")
190
- Spotify << "http://open.spotify.com/*"
191
- Spotify << "https://open.spotify.com/*"
192
- Spotify << "http://play.spotify.com/*"
193
- Spotify << "https://play.spotify.com/*"
194
- Spotify << /^spotify\:(.*?)/
195
- add_official_provider(Spotify)
196
-
197
187
  # Provider for skitch.com
198
188
  # http://skitch.com/oembed/%3C/endpoint
199
189
  Skitch = OEmbed::Provider.new("http://skitch.com/oembed")
@@ -0,0 +1,19 @@
1
+ module OEmbed
2
+ class Providers
3
+ # Provider for spotify.com
4
+ # https://developer.spotify.com/documentation/embeds/reference/oembed
5
+ # https://developer.spotify.com/documentation/embeds/tutorials/using-the-oembed-api
6
+ Spotify = OEmbed::Provider.new(
7
+ "https://open.spotify.com/oembed",
8
+ format: :json
9
+ )
10
+ Spotify << "http://open.spotify.com/*"
11
+ Spotify << "https://open.spotify.com/*"
12
+ Spotify << "http://play.spotify.com/*"
13
+ Spotify << "https://play.spotify.com/*"
14
+ # https://developer.spotify.com/documentation/web-api/concepts/spotify-uris-ids
15
+ Spotify << /^spotify\:(.*?)/
16
+
17
+ add_official_provider(Spotify)
18
+ end
19
+ end
@@ -1,7 +1,7 @@
1
1
  module OEmbed
2
2
  class Version
3
- MAJOR = 0
4
- MINOR = 18
3
+ MAJOR = 1
4
+ MINOR = 0
5
5
  PATCH = 0
6
6
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
7
7
 
data/ruby-oembed.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
23
23
  s.extra_rdoc_files = s.files.grep(%r{\.rdoc$}) + %w{LICENSE}
24
24
 
25
25
  s.require_paths = ["lib"]
26
- s.rubygems_version = "1.8.19"
26
+ s.required_ruby_version = ">= 2.0"
27
27
  s.summary = "oEmbed for Ruby"
28
28
 
29
29
  s.add_development_dependency 'xml-simple', '>= 0'
metadata CHANGED
@@ -1,17 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-oembed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Magnus Holm
8
8
  - Alex Kessinger
9
9
  - Aris Bartee
10
10
  - Marcos Wright Kuhns
11
- autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2024-08-31 00:00:00.000000000 Z
13
+ date: 2026-11-16 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: xml-simple
@@ -84,6 +83,7 @@ files:
84
83
  - lib/oembed/providers/facebook_video.rb
85
84
  - lib/oembed/providers/instagram.rb
86
85
  - lib/oembed/providers/matterport.rb
86
+ - lib/oembed/providers/spotify.rb
87
87
  - lib/oembed/providers/tiktok.rb
88
88
  - lib/oembed/response.rb
89
89
  - lib/oembed/response/link.rb
@@ -98,12 +98,11 @@ homepage: https://github.com/ruby-oembed/ruby-oembed
98
98
  licenses:
99
99
  - MIT
100
100
  metadata: {}
101
- post_install_message:
102
101
  rdoc_options:
103
102
  - "--main"
104
103
  - README.rdoc
105
104
  - "--title"
106
- - ruby-oembed-0.18.0
105
+ - ruby-oembed-1.0.0
107
106
  - "--inline-source"
108
107
  - "--exclude"
109
108
  - tasks
@@ -114,15 +113,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
114
113
  requirements:
115
114
  - - ">="
116
115
  - !ruby/object:Gem::Version
117
- version: '0'
116
+ version: '2.0'
118
117
  required_rubygems_version: !ruby/object:Gem::Requirement
119
118
  requirements:
120
119
  - - ">="
121
120
  - !ruby/object:Gem::Version
122
121
  version: '0'
123
122
  requirements: []
124
- rubygems_version: 3.3.3
125
- signing_key:
123
+ rubygems_version: 4.0.20
126
124
  specification_version: 4
127
125
  summary: oEmbed for Ruby
128
126
  test_files: []