letter_avatar 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/letter_avatar/has_avatar.rb +18 -5
- data/lib/letter_avatar/version.rb +1 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e4fdd1da9e28981d11834ba527b9ed7f9b49ad0
|
4
|
+
data.tar.gz: bfec65d71a2cc9a95b5acf401458de53d7e61617
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71f343c18aca06719fbb0af9f37e7ca562324ee94f3676de66205db49ccfcc24ae7aa020e6fc8dd44f280c0726bc691fb9982258b244e8c5b17e6d8728a25d77
|
7
|
+
data.tar.gz: 1fcbf2264ffe40e7bf482e25cb5f71cc70633832135369ff9658d598cec76a33cd744457b525e3806feecf46fa877be83a2d54559e5d7a1e2aa245766f8546b6
|
@@ -1,13 +1,26 @@
|
|
1
1
|
module LetterAvatar
|
2
2
|
module HasAvatar
|
3
|
-
|
3
|
+
def self.included(base)
|
4
|
+
base.send :include, InstanceMethods
|
5
|
+
base.extend ClassMethods
|
6
|
+
end
|
4
7
|
|
5
|
-
|
6
|
-
LetterAvatar.generate(name, size)
|
8
|
+
module ClassMethods
|
7
9
|
end
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
+
module InstanceMethods
|
12
|
+
def self.included(base)
|
13
|
+
base.extend ClassMethods
|
14
|
+
end
|
15
|
+
|
16
|
+
def avatar_path(size = 200)
|
17
|
+
LetterAvatar.generate(name, size)
|
18
|
+
end
|
19
|
+
|
20
|
+
def avatar_url(size = 200)
|
21
|
+
avatar_path(size).gsub(/public/, '')
|
22
|
+
end
|
23
|
+
|
11
24
|
end
|
12
25
|
end
|
13
26
|
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.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Discourse Developers
|
@@ -12,21 +12,7 @@ autorequire:
|
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
14
|
date: 2016-05-30 00:00:00.000000000 Z
|
15
|
-
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
17
|
-
name: activesupport
|
18
|
-
requirement: !ruby/object:Gem::Requirement
|
19
|
-
requirements:
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 3.0.0
|
23
|
-
type: :runtime
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
requirements:
|
27
|
-
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 3.0.0
|
15
|
+
dependencies: []
|
30
16
|
description: Gem for creating letter avatar from user's name
|
31
17
|
email:
|
32
18
|
- kszczuka@gmail.com
|