icon-social-share-button 0.0.5 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/icon_social_share_button/helper.rb +14 -9
- data/lib/icon_social_share_button/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: 98ab37a1a039a4ceabfd2326e9c09890617c67c1
|
4
|
+
data.tar.gz: 64b9fc9f2890e70ecc4a534b6d36c74fec8b55e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a0eaafc020cb1dfac6e958ba0e579493d9748275d16b35a6e061614b2e0dabe098849bdebe39c39af4e17ad18c1cdf51e7a692904d148c00e7613b98c5dfce8
|
7
|
+
data.tar.gz: 7abe13662d83ba1b6cc876ef5b21f2aaa761d231cc24ffc5ae183be2e3cc7636dc118821c564263a0eebc52324391a04ebe5c7651a1e9b85e366860a0e3cd1ce
|
@@ -28,18 +28,23 @@ module IconSocialShareButton
|
|
28
28
|
default_img_options = {
|
29
29
|
:class => 'default-wechat-share-style',
|
30
30
|
:size => 250,
|
31
|
-
:url => 'http://t.cn/RLu4RKd'
|
31
|
+
:url => 'http://t.cn/RLu4RKd',
|
32
|
+
:qr_size => 40,
|
33
|
+
:border_modules => 2.3,
|
34
|
+
:module_px_size => 2,
|
35
|
+
:fill => 'white',
|
36
|
+
:color => 'black'
|
32
37
|
}
|
33
38
|
options = default_img_options.merge(opts) # reverse_merge
|
34
39
|
# image_tag generate_qr_code(options[:url]).as_png(:size => options[:size]).to_data_url, :class => options[:class]
|
35
|
-
image_tag generate_qr_code(options
|
40
|
+
image_tag generate_qr_code(options).as_png(
|
36
41
|
resize_gte_to: true,
|
37
42
|
resize_exactly_to: true,
|
38
|
-
fill:
|
39
|
-
color:
|
43
|
+
fill: options[:fill],
|
44
|
+
color: options[:color],
|
40
45
|
size: options[:size],
|
41
|
-
border_modules:
|
42
|
-
module_px_size:
|
46
|
+
border_modules: options[:border_modules],
|
47
|
+
module_px_size: options[:module_px_size],
|
43
48
|
file: nil # path to write
|
44
49
|
).to_data_url, :class => options[:class], :size => options[:size]
|
45
50
|
end
|
@@ -54,9 +59,9 @@ module IconSocialShareButton
|
|
54
59
|
end
|
55
60
|
end
|
56
61
|
|
57
|
-
def generate_qr_code(
|
58
|
-
if url
|
59
|
-
RQRCode::QRCode.new(url, :size =>
|
62
|
+
def generate_qr_code(opts)
|
63
|
+
if opts[:url]
|
64
|
+
RQRCode::QRCode.new(opts[:url], :size => opts[:qr_size], :level => :h)
|
60
65
|
else
|
61
66
|
raise "url must not be nil"
|
62
67
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: icon-social-share-button
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matrixbirds
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|