avatarly 1.5.0 → 1.5.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 +5 -5
- data/lib/avatarly.rb +3 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6280b257572ca4c9eae1287abbc892d4296cd53a1b840cdd70890d340049ee84
|
4
|
+
data.tar.gz: 20c6fe9eb3b506b843b6f29b54b2629106ac6013922ede8a12932015f7bc43c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 624fe874190fd3a3318ab7d5f14b86e4fcaa8c791139dbabbb20672f2bec24064eeea0260dc9dcc0a93a51480e20632895d496ef0c755b8179cee93d0611036d
|
7
|
+
data.tar.gz: 91eb1b9ed5ab7db9a98fa0c08576623c3dbe8052a05a081a4d527360e08cf2c7996ad795781bd70e8a850a3d01b8b34aad6aec0ee67247df84ec292a85bc01c5
|
data/lib/avatarly.rb
CHANGED
@@ -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.
|
20
|
+
text = UnicodeUtils.upcase(initials(text.to_s.gsub(/[^[[:word:]] ]/,'').strip), opts[:lang])
|
21
21
|
else
|
22
|
-
text = initials(text.to_s.
|
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
|
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.
|
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:
|
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.
|
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.
|