gravity 0.1.1 → 0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -53,25 +53,31 @@ Here is a complete list of options:
53
53
  <td>true/false</td>
54
54
  </tr>
55
55
  <tr>
56
- <td><b>size</b> or <b>s</b></td>
56
+ <td><b>size</b></td>
57
57
  <td>The size of the image</td>
58
58
  <td>80</td>
59
59
  <td>1..512</td>
60
60
  </tr>
61
61
  <tr>
62
- <td><b>default</b> or <b>d</b></td>
62
+ <td><b>default</b></td>
63
63
  <td>The avatar image used by default</td>
64
64
  <td><i>none</i></td>
65
- <td>"identicon", "monsterid", "wavatar" or an absolute URL.</td>
65
+ <td>"404", "mm", "identicon", "monsterid", "wavatar", "retro" or an absolute URL (this must start with "http").</td>
66
66
  </tr>
67
67
  <tr>
68
- <td><b>rating</b> or <b>r</b></td>
68
+ <td><b>rating</b></td>
69
69
  <td>The lowest level of ratings you want to allow</td>
70
70
  <td>G</td>
71
71
  <td>G, PG, R or X</td>
72
72
  </tr>
73
+ <tr>
74
+ <td><b>forcedefault</b></td>
75
+ <td>Force usage of the default image</td>
76
+ <td>false</td>
77
+ <td>true/false</td>
78
+ </tr>
73
79
  </table>
74
80
 
75
- See the [Gravatar site](gravatar.com/site/implement/images) for more informations.
81
+ See the [Gravatar site](http://gravatar.com/site/implement/images) for more informations.
76
82
 
77
83
  Copyright (c) 2011 Giuseppe Capizzi, released under the MIT license
@@ -37,6 +37,10 @@ module Gravity
37
37
  secure = options.delete :secure
38
38
  url = gravatar_url(secure) + 'avatar/' + gravatar_hash(email)
39
39
 
40
+ if options.has_key?(:default)
41
+ options[:default] = CGI::encode options[:default] if options[:default].match(/^http/)
42
+ end
43
+
40
44
  if !options.empty?
41
45
  url += '?' + options.map{|o, v| "#{o}=#{v.to_s}"}.join('&')
42
46
  end
@@ -1,3 +1,3 @@
1
1
  module Gravity
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2"
3
3
  end
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gravity
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
8
+ - 2
9
+ version: "0.2"
11
10
  platform: ruby
12
11
  authors:
13
12
  - Giuseppe Capizzi