boring_avatar 1.0.0 → 1.1.0

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: e6772d0356af50712128cf66783ccd72b45a7af8689adb2384d2e95250f63bdb
4
- data.tar.gz: d42b37d5ef921d8bb7699610a5c50a24d712f977b207605e20453b280d563329
3
+ metadata.gz: 4b35dafd67e8e5a4aa93d5bcb6add2cef21edb46c9b40006ab8d2c64d2fecb50
4
+ data.tar.gz: 9f6302fcd596af87ece50f1a9432418d984ce20ab1570b998daa206f278b41ba
5
5
  SHA512:
6
- metadata.gz: 98bc31baeb25c0eb26d3c675280fe4247084c8048a821ea020094a3fd9eec891b0cfdee0d52d28eb692db4acecf9f9c6ebc54961c5ced812f17fdf6450ab6989
7
- data.tar.gz: c50ec05e86712de188842e721dbe7e3052a178a43f4bd2a0989a7debb640b5599d0a5bdb8b8a345a5ba0413ec4e4ce15ecc451220be5e6fc56558c924fc7e55d
6
+ metadata.gz: ce9657797944976cbea5e2b27d2eaaf6cb55e063794b335459fad009f3760d2f0e48994f222fab691406f4d9ce6cf0010f602d23dce2b6fa34663cccff89985c
7
+ data.tar.gz: 3d034ce1f618e2289c084f56bb558aac19f5b9b6209d442a7b56b0599dea30c3d5f818b591e4757455c7424717dd2c5fe3dd45c314bf68f524baf7b2829e1903
@@ -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.0 / 2023-06-27
4
+
5
+ - Ensure default options are set when nil
6
+
7
+ ## 1.0.1 / 2022-09-23
8
+
9
+ - Fix loading file issue
10
+
3
11
  ## 1.0.0 / 2022-09-22
4
12
 
5
13
  - Added ring type
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- boring_avatar (1.0.0)
4
+ boring_avatar (1.1.0)
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,9 +9,16 @@ 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
24
  @range = colors.length
@@ -43,7 +43,11 @@ module Util
43
43
  private
44
44
 
45
45
  def color_palettes
46
- @color_palettes ||= JSON.parse(File.read("./color_palettes.json"))
46
+ @color_palettes ||= JSON.parse(File.read(palettes_file))
47
+ end
48
+
49
+ def palettes_file
50
+ File.dirname(__FILE__) + "/../../color_palettes.json"
47
51
  end
48
52
  end
49
53
  end
@@ -1,3 +1,3 @@
1
1
  module BoringAvatar
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
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.0
4
+ version: 1.1.0
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-22 00:00:00.000000000 Z
11
+ date: 2023-06-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This is a simple Ruby implementation of Boring Avatars library
14
14
  email:
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  requirements: []
64
- rubygems_version: 3.1.6
64
+ rubygems_version: 3.2.15
65
65
  signing_key:
66
66
  specification_version: 4
67
67
  summary: Generate Boring Avatars