oembed_proxy 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +3 -1
- data/.travis.yml +1 -1
- data/CHANGELOG.md +4 -4
- data/Gemfile +1 -1
- data/README.md +4 -0
- data/lib/oembed_proxy/embedly.rb +1 -1
- data/lib/oembed_proxy/first_party.rb +2 -2
- data/lib/oembed_proxy/version.rb +1 -1
- data/lib/providers/embedly_patterns.def +1 -0
- data/oembed_proxy.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: dce3a35ae294f0038a42c0ac8fa78a42d0810789
|
4
|
+
data.tar.gz: 2c35584063b4311a23bd0f0cd0879215d94d5920
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a6237bb8137a38938d6efea1275860011464c643726cd7e39118d774f430ce6ddb252cf2cba41ee645159b664b98a41b5964cfc0665f72cbf39ae379d785088
|
7
|
+
data.tar.gz: 7040ee255130612f9fecb5da7f5075d5efb3579f13c952bd2c3dba88475e8422574a9c4e9bc6c67f01445c523195805483779d6224349c6fedd89754b48d4233
|
data/.rubocop.yml
CHANGED
@@ -9,7 +9,9 @@ Metrics/LineLength:
|
|
9
9
|
Metrics/BlockLength:
|
10
10
|
Exclude:
|
11
11
|
- 'spec/**/*'
|
12
|
-
Style/
|
12
|
+
Style/TrailingCommaInArrayLiteral:
|
13
|
+
EnforcedStyleForMultiline: comma
|
14
|
+
Style/TrailingCommaInHashLiteral:
|
13
15
|
EnforcedStyleForMultiline: comma
|
14
16
|
Style/RescueStandardError:
|
15
17
|
EnforcedStyle: implicit
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# oEmbed Proxy Changelog
|
2
2
|
|
3
|
-
## [
|
3
|
+
## [`0.1.2`] (2018-03-29)
|
4
4
|
|
5
|
-
[
|
5
|
+
[`0.1.2`]: https://github.com/APMG/oembed_proxy/compare/v0.1.0...v0.1.2
|
6
6
|
|
7
|
-
*
|
7
|
+
* Add support for Radio Public by adding it to the embed.ly providers list.
|
8
8
|
|
9
9
|
## [`0.1.1`] (2018-02-27)
|
10
10
|
|
11
|
-
[
|
11
|
+
[`0.1.1`]: https://github.com/APMG/oembed_proxy/compare/v0.1.0...v0.1.1
|
12
12
|
|
13
13
|
* Fix file references for first party and embedly providers.
|
14
14
|
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -87,6 +87,10 @@ handler.register OembedProxy::AssociatedPress.new
|
|
87
87
|
|
88
88
|
Once providers have been registered, calling `#handles_url?` and `#get_data` on the handler will operate on the composition of the registered providers.
|
89
89
|
|
90
|
+
### Using existing embed.ly providers
|
91
|
+
|
92
|
+
[Embed.ly](http://embed.ly/) supports more than 400 content providers. Be sure to check the [embed.ly providers list](http://embed.ly/providers) prior to implementing your own custom provider. If your desired provider is already supported, simply add its URL to the bottom of the existing list `/lib/providers/embedly_patterns.def`.
|
93
|
+
|
90
94
|
### Implementing your own providers
|
91
95
|
|
92
96
|
You are able to easily implement additional providers by creating an object which implements the `#handles_url?(url)` and `#get_data(url, other_params)` methods. Take a look at the existing provider classes for examples.
|
data/lib/oembed_proxy/embedly.rb
CHANGED
@@ -13,7 +13,7 @@ module OembedProxy
|
|
13
13
|
@pattern_hash = {}
|
14
14
|
@embedly_key = embedly_key
|
15
15
|
|
16
|
-
File.open(File.expand_path('
|
16
|
+
File.open(File.expand_path('../providers/embedly_patterns.def', __dir__), 'r') do |f|
|
17
17
|
f.each do |line|
|
18
18
|
regex = Utility.clean_pattern(line)
|
19
19
|
@pattern_hash[regex] = EMBEDLY_URL
|
@@ -17,7 +17,7 @@ module OembedProxy
|
|
17
17
|
# Import the expected first party providers.
|
18
18
|
@pattern_hash = {}
|
19
19
|
|
20
|
-
yaml_hash = YAML.load_file(File.expand_path('
|
20
|
+
yaml_hash = YAML.load_file(File.expand_path('../providers/first_party.yml', __dir__))
|
21
21
|
yaml_hash.each_value do |hsh|
|
22
22
|
hsh['pattern_list'].each do |pattern|
|
23
23
|
regex = Utility.clean_pattern(pattern)
|
@@ -72,7 +72,7 @@ module OembedProxy
|
|
72
72
|
raise OembedException, (ERROR_CLASS_MAPPING[res.class] || "Unknown response: #{res.class}")
|
73
73
|
end
|
74
74
|
rescue JSON::ParserError
|
75
|
-
return nil
|
75
|
+
return nil # rubocop:disable Style/RedundantReturn
|
76
76
|
end
|
77
77
|
|
78
78
|
def request_builder(uri)
|
data/lib/oembed_proxy/version.rb
CHANGED
data/oembed_proxy.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oembed_proxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Johnston
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
111
|
rubyforge_project:
|
112
|
-
rubygems_version: 2.
|
112
|
+
rubygems_version: 2.6.14
|
113
113
|
signing_key:
|
114
114
|
specification_version: 4
|
115
115
|
summary: Simple library to manage first party, embedly, and custom oembeds
|