boring_avatar 1.0.1 → 1.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: 76e0b48e0a05baf7f93639dad8a3a5bd6226d390485a40336712fb79e52c4e71
4
- data.tar.gz: bd9bc97ffd51fbf668054e72f39cf8953380fce529a27cc4bfe986efc83e2180
3
+ metadata.gz: f46869d1f86a48d2fb734d7282350c60c334aeef208d4e5e5149beb69a2adc21
4
+ data.tar.gz: 24ed5b74ad82e49082b98ef37ee143c701bf503ca4c9e769ff472332c4fdd6a7
5
5
  SHA512:
6
- metadata.gz: 4b621f5123c033538e5a6655ab64eeac25f358829ef6ea1731f942da2ae905f8527e028850f5d9a77721eeab99da14acf6a4be8b1b08bf7093e072cd7ad620b0
7
- data.tar.gz: 6db7e9764af03859536437ee70679ab964d9a72262957a3df1d238353e6e9d6eb7cdfe40705e3805b8e78be8a3194a7f4da300cf27f186a24d7ef34bbff82b34
6
+ metadata.gz: 0a0e91e40c01d11e15315da7cd981d39da58b7f5595d0eee4b89708b14019169f50679f7ec1e8739fca96d0356a1ee6b6ba5495786d81d71ca10e7880913f946
7
+ data.tar.gz: 2ff116590caa8e185b2557adb37f85c270c5b270414ad233884cf068d6b196a30878f183ca10d4e3fc9dcb919d8ee441e44b8ae8bba956b41dd628c0c09df1bf
@@ -3,7 +3,7 @@ name: Initial Pipeline
3
3
  agent:
4
4
  machine:
5
5
  type: e1-standard-2
6
- os_image: ubuntu1804
6
+ os_image: ubuntu2004
7
7
  blocks:
8
8
  - name: CI
9
9
  task:
@@ -11,7 +11,7 @@ blocks:
11
11
  - name: Test
12
12
  commands:
13
13
  - checkout
14
- - sem-version ruby 3.1.2
14
+ - sem-version ruby 3.2.2
15
15
  - cache restore
16
16
  - bundle config set --local deployment 'true'
17
17
  - bundle config set --local path 'vendor/bundle'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.1 / 2023-06-30
4
+
5
+ - Fix for Beam avatar when random color was nil
6
+
7
+ ## 1.1.0 / 2023-06-27
8
+
9
+ - Ensure default options are set when nil
10
+
3
11
  ## 1.0.1 / 2022-09-23
4
12
 
5
13
  - Fix loading file issue
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- boring_avatar (1.0.1)
4
+ boring_avatar (1.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -21,4 +21,4 @@ DEPENDENCIES
21
21
  rake (~> 12.0)
22
22
 
23
23
  BUNDLED WITH
24
- 2.3.20
24
+ 2.3.25
@@ -9,12 +9,19 @@ module BoringAvatar
9
9
  attr_reader :colors, :name, :size, :opts, :num_from_name, :range
10
10
 
11
11
  def initialize(colors: COLORS, name: NAME, size: SIZE, **opts)
12
- @colors = colors == "random" ? Util.random_palette : colors
12
+ @colors = case
13
+ when colors == "random"
14
+ Util.random_palette
15
+ when colors.nil? || colors.empty?
16
+ COLORS
17
+ else
18
+ colors
19
+ end
13
20
  @name = name
14
- @size = size
21
+ @size = size.nil? ? SIZE : size
15
22
  @opts = opts
16
23
  @num_from_name = Util.get_number(name)
17
- @range = colors.length
24
+ @range = @colors.length
18
25
  end
19
26
 
20
27
  def generate
@@ -11,7 +11,7 @@ module Util
11
11
  end
12
12
 
13
13
  def get_random_color(colors, number, range)
14
- colors[number % range]
14
+ colors[number % range] || colors.last
15
15
  end
16
16
 
17
17
  def get_unit(number, range, index = nil)
@@ -1,3 +1,3 @@
1
1
  module BoringAvatar
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boring_avatar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olivier
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-23 00:00:00.000000000 Z
11
+ date: 2023-07-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This is a simple Ruby implementation of Boring Avatars library
14
14
  email: