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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0dbc4dbe4ad685bd7760c48fe3dac052a188032
4
- data.tar.gz: f16384779b4de79aa9967b7725eb4cc7513a4f99
3
+ metadata.gz: 2502e4ebaed77d9fa479fd214af4a8bfe5889bf3
4
+ data.tar.gz: f5411646e21718abb7fba368ad5d5feea8069227
5
5
  SHA512:
6
- metadata.gz: dee63ce241837647b68683a93f3bd285163b8d0d5511b03c6a794aa6689f7a81b1eef3e10c28c9468a179107fa956a578d88e48b3afb354376bf1a4f57c8dc5a
7
- data.tar.gz: 4e0d002887b6b7aba2959883a31ae2bedba65483c3f099657a59fd486907bf2190143c6ed1d5995270506d7c873ab717950cbc4d5b5444461b7430733761a123
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[:title] ||= "#{ strip_string(options[:summary], 120) }"
255
- options[:subject] ||= options[:title]
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?}
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module SocialLinker
3
- VERSION = "0.5.0"
3
+ VERSION = "0.5.0.1"
4
4
  end
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-09 00:00:00.000000000 Z
11
+ date: 2018-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler