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 +5 -5
- data/CHANGELOG.md +5 -0
- data/README.md +12 -0
- data/lib/letter_avatar/avatar.rb +1 -1
- data/lib/letter_avatar/configuration.rb +8 -0
- data/lib/letter_avatar/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6d2586d081f82e47b98f62a86d2838d175335b45ae2aef96c8e53a38196e50f7
|
4
|
+
data.tar.gz: a14569c36f85e2753f62448003c11f901a41014f17cd6edc12347b55959fe152
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c05404029ccb5e990b3cd03d9b10978713a39174835d04db3fea4905c6b6a0775fd69ed30357b8d4e265745c8e290c14f546710af846200e15c5b5880b48594e
|
7
|
+
data.tar.gz: 4c37b64aac54ed5d81d77885c357c2ce0b03f90f4c58d54d451229214d031f6e737b062f4d92861d02db0426bee7ee2843fb89d2bcbdede3e1e19ec09bf6f5fa
|
data/CHANGELOG.md
CHANGED
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
|
...
|
data/lib/letter_avatar/avatar.rb
CHANGED
@@ -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 #{
|
70
|
+
-font #{LetterAvatar.font}
|
71
71
|
-weight #{LetterAvatar.weight}
|
72
72
|
-fill '#{LetterAvatar.fill_color}'
|
73
73
|
-gravity Center
|
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.
|
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:
|
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
|
-
|
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
|