lavatar 0.1.0 → 0.1.5

This diff has not been reviewed by any users.
Log in in order to be able to vote.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 489ab38d90bfb513ad3c28c82f2f3867e5b9d12ed9fa0c7303de04ed45655077
4
- data.tar.gz: 2449685906a6078e44d86757d73075069cc4674fe7c3f63f1835d727f2ae9242
3
+ metadata.gz: 6847bf3a598d7bcb4d0d9cc79586d81a072d7b3f38d0dd9fda979f27ac26cf77
4
+ data.tar.gz: b7b45a44bb20e87da1735285fd2984af090fc3af46ea8c89a456c5154ca9b18c
5
5
  SHA512:
6
- metadata.gz: bb0f9fb0c500aa260b0fa5f0cdc172f7816819f405fa13df1352218da7cde46464bbe37cb3edcdce5100c236a1ca11933dd2f0a13c862088dd4da9ea252ecbb4
7
- data.tar.gz: 28319310042107c3967eeb6e3e0fca898f02d099427b0844ec6f07878f4cbc8e33ef73ecb1c2e3ecd5bdb2c28421a97dd1713a0e4fb0b11f24c09bcbbc1141ce
6
+ metadata.gz: 89fdb81172dc9cffb9e1d30ef0ae9942c160729a527e10f8013a5e92bd2935be894fe001efc33e52ec6f42269cb5fa42353006aea2be6ea9783be7bb1518d4e6
7
+ data.tar.gz: b34881a0f463f503b807b219c4dffa647f042fd41784ee7bb25c415c2a36f2cc9aef505c6539a3bd2659c1fb042296f6b043f53397d0ff1b5db280d461bfd165
@@ -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/lavatar/*.rb"]
15
+ spec.files = Dir["README.md", "LICENSE.txt", "lavatar.gemspec", "lib/**/*.rb"]
16
16
  spec.require_path = "lib"
17
17
 
18
- spec.add_dependency "actionpack"
18
+ spec.required_ruby_version = ">= 2.3.0"
19
+
20
+ spec.add_dependency "activesupport", ">= 4.2.0"
19
21
  end
@@ -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
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module Lavatar
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.5"
3
3
  end
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.0
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: 2019-02-12 00:00:00.000000000 Z
11
+ date: 2020-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: actionpack
14
+ name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
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: '0'
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: '0'
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.0.1
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