letter_avatar 0.3.7 → 0.3.8

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
- SHA1:
3
- metadata.gz: ffacda0ec7a8bf7d0e86472745adde948c04ea53
4
- data.tar.gz: 990c67997bc36eba73bf5bb2fe9d0ba0203230e6
2
+ SHA256:
3
+ metadata.gz: 6d2586d081f82e47b98f62a86d2838d175335b45ae2aef96c8e53a38196e50f7
4
+ data.tar.gz: a14569c36f85e2753f62448003c11f901a41014f17cd6edc12347b55959fe152
5
5
  SHA512:
6
- metadata.gz: 81a98ac1cdd46c264c3a18747dcae2a0a55467af2527730021ebab41fb091cc7ef85595f73f8509ef142dba55e8801179cce0a7736824eca9308f1d1e8ea99c1
7
- data.tar.gz: e22ecefb7ab1b1cc3809f525e2e03f2f0d4b07108063825d5f13ec15a551958f01bf052a617280d1468f806a126b4b0cfb93a9fa790b3f18ee07166533af7d8e
6
+ metadata.gz: c05404029ccb5e990b3cd03d9b10978713a39174835d04db3fea4905c6b6a0775fd69ed30357b8d4e265745c8e290c14f546710af846200e15c5b5880b48594e
7
+ data.tar.gz: 4c37b64aac54ed5d81d77885c357c2ce0b03f90f4c58d54d451229214d031f6e737b062f4d92861d02db0426bee7ee2843fb89d2bcbdede3e1e19ec09bf6f5fa
@@ -1,3 +1,8 @@
1
+ 0.3.8
2
+ -----
3
+
4
+ - added `LetterAvatar.font` config option.
5
+
1
6
  0.3.7
2
7
  -----
3
8
 
data/README.md CHANGED
@@ -78,6 +78,16 @@ LetterAvatar.setup do |config|
78
78
  end
79
79
  ```
80
80
 
81
+ ##### Custom font definition
82
+
83
+ You can define your own `custom` palette:
84
+
85
+ ```ruby
86
+ LetterAvatar.setup do |config|
87
+ config.font = File.join(File.expand_path('../../', File.dirname(__FILE__)), 'app/assets/fonts', 'font_name.ext')
88
+ end
89
+ ```
90
+
81
91
  ## Usage
82
92
 
83
93
  ```ruby
@@ -113,6 +123,8 @@ There's also helper for this. To use it, you need:
113
123
  Say, you have a model `User` (which must have attribute or method `name`)
114
124
 
115
125
  ```ruby
126
+ require 'letter_avatar/has_avatar'
127
+
116
128
  class User
117
129
  include LetterAvatar::HasAvatar
118
130
  ...
@@ -67,7 +67,7 @@ module LetterAvatar
67
67
  -size #{FULLSIZE}x#{FULLSIZE}
68
68
  xc:#{to_rgb(identity.color)}
69
69
  -pointsize #{LetterAvatar.pointsize}
70
- -font #{FONT_FILENAME}
70
+ -font #{LetterAvatar.font}
71
71
  -weight #{LetterAvatar.weight}
72
72
  -fill '#{LetterAvatar.fill_color}'
73
73
  -gravity Center
@@ -8,6 +8,14 @@ module LetterAvatar
8
8
  @cache_base_path = v
9
9
  end
10
10
 
11
+ def font
12
+ @font || Avatar::FONT_FILENAME
13
+ end
14
+
15
+ def font=(v)
16
+ @font = v
17
+ end
18
+
11
19
  def fill_color
12
20
  @fill_color || Avatar::FILL_COLOR
13
21
  end
@@ -1,3 +1,3 @@
1
1
  module LetterAvatar
2
- VERSION = '0.3.7'
2
+ VERSION = '0.3.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: letter_avatar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Discourse Developers
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2019-02-05 00:00:00.000000000 Z
14
+ date: 2020-04-03 00:00:00.000000000 Z
15
15
  dependencies: []
16
16
  description: Gem for creating letter avatar from user's name
17
17
  email:
@@ -49,8 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
49
49
  - !ruby/object:Gem::Version
50
50
  version: '0'
51
51
  requirements: []
52
- rubyforge_project:
53
- rubygems_version: 2.6.14
52
+ rubygems_version: 3.0.3
54
53
  signing_key:
55
54
  specification_version: 4
56
55
  summary: Create nice initals avatars from your users usernames