icon-social-share-button 0.0.5 → 0.0.7

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: 60b4633b1480d4d22a11afdbd3201ef2bb01dd0d
4
- data.tar.gz: 395dca862111578e47cfe39f31e6b9cca7220ef2
3
+ metadata.gz: 98ab37a1a039a4ceabfd2326e9c09890617c67c1
4
+ data.tar.gz: 64b9fc9f2890e70ecc4a534b6d36c74fec8b55e8
5
5
  SHA512:
6
- metadata.gz: 7835eaeeb8aeb38be57ea43251da79ded2c81c42931903550309ed506feece55be9c3b6c8af844e6d13480a31824a96d8dae9fc38403e50bf78d424ad0cd5abc
7
- data.tar.gz: 9ae80dcbf415f6976f62eb770dd033bde000c88f41d7e4cb719d4f2df604f475ebb142ca9adc742abc6182b181f876fa0b545ac0905c313ef1fe3b4f26056eab
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[:url]).as_png(
40
+ image_tag generate_qr_code(options).as_png(
36
41
  resize_gte_to: true,
37
42
  resize_exactly_to: true,
38
- fill: 'white',
39
- color: 'black',
43
+ fill: options[:fill],
44
+ color: options[:color],
40
45
  size: options[:size],
41
- border_modules: 2.3,
42
- module_px_size: 2,
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(url)
58
- if url
59
- RQRCode::QRCode.new(url, :size => 4, :level => :h)
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
@@ -1,3 +1,3 @@
1
1
  module IconSocialShareButton
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.7"
3
3
  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.5
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-20 00:00:00.000000000 Z
11
+ date: 2015-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails