letter_avatar 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Mjg4MzRhMjM5M2E5YjdmNzc4N2U5NDRlMDAwNTZlYjEzZDY5NTY4NA==
4
+ ODAxYzc0MjljZjRkMWNlNDBmOWUzODQ3YWFjZTAzMjI5ZDA5Yjc4OQ==
5
5
  data.tar.gz: !binary |-
6
- NWY2MGEwOWYyMTI1OGRjMzg4ZGIyZTJkMzliOTQxY2ViMDgyZTUzNQ==
6
+ YmFiY2ZlNjVhZjg3ZWIyZjU4YTdiYWQyNGEyNGI2NmFmY2U0Y2M4Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ODNlN2E0ZjAxNjkyODMzNWY5MWU2YmFlYzllOWExZmZlZTRmYzBmOWI4YWY5
10
- MzM2NmQ5MzIyM2YwMDVmNzI2YTk1N2FlMzEyY2FhYjU5NjU2MjNjMDUyNTZi
11
- ZjliOGEwMmE1YThlZTFhYjg4NThiZTQ3MGIzMTA4Mzc1M2JmMmQ=
9
+ MDQ0NzcxNmI2ZTVhNThiN2NlYzYwYjMyNjMwNzAxYjQ4ZmIwNWIzMWI4MGQw
10
+ YWQ0NGZlZTVkODhhODlmYjFiYTlmZGFmOGYwZDVhMDE2Y2Y1MDVhZWQxMjIy
11
+ NTliNjYxYjUwYWFkMjlkMTgxOGM4Njc5NjlhOGYxZDU0ZWY3MzU=
12
12
  data.tar.gz: !binary |-
13
- Y2NhYWVkZDY4NzkyNTI1MTNmMGVjZmNiOTQ4ZTllZWM1ZGNmZWI5OGNlNjY4
14
- YzU0NzZkM2Y5MWE4YzA1MzhiNDMzN2RiZWRjMDc1YzE0MTdjMzM4NTA2ZDUw
15
- YzJiNDUyMjFkZDcxYjg4ZTcwZTJhNmIyMGNmM2FmNzg0YzQ5YzA=
13
+ YzcxY2Q0N2MwYWVkZjQ4ZjYwMGVkNGRiNjVjOGRkYTJjMzExMmFiYzZhZjg5
14
+ ZTkxN2RkMmI1ODQ5ZmMyNDQyODYwMTg1NGU3MmZiYzdiNDFkNWJjYmZjNzI4
15
+ NjM5NTU5YTZhYTAyZWM5ODNmYjg3ZGE3MGRmOGU2Y2U4NjhjMzU=
data/README.md CHANGED
@@ -13,7 +13,9 @@ System requirements
13
13
 
14
14
  Add this line to your application's Gemfile:
15
15
 
16
- gem 'letter_avatar'
16
+ ```ruby
17
+ gem 'letter_avatar'
18
+ ```
17
19
 
18
20
  And then execute:
19
21
 
@@ -22,10 +24,21 @@ And then execute:
22
24
  Or install it yourself as:
23
25
 
24
26
  $ gem install letter_avatar
27
+
28
+ ## Configuration
29
+
30
+ ```ruby
31
+ LetterAvatar.setup do |config|
32
+ config.cache_base_path='public/system/lets' # default is 'public/system'
33
+ end
34
+ ```
25
35
 
26
36
  ## Usage
27
37
 
28
- TODO: Write usage instructions here
38
+ ```ruby
39
+ LetterAvatar.generate 'ksz2k', 200
40
+ => "public/system/letter_avatars/2/K/87_178_230/200.png"
41
+ ```
29
42
 
30
43
  ## Contributing
31
44
 
data/lib/letter_avatar.rb CHANGED
@@ -34,6 +34,10 @@ module LetterAvatar
34
34
  end
35
35
  end
36
36
 
37
+ def generate(username, size)
38
+ Avatar.generate(username, size)
39
+ end
40
+
37
41
  # palette of optimally disctinct colors
38
42
  # cf. http://tools.medialab.sciences-po.fr/iwanthue/index.php
39
43
  # parameters used:
@@ -1,3 +1,3 @@
1
1
  module LetterAvatar
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
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.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - discourse developers