avataaars 0.1.1 → 0.2.2
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/lib/avataaars/processor.rb +3 -3
- data/lib/avataaars/version.rb +1 -1
- data/lib/avataaars.rb +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8a129025b2b6847cbc99cb661acee417401df787ece4ee7c1c44305305dae9a
|
4
|
+
data.tar.gz: 624f1bd3d22295cec2e5b771fdcb11bb062000bdf6b469dcdf4b466cec3eb592
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cd51288045bfd9f3f4a474f6bbfb9b7451db193d5383334de7cd03156237382fb5d1fde35626082291e9ae9f365004929b1a26eaea9faab45daccfef5cbf814
|
7
|
+
data.tar.gz: 4d29445fde8a17c080781b028b1423bdf8b89794d4b305d3d3d9ea38afab3ad86d4af8736c8150cfae75506161ba7ad29bf1626a07d8996c53fbda156d259fe4
|
data/lib/avataaars/processor.rb
CHANGED
@@ -14,10 +14,10 @@ class Avataaars
|
|
14
14
|
@app_root = app_root
|
15
15
|
end
|
16
16
|
|
17
|
-
def create_avatar(options)
|
17
|
+
def create_avatar(**options)
|
18
18
|
spawn_process
|
19
19
|
ensure_packages_are_initiated
|
20
|
-
call_js_method
|
20
|
+
call_js_method(**options)
|
21
21
|
ensure
|
22
22
|
cleanup_process if stdin
|
23
23
|
end
|
@@ -73,7 +73,7 @@ class Avataaars
|
|
73
73
|
@package_json ||= JSON.parse(File.read(package_json_path))
|
74
74
|
end
|
75
75
|
|
76
|
-
def call_js_method(options) # rubocop:disable Metrics/MethodLength
|
76
|
+
def call_js_method(**options) # rubocop:disable Metrics/MethodLength
|
77
77
|
stdin.puts JSON.dump([options])
|
78
78
|
input = stdout.gets
|
79
79
|
raise Errno::EPIPE, "Can't read from worker" if input.nil?
|
data/lib/avataaars/version.rb
CHANGED
data/lib/avataaars.rb
CHANGED
@@ -14,7 +14,7 @@ class Avataaars
|
|
14
14
|
# @param [Hash] options Optional parameters to pass to avatar processor
|
15
15
|
# see https://github.com/fangpenlin/avataaars
|
16
16
|
#
|
17
|
-
def initialize(options
|
17
|
+
def initialize(**options)
|
18
18
|
@root_path = options.delete :root_path
|
19
19
|
@options = options
|
20
20
|
end
|
@@ -26,7 +26,7 @@ class Avataaars
|
|
26
26
|
#
|
27
27
|
def create_avatar
|
28
28
|
normalised_options = Utils.normalize_object(@options)
|
29
|
-
processor.create_avatar
|
29
|
+
processor.create_avatar(**normalised_options)
|
30
30
|
end
|
31
31
|
|
32
32
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avataaars
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Bromwich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mini_magick
|
@@ -92,17 +92,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
92
92
|
requirements:
|
93
93
|
- - ">="
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version:
|
95
|
+
version: 3.0.0
|
96
96
|
- - "<"
|
97
97
|
- !ruby/object:Gem::Version
|
98
|
-
version: 3.
|
98
|
+
version: 3.4.0
|
99
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
requirements: []
|
105
|
-
rubygems_version: 3.
|
105
|
+
rubygems_version: 3.3.7
|
106
106
|
signing_key:
|
107
107
|
specification_version: 4
|
108
108
|
summary: A Ruby gem to transform attributes into avatar SVGs using the React avataaars
|