avatarly 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/lib/avatarly.rb +3 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f0081142c330446d431cfbdec11ce81263a2fb0c
4
- data.tar.gz: ec658cc5995209171711dfedb97917efc07a2701
3
+ metadata.gz: 51fc8530e3fa839d7a92bc40eb5be17512c24e76
4
+ data.tar.gz: 28d9cb6ac0a306c2e1761c959033021a329bc516
5
5
  SHA512:
6
- metadata.gz: 2983b2c752403541f9091819de7cda4133d9aad53720a911f1ea3abd68bbea670de71b16e739b11ef4cc8ea7cb05ece3ca4d0b1bfd249214128ec5d037362cb7
7
- data.tar.gz: 6f1a26653ea8d2ee3a3c878a894e20411dd87b4fc16c28de967a778f0092fac5864d2442a41d15e6f3d56087c5c29b2f593a75cd1f1fb86dea432237043e75d0
6
+ metadata.gz: be1560bcc1a641044f2f2df703972281b2b8b1e448485998c2d2dafe0cf2b0231e1cbb599adb262397f50689cc43ec2c5ee5c21fb22c15ccd6342fc1905d3c43
7
+ data.tar.gz: 3256e01533a83324321e2266afd1bf5725db4ba2d11ca03de01ec53445aa78d2eb14c7c036c90efe1554f5520a4265fffc40ee458a0bdaae498c4bd8885383f8
data/README.md CHANGED
@@ -50,6 +50,7 @@ the only required parameter is <tt>text</tt>. Other options that you can pass ar
50
50
  * <tt>size</tt> (default: 32)
51
51
  * <tt>font</tt> (path to font - e.g. "#{Rails.root}/your_font.ttf")
52
52
  * <tt>font_size</tt> (default: size / 2)
53
+ * <tt>vertical_offset</tt> (default: 0)
53
54
  * <tt>format</tt> (default: png)
54
55
  * <tt>lang</tt> (language code if unicode aware upcase required - e.g: :tr, default: nil)
55
56
 
@@ -53,7 +53,7 @@ class Avatarly
53
53
  self.font = opts[:font]
54
54
  self.fill = opts[:font_color]
55
55
  self.gravity = Magick::CenterGravity
56
- end.annotate(canvas, 0, 0, 0, 0, text)
56
+ end.annotate(canvas, 0, 0, 0, opts[:vertical_offset], text)
57
57
  end
58
58
 
59
59
  def initials(text)
@@ -79,6 +79,7 @@ class Avatarly
79
79
  { background_color: BACKGROUND_COLORS.sample,
80
80
  font_color: '#FFFFFF',
81
81
  size: 32,
82
+ vertical_offset: 0,
82
83
  font: "#{fonts}/Roboto.ttf",
83
84
  format: "png" }
84
85
  end
@@ -89,6 +90,7 @@ class Avatarly
89
90
  opts[:font] = default_options[:font] unless Pathname(opts[:font]).exist?
90
91
  opts[:font_size] ||= opts[:size] / 2
91
92
  opts[:font_size] = opts[:font_size].to_i
93
+ opts[:vertical_offset] = opts[:vertical_offset].to_i
92
94
  opts
93
95
  end
94
96
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avatarly
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukasz Odziewa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-28 00:00:00.000000000 Z
11
+ date: 2016-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rmagick
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  version: '0'
85
85
  requirements: []
86
86
  rubyforge_project:
87
- rubygems_version: 2.4.5.1
87
+ rubygems_version: 2.5.1
88
88
  signing_key:
89
89
  specification_version: 4
90
90
  summary: Simple gem for creating gmail-like user avatars with initials.