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 +4 -4
- data/.semaphore/semaphore.yml +2 -2
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +2 -2
- data/lib/boring_avatar/avatar/base.rb +9 -2
- data/lib/boring_avatar/util.rb +5 -1
- data/lib/boring_avatar/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b35dafd67e8e5a4aa93d5bcb6add2cef21edb46c9b40006ab8d2c64d2fecb50
|
4
|
+
data.tar.gz: 9f6302fcd596af87ece50f1a9432418d984ce20ab1570b998daa206f278b41ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce9657797944976cbea5e2b27d2eaaf6cb55e063794b335459fad009f3760d2f0e48994f222fab691406f4d9ce6cf0010f602d23dce2b6fa34663cccff89985c
|
7
|
+
data.tar.gz: 3d034ce1f618e2289c084f56bb558aac19f5b9b6209d442a7b56b0599dea30c3d5f818b591e4757455c7424717dd2c5fe3dd45c314bf68f524baf7b2829e1903
|
data/.semaphore/semaphore.yml
CHANGED
@@ -3,7 +3,7 @@ name: Initial Pipeline
|
|
3
3
|
agent:
|
4
4
|
machine:
|
5
5
|
type: e1-standard-2
|
6
|
-
os_image:
|
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.
|
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
data/Gemfile.lock
CHANGED
@@ -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 =
|
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
|
data/lib/boring_avatar/util.rb
CHANGED
@@ -43,7 +43,11 @@ module Util
|
|
43
43
|
private
|
44
44
|
|
45
45
|
def color_palettes
|
46
|
-
@color_palettes ||= JSON.parse(File.read(
|
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
|
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.
|
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:
|
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.
|
64
|
+
rubygems_version: 3.2.15
|
65
65
|
signing_key:
|
66
66
|
specification_version: 4
|
67
67
|
summary: Generate Boring Avatars
|