initial_avatar 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1fe39619ded1893320afb1275c47fc5c753ca131251243436652ec7b6d4aa47
4
- data.tar.gz: 45d523c8add6f285a7c3e27c6e37313646f03403dd811f6928d079afee7d7773
3
+ metadata.gz: 2d631555bcf852456584cdeba88003811c0825583460c4fa3200a3f8f0ec7bcb
4
+ data.tar.gz: 9b09bb1a1436dd0d4af08e5574df0264a15cd846c720244d52c70f9b759f694f
5
5
  SHA512:
6
- metadata.gz: 30b97523551e6db048042fa15d50cfc38e44ac1c5a74f6532fd45070cc380442dc634ade9c8c0bbd6547ba18fb168ea816e71734bba7d49e6a11ded3aa7933fa
7
- data.tar.gz: 8edcf3240fbfb7eac8866b2a8524d78557d835e09c296d5822afc90704b1afef51d290c0c90bd4b28c24496e5e2feb02cfde7142978d6f1266aa26ba3f4b0857
6
+ metadata.gz: 6972ab0ecc31395b39d527b1d1b45600f7cdd864137d01f5ed28e38a2937b06117c93702178509b32d393322f25a6d690905cffddbd490bf033f34fe08a300fd
7
+ data.tar.gz: 17464e1202c80a52e6dc899abd87dc69248a7fdea928bf6b834377a617356a07c5fca01ffaca9b29acf938772dc6c9221987f71e4d8780e0e67b440efab78503
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ ## 0.1.1
2
+
3
+ - Add seed option
4
+
5
+ ## 0.1.0
6
+
7
+ - First Release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- initial_avatar (0.1.0)
4
+ initial_avatar (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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
@@ -1,3 +1,3 @@
1
1
  module InitialAvatar
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-08 00:00:00.000000000 Z
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