letter_avatar 0.1.7 → 0.1.8
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.rb +2 -12
- data/lib/letter_avatar/colors.rb +2 -0
- data/lib/letter_avatar/configuration.rb +39 -0
- data/lib/letter_avatar/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6adcf631452c47ccdb6e77de595811bf972f91de
|
4
|
+
data.tar.gz: 4c5f444c83d9b32c035bead3d50c618306ae0775
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecd96dc6fb72e9ed31806eff4d1c958a874da5d2e180e048579d7fb26984f3569d731082efd65f04ffeffd1a66866a5f60215cf46650f33608890b5b88ec3494
|
7
|
+
data.tar.gz: 8643f2ee02c117abe8afcd1dc87c16080431f83c1b80dfd06aa6520601296f6ab8e796a7e23849e710e8754c7abf3df31334fa4bbb1a7dc89be2ad6567faddd8
|
data/lib/letter_avatar.rb
CHANGED
@@ -1,20 +1,10 @@
|
|
1
1
|
require "letter_avatar/version"
|
2
|
+
require "letter_avatar/configuration"
|
2
3
|
require "letter_avatar/avatar"
|
3
4
|
require "letter_avatar/avatar_helper"
|
4
5
|
|
5
6
|
module LetterAvatar
|
6
|
-
|
7
|
-
mattr_accessor :cache_base_path
|
8
|
-
@@cache_base_path = nil
|
9
|
-
|
10
|
-
mattr_accessor :colors_palette
|
11
|
-
@@colors_palette = :google
|
12
|
-
|
13
|
-
mattr_accessor :weight
|
14
|
-
@@weight = 300
|
15
|
-
|
16
|
-
mattr_accessor :annotate_position
|
17
|
-
@@annotate_position = '-0+5'
|
7
|
+
extend LetterAvatar::Configuration
|
18
8
|
|
19
9
|
def self.setup(&block)
|
20
10
|
yield(self)
|
data/lib/letter_avatar/colors.rb
CHANGED
@@ -0,0 +1,39 @@
|
|
1
|
+
require "letter_avatar/colors"
|
2
|
+
|
3
|
+
module LetterAvatar
|
4
|
+
module Configuration
|
5
|
+
|
6
|
+
def cache_base_path
|
7
|
+
Thread.current[:cache_base_path]
|
8
|
+
end
|
9
|
+
|
10
|
+
def cache_base_path=(v)
|
11
|
+
Thread.current[:cache_base_path] = v
|
12
|
+
end
|
13
|
+
|
14
|
+
def colors_palette
|
15
|
+
Thread.current[:colors_palette] ||= :google
|
16
|
+
end
|
17
|
+
|
18
|
+
def colors_palette=(v)
|
19
|
+
Thread.current[:colors_palette] = v if v.in?(Colors::PALETTES)
|
20
|
+
end
|
21
|
+
|
22
|
+
def weight
|
23
|
+
Thread.current[:weight] ||= 300
|
24
|
+
end
|
25
|
+
|
26
|
+
def weight=(v)
|
27
|
+
Thread.current[:weight] = v
|
28
|
+
end
|
29
|
+
|
30
|
+
def annotate_position
|
31
|
+
Thread.current[:annotate_position] ||= '-0+5'
|
32
|
+
end
|
33
|
+
|
34
|
+
def annotate_position=(v)
|
35
|
+
Thread.current[:annotate_position] = v
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
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.1.
|
4
|
+
version: 0.1.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: 2016-02-
|
14
|
+
date: 2016-02-17 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: posix-spawn
|
@@ -74,6 +74,7 @@ files:
|
|
74
74
|
- lib/letter_avatar/avatar.rb
|
75
75
|
- lib/letter_avatar/avatar_helper.rb
|
76
76
|
- lib/letter_avatar/colors.rb
|
77
|
+
- lib/letter_avatar/configuration.rb
|
77
78
|
- lib/letter_avatar/has_avatar.rb
|
78
79
|
- lib/letter_avatar/version.rb
|
79
80
|
homepage: https://github.com/ksz2k/letter_avatar
|