lavatar 0.1.0 → 0.1.5
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/lavatar.gemspec +4 -2
- data/lib/lavatar.rb +17 -0
- data/lib/lavatar/helpers.rb +2 -2
- data/lib/lavatar/version.rb +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6847bf3a598d7bcb4d0d9cc79586d81a072d7b3f38d0dd9fda979f27ac26cf77
|
4
|
+
data.tar.gz: b7b45a44bb20e87da1735285fd2984af090fc3af46ea8c89a456c5154ca9b18c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89fdb81172dc9cffb9e1d30ef0ae9942c160729a527e10f8013a5e92bd2935be894fe001efc33e52ec6f42269cb5fa42353006aea2be6ea9783be7bb1518d4e6
|
7
|
+
data.tar.gz: b34881a0f463f503b807b219c4dffa647f042fd41784ee7bb25c415c2a36f2cc9aef505c6539a3bd2659c1fb042296f6b043f53397d0ff1b5db280d461bfd165
|
data/lavatar.gemspec
CHANGED
@@ -12,8 +12,10 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.homepage = "https://github.com/jkostolansky/lavatar"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
15
|
-
spec.files = Dir["README.md", "LICENSE.txt", "lavatar.gemspec", "lib
|
15
|
+
spec.files = Dir["README.md", "LICENSE.txt", "lavatar.gemspec", "lib/**/*.rb"]
|
16
16
|
spec.require_path = "lib"
|
17
17
|
|
18
|
-
spec.
|
18
|
+
spec.required_ruby_version = ">= 2.3.0"
|
19
|
+
|
20
|
+
spec.add_dependency "activesupport", ">= 4.2.0"
|
19
21
|
end
|
data/lib/lavatar.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require "lavatar/version"
|
2
|
+
require "lavatar/configuration"
|
3
|
+
require "lavatar/helpers"
|
4
|
+
|
5
|
+
module Lavatar
|
6
|
+
def self.configuration
|
7
|
+
@configuration ||= Configuration.new
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.configure
|
11
|
+
yield(configuration)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
ActiveSupport.on_load :action_view do
|
16
|
+
include Lavatar::Helpers
|
17
|
+
end
|
data/lib/lavatar/helpers.rb
CHANGED
@@ -28,10 +28,10 @@ module Lavatar
|
|
28
28
|
text_attrs = {
|
29
29
|
x: "50%",
|
30
30
|
y: "50%",
|
31
|
+
dy: "0.4em",
|
31
32
|
fill: font_color,
|
32
33
|
"font-size": font_size,
|
33
34
|
"font-weight": font_weight,
|
34
|
-
"alignment-baseline": "central",
|
35
35
|
"text-anchor": "middle",
|
36
36
|
}
|
37
37
|
|
@@ -43,7 +43,7 @@ module Lavatar
|
|
43
43
|
private
|
44
44
|
|
45
45
|
def key_to_color(key, saturation, lightness)
|
46
|
-
hue = Digest::MD5.hexdigest(key)[0..5].to_i(16).to_f/0xFFFFFF
|
46
|
+
hue = Digest::MD5.hexdigest(key.to_s)[0..5].to_i(16).to_f/0xFFFFFF
|
47
47
|
hsl_to_rgb(hue, saturation, lightness)
|
48
48
|
end
|
49
49
|
|
data/lib/lavatar/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lavatar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juraj Kostolansky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.2.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 4.2.0
|
27
27
|
description:
|
28
28
|
email:
|
29
29
|
- juraj@kostolansky.sk
|
@@ -34,6 +34,7 @@ files:
|
|
34
34
|
- LICENSE.txt
|
35
35
|
- README.md
|
36
36
|
- lavatar.gemspec
|
37
|
+
- lib/lavatar.rb
|
37
38
|
- lib/lavatar/configuration.rb
|
38
39
|
- lib/lavatar/helpers.rb
|
39
40
|
- lib/lavatar/version.rb
|
@@ -49,14 +50,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
49
50
|
requirements:
|
50
51
|
- - ">="
|
51
52
|
- !ruby/object:Gem::Version
|
52
|
-
version:
|
53
|
+
version: 2.3.0
|
53
54
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
55
|
requirements:
|
55
56
|
- - ">="
|
56
57
|
- !ruby/object:Gem::Version
|
57
58
|
version: '0'
|
58
59
|
requirements: []
|
59
|
-
rubygems_version: 3.
|
60
|
+
rubygems_version: 3.1.2
|
60
61
|
signing_key:
|
61
62
|
specification_version: 4
|
62
63
|
summary: Generate letter avatars in Ruby on Rails
|