letter_avatar 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +4 -3
- data/lib/letter_avatar/avatar_helper.rb +1 -1
- data/lib/letter_avatar/has_avatar.rb +2 -9
- data/lib/letter_avatar/version.rb +1 -1
- data/lib/letter_avatar.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f648e3d3e303081858371e1bbe2e164b76b68085
|
4
|
+
data.tar.gz: 5b55acfe7f9f5df46eea21b8d0b3867485950102
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3d835fedd766bda7395275f8e936703ffa323f2a6f0dc3c5050e1a6c24304cdd718c827df43af2ef0afdfbfa6d45d49bf0ba61d9e963d12ea173fcccf8bfaba
|
7
|
+
data.tar.gz: 4db45918f3221758b818cecc57e008c299d1de98ce0ea766c1a67341e0f265baab4f1950d462c9dc4c4db9b7bdf04d129c45767f68a2624f5fbb1a7044ead5a9
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -102,6 +102,10 @@ Say, you have a model `User` (which must have attribute or method `name`)
|
|
102
102
|
class User
|
103
103
|
include LetterAvatar::HasAvatar
|
104
104
|
...
|
105
|
+
|
106
|
+
def name
|
107
|
+
'ksz2k'
|
108
|
+
end
|
105
109
|
end
|
106
110
|
```
|
107
111
|
|
@@ -113,9 +117,6 @@ Then, in your views you can use:
|
|
113
117
|
# or
|
114
118
|
@user.avatar_url(200)
|
115
119
|
=> "/system/letter_avatars/2/K/87_178_230/200.png"
|
116
|
-
# or even
|
117
|
-
@user.avatar_tag(200, class: 'av')
|
118
|
-
=> "<img class=\"av\" alt=\"ksz2k\" src=\"/system/letter_avatars/2/K/87_178_230/200.png\" />"
|
119
120
|
```
|
120
121
|
|
121
122
|
### Way to support non [a-z0-9] charsets
|
@@ -3,9 +3,6 @@ module LetterAvatar
|
|
3
3
|
def self.included(base)
|
4
4
|
base.send :include, InstanceMethods
|
5
5
|
base.extend ClassMethods
|
6
|
-
base.class_eval do
|
7
|
-
include LetterAvatar::AvatarHelper
|
8
|
-
end
|
9
6
|
end
|
10
7
|
|
11
8
|
module ClassMethods
|
@@ -17,17 +14,13 @@ module LetterAvatar
|
|
17
14
|
end
|
18
15
|
|
19
16
|
def avatar_path(size = 64)
|
20
|
-
|
17
|
+
LetterAvatar.generate(name, size)
|
21
18
|
end
|
22
19
|
|
23
20
|
def avatar_url(size = 64)
|
24
|
-
|
21
|
+
LetterAvatar.path_to_url(avatar_path(size))
|
25
22
|
end
|
26
23
|
|
27
|
-
def avatar_tag(size = 64, options = {})
|
28
|
-
letter_avatar_tag(name, size, options)
|
29
|
-
end
|
30
|
-
|
31
24
|
end
|
32
25
|
end
|
33
26
|
end
|
data/lib/letter_avatar.rb
CHANGED