initial_avatar 0.1.0 → 0.1.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 +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +1 -1
- data/lib/initial_avatar/avatar.rb +1 -1
- data/lib/initial_avatar/configuration.rb +3 -1
- data/lib/initial_avatar/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2d631555bcf852456584cdeba88003811c0825583460c4fa3200a3f8f0ec7bcb
|
|
4
|
+
data.tar.gz: 9b09bb1a1436dd0d4af08e5574df0264a15cd846c720244d52c70f9b759f694f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6972ab0ecc31395b39d527b1d1b45600f7cdd864137d01f5ed28e38a2937b06117c93702178509b32d393322f25a6d690905cffddbd490bf033f34fe08a300fd
|
|
7
|
+
data.tar.gz: 17464e1202c80a52e6dc899abd87dc69248a7fdea928bf6b834377a617356a07c5fca01ffaca9b29acf938772dc6c9221987f71e4d8780e0e67b440efab78503
|
data/CHANGELOG.md
ADDED
data/Gemfile.lock
CHANGED
|
@@ -24,7 +24,7 @@ module InitialAvatar
|
|
|
24
24
|
|
|
25
25
|
def color
|
|
26
26
|
return opts[:color] if opts[:color]
|
|
27
|
-
index = text.ord % InitialAvatar.configuration.colors.length
|
|
27
|
+
index = (text.ord + opts[:seed]) % InitialAvatar.configuration.colors.length
|
|
28
28
|
InitialAvatar.configuration.colors[index]
|
|
29
29
|
end
|
|
30
30
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
module InitialAvatar
|
|
2
2
|
class Configuration
|
|
3
|
-
OPTIONS = %i[text_color size font_weight font_family].freeze
|
|
3
|
+
OPTIONS = %i[text_color size font_weight font_family seed].freeze
|
|
4
4
|
|
|
5
5
|
attr_accessor :colors
|
|
6
6
|
attr_accessor :text_color
|
|
7
7
|
attr_accessor :size
|
|
8
8
|
attr_accessor :font_weight
|
|
9
9
|
attr_accessor :font_family
|
|
10
|
+
attr_accessor :seed
|
|
10
11
|
|
|
11
12
|
def initialize
|
|
12
13
|
@colors = %w[
|
|
@@ -18,6 +19,7 @@ module InitialAvatar
|
|
|
18
19
|
@size = 100
|
|
19
20
|
@font_weight = 400
|
|
20
21
|
@font_family = 'HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica, Arial,Lucida Grande, sans-serif'
|
|
22
|
+
@seed = 0
|
|
21
23
|
end
|
|
22
24
|
|
|
23
25
|
def default_options
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: initial_avatar
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- aki77
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-09-
|
|
11
|
+
date: 2018-09-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -62,6 +62,7 @@ files:
|
|
|
62
62
|
- ".gitignore"
|
|
63
63
|
- ".rspec"
|
|
64
64
|
- ".travis.yml"
|
|
65
|
+
- CHANGELOG.md
|
|
65
66
|
- CODE_OF_CONDUCT.md
|
|
66
67
|
- Gemfile
|
|
67
68
|
- Gemfile.lock
|