opengraphplus 0.1.13 → 0.1.14
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 10df3058fbeea6414053da76b507503526c50987b49d238ae8f4e7e2900640ec
|
|
4
|
+
data.tar.gz: 3f52b177acdc10d01c96ba6cc415612c0b1b961d86643e99ee5493a7a485957c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c34b5400902ebd04679b1622fba7f775a6ff8edf904b3190f86388c57deb03d86cd02bec7b1848f83303abe5d9c4203733f05e84e3dc1119e8b6cd925febae03
|
|
7
|
+
data.tar.gz: 0e8ab569a82361fbdbdbcbca0d911772c2bd5fccfc30643086748c3775990fedf854e759706be5a4e5a5010515e6e51ab98dd5192a5bc68fbf07e6f459b65b14
|
|
@@ -24,6 +24,16 @@ module Opengraphplus
|
|
|
24
24
|
RUBY
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
+
def comment_out_allow_browser
|
|
28
|
+
application_controller = "app/controllers/application_controller.rb"
|
|
29
|
+
return unless File.exist?(application_controller)
|
|
30
|
+
|
|
31
|
+
content = File.read(application_controller)
|
|
32
|
+
return unless content =~ /^\s*allow_browser\b/
|
|
33
|
+
|
|
34
|
+
gsub_file application_controller, /^(\s*)(allow_browser.*)$/, "\\1# This blocks OpenGraph requests from consumers like Apple, LinkedIn, etc.\n\\1# \\2"
|
|
35
|
+
end
|
|
36
|
+
|
|
27
37
|
def show_readme
|
|
28
38
|
readme "README" if behavior == :invoke
|
|
29
39
|
end
|
|
@@ -6,12 +6,12 @@ module OpenGraphPlus
|
|
|
6
6
|
@api_key = api_key
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
-
def url(source_url)
|
|
9
|
+
def url(source_url, **params)
|
|
10
10
|
return nil unless @api_key
|
|
11
11
|
|
|
12
12
|
Signature::URL.new
|
|
13
13
|
.signed_path("/api/websites/v1", @api_key)
|
|
14
|
-
.build("image", url: source_url)
|
|
14
|
+
.build("image", url: source_url, **params)
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
end
|
data/lib/opengraphplus.rb
CHANGED
|
@@ -5,9 +5,7 @@ require_relative "opengraphplus/version"
|
|
|
5
5
|
module OpenGraphPlus
|
|
6
6
|
class Error < StandardError; end
|
|
7
7
|
|
|
8
|
-
def self.image_url(
|
|
9
|
-
ImageGenerator.new(configuration.api_key).url(source_url)
|
|
10
|
-
end
|
|
8
|
+
def self.image_url(...) = ImageGenerator.new(configuration.api_key).url(...)
|
|
11
9
|
end
|
|
12
10
|
|
|
13
11
|
require_relative "opengraphplus/api_key"
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: opengraphplus
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.14
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brad Gessler
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-01-
|
|
10
|
+
date: 2026-01-22 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: activesupport
|