social_linker 0.5.0 → 0.5.0.1
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 +4 -4
- data/lib/social_linker/subject.rb +6 -8
- data/lib/social_linker/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2502e4ebaed77d9fa479fd214af4a8bfe5889bf3
|
|
4
|
+
data.tar.gz: f5411646e21718abb7fba368ad5d5feea8069227
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d145ba4156cf498cf797de2854bbdbeaf60f76be93d6b42a1f05e86ffdf315326efd5dbe8d6b6ba91ca30005e1f24f5dde8ca214969b723945c8cc4bf0382a45
|
|
7
|
+
data.tar.gz: 8cc99a94ce538114f3794762a48ec2058d1076b90fcef0a20b96dcb495445e8898bc59a563ad0281787ed3a34284423e3342669b40837d1ec8f6edea77de4e0a
|
|
@@ -71,7 +71,7 @@ module SocialLinker
|
|
|
71
71
|
#
|
|
72
72
|
# @return String with url
|
|
73
73
|
def url
|
|
74
|
-
@options[:url]
|
|
74
|
+
@options[:url] || image_url
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
def image_url
|
|
@@ -137,7 +137,7 @@ module SocialLinker
|
|
|
137
137
|
# default title accessor
|
|
138
138
|
# @return String with title
|
|
139
139
|
def title
|
|
140
|
-
@options[:title]
|
|
140
|
+
@options[:title] || "#{ strip_string(options[:summary], 120) }"
|
|
141
141
|
end
|
|
142
142
|
|
|
143
143
|
# default summary accessor
|
|
@@ -249,12 +249,10 @@ module SocialLinker
|
|
|
249
249
|
def merge!(options)
|
|
250
250
|
options = options.options if options.is_a? SocialLinker::Subject
|
|
251
251
|
options[:render_site_title_postfix] = true if options[:render_site_title_postfix].nil?
|
|
252
|
-
options[:u] ||= options[:url]
|
|
253
|
-
options[:media] ||= options[:image_url]
|
|
254
|
-
options[:
|
|
255
|
-
options[:
|
|
256
|
-
options[:via] ||= options[:twitter_username]
|
|
257
|
-
options[:url] ||= options[:media]
|
|
252
|
+
options[:u] ||= options[:url] if options[:url]
|
|
253
|
+
options[:media] ||= options[:image_url] if options[:image_url]
|
|
254
|
+
options[:subject] ||= options[:title] if options[:title]
|
|
255
|
+
options[:via] ||= options[:twitter_username] if options[:twitter_username]
|
|
258
256
|
options[:text] = "#{options[:title]} #{options[:url]}" unless options[:text] #facebook & whatsapp native
|
|
259
257
|
options[:domain] = options[:url].split(/\//)[0..2].join("/") if options[:url] and !options[:domain]
|
|
260
258
|
options.select!{|k,v| !v.nil?}
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: social_linker
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.0
|
|
4
|
+
version: 0.5.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- murb
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-10-
|
|
11
|
+
date: 2018-10-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|