avatarly 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +5 -5
  2. data/lib/avatarly.rb +3 -4
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 51fc8530e3fa839d7a92bc40eb5be17512c24e76
4
- data.tar.gz: 28d9cb6ac0a306c2e1761c959033021a329bc516
2
+ SHA256:
3
+ metadata.gz: 6280b257572ca4c9eae1287abbc892d4296cd53a1b840cdd70890d340049ee84
4
+ data.tar.gz: 20c6fe9eb3b506b843b6f29b54b2629106ac6013922ede8a12932015f7bc43c3
5
5
  SHA512:
6
- metadata.gz: be1560bcc1a641044f2f2df703972281b2b8b1e448485998c2d2dafe0cf2b0231e1cbb599adb262397f50689cc43ec2c5ee5c21fb22c15ccd6342fc1905d3c43
7
- data.tar.gz: 3256e01533a83324321e2266afd1bf5725db4ba2d11ca03de01ec53445aa78d2eb14c7c036c90efe1554f5520a4265fffc40ee458a0bdaae498c4bd8885383f8
6
+ metadata.gz: 624fe874190fd3a3318ab7d5f14b86e4fcaa8c791139dbabbb20672f2bec24064eeea0260dc9dcc0a93a51480e20632895d496ef0c755b8179cee93d0611036d
7
+ data.tar.gz: 91eb1b9ed5ab7db9a98fa0c08576623c3dbe8052a05a081a4d527360e08cf2c7996ad795781bd70e8a850a3d01b8b34aad6aec0ee67247df84ec292a85bc01c5
@@ -17,9 +17,9 @@ class Avatarly
17
17
  class << self
18
18
  def generate_avatar(text, opts={})
19
19
  if opts[:lang]
20
- text = UnicodeUtils.upcase(initials(text.to_s.strip.gsub(/[^[[:word:]] ]/,'')), opts[:lang])
20
+ text = UnicodeUtils.upcase(initials(text.to_s.gsub(/[^[[:word:]] ]/,'').strip), opts[:lang])
21
21
  else
22
- text = initials(text.to_s.strip.gsub(/[^\w ]/,'')).upcase
22
+ text = initials(text.to_s.gsub(/[^\w ]/,'').strip).upcase
23
23
  end
24
24
  generate_image(text, parse_options(opts)).to_blob
25
25
  end
@@ -68,8 +68,7 @@ class Avatarly
68
68
 
69
69
  def initials_for_separator(text, separator)
70
70
  if text.include?(separator)
71
- text = text.split(separator)
72
- text[0][0] + text[1][0]
71
+ text.split(separator).compact.map{|part| part[0]}.join
73
72
  else
74
73
  text[0] || ''
75
74
  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.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukasz Odziewa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-29 00:00:00.000000000 Z
11
+ date: 2018-06-22 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.5.1
87
+ rubygems_version: 2.7.6
88
88
  signing_key:
89
89
  specification_version: 4
90
90
  summary: Simple gem for creating gmail-like user avatars with initials.