opengraphplus 0.1.16 → 0.1.17

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: 560d079e7cf4a5ef84766fd42c4b012197d2dc7d6ea10220e56ec8a0a1af99fc
4
- data.tar.gz: d348f8e8a9e80d83ef76bdf3b71e87bffb2491b77d67e16167532a11872ae270
3
+ metadata.gz: d17e213c6ea972ade5d2f27a702a57f5978bbc53760c1999e0e0bc85ddb0cfac
4
+ data.tar.gz: 4804c7fde8ec22a23280b6eff6b69e770f1e81283c3c20cc6fa7685f91cacba7
5
5
  SHA512:
6
- metadata.gz: 720d8ddd5464df7581e8e7c30a51265a6cfed6cc5888140e546c8af47e970eab700928f4fd592c2c04477639dfd050f7c126464759cd72c079ed2d9278f0ac9a
7
- data.tar.gz: b0f00ec27e925aabd42b69e2287c884fc48702b660d3f9059a9d911078be0a52e082ec06643de47f0a2617c96a19c54ea2a5071e63b568743074fdc233acdd0d
6
+ metadata.gz: 72e768c5282c52d10c5795bc5007868da806e32365afbd476a4c40267b50dcadb56a2ae6bc53e284c42faac753be354629cd42bfc0c7d6839d414c8c8cc226e5
7
+ data.tar.gz: 18533ce1b5e3770d6efd06ff65d96ef426d39a13473ed086b097c0ebc72248f0ee5d97ffb54b4dd4c915dc4febeb0239bd724e930814f2ada21e351ed668dc0c
@@ -7,8 +7,4 @@ OpenGraphPlus.configure do |config|
7
7
 
8
8
  # Or use ENV:
9
9
  # config.api_key = ENV["OGPLUS__API_KEY"]
10
-
11
- # Set base_url for static site generators (e.g., Sitepress) where
12
- # request.url is not available at compile time:
13
- # config.base_url = "https://example.com"
14
10
  end
@@ -1,28 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "uri"
4
-
5
3
  module OpenGraphPlus
6
4
  class Configuration
7
5
  DEFAULT_URL = "https://opengraphplus.com"
8
6
 
9
- attr_accessor :api_url, :base_url
7
+ attr_accessor :api_url
10
8
 
11
9
  def initialize
12
10
  @api_key = nil
13
11
  @api_url = DEFAULT_URL
14
- @base_url = nil
15
- end
16
-
17
- def resolve_url(request)
18
- if @base_url
19
- URI.join(@base_url, request.path).to_s
20
- elsif request.respond_to?(:host) && request.host.present?
21
- request.url
22
- else
23
- warn "[OpenGraphPlus] Cannot determine site URL. Set OpenGraphPlus.configuration.base_url for static site generation."
24
- nil
25
- end
26
12
  end
27
13
 
28
14
  def api_key
@@ -8,6 +8,7 @@ module OpenGraphPlus
8
8
 
9
9
  included do
10
10
  helper_method :open_graph, :open_graph_tags, :open_graph_meta_tags, :open_graph_plus_image_url
11
+ before_action :set_default_open_graph
11
12
  append_before_action :set_default_open_graph_image
12
13
  end
13
14
 
@@ -17,12 +18,16 @@ module OpenGraphPlus
17
18
  end
18
19
  end
19
20
 
20
- def open_graph_plus_image_url(source_url = open_graph.url)
21
+ def open_graph_plus_image_url(source_url = request.path)
21
22
  OpenGraphPlus.image_url(source_url)
22
23
  end
23
24
 
24
25
  private
25
26
 
27
+ def set_default_open_graph
28
+ open_graph.type = "website"
29
+ end
30
+
26
31
  def set_default_open_graph_image
27
32
  open_graph.image.url ||= open_graph_plus_image_url
28
33
  end
@@ -24,7 +24,6 @@ module OpenGraphPlus
24
24
  def default_open_graph
25
25
  Namespace::Root.new.tap do |root|
26
26
  root.type = "website"
27
- root.url = OpenGraphPlus.configuration.resolve_url(request) if request
28
27
  end
29
28
  end
30
29
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenGraphPlus
4
- VERSION = "0.1.16"
4
+ VERSION = "0.1.17"
5
5
  end
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.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Gessler
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-02-13 00:00:00.000000000 Z
10
+ date: 2026-02-16 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activesupport