gravaty 8.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of gravaty might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/CHANGELOG +587 -0
- data/COPYING.md +234 -0
- data/Gemfile +17 -0
- data/ISSUES.md +40 -0
- data/README.md +128 -0
- data/Rakefile +48 -0
- data/acknowledgements.md +40 -0
- data/authors.md +44 -0
- data/copyright.md +339 -0
- data/examples/avatar.rb +121 -0
- data/examples/basics.rb +60 -0
- data/examples/profile.rb +143 -0
- data/examples/xmlrpc.rb +33 -0
- data/gravaty.gemspec +59 -0
- data/gravaty.odp +0 -0
- data/gravaty.pdf +0 -0
- data/html/CHANGELOG.html +876 -0
- data/html/COPYING_md.html +803 -0
- data/html/Gemfile.html +114 -0
- data/html/Gravaty.html +322 -0
- data/html/Gravaty/Gravaty.html +997 -0
- data/html/Gravaty/ParsableDuckType.html +158 -0
- data/html/Gravaty/Parser.html +233 -0
- data/html/Gravaty/Parsers.html +94 -0
- data/html/Gravaty/Parsers/Avatar.html +166 -0
- data/html/Gravaty/Parsers/Callback.html +167 -0
- data/html/Gravaty/Parsers/Default.html +174 -0
- data/html/Gravaty/Parsers/Force.html +167 -0
- data/html/Gravaty/Parsers/Format.html +177 -0
- data/html/Gravaty/Parsers/Pixelsize.html +177 -0
- data/html/Gravaty/Parsers/Rating.html +177 -0
- data/html/Gravaty/Parsers/Secure.html +166 -0
- data/html/Gravaty/Parsers/Type.html +177 -0
- data/html/Gravaty/Utils.html +107 -0
- data/html/Gravaty/Utils/Downloader.html +106 -0
- data/html/Gravaty/Utils/Downloader/Downloader.html +224 -0
- data/html/Gravaty/Utils/Raisers.html +199 -0
- data/html/Gravaty/Utils/Rfc5322.html +149 -0
- data/html/Gravaty/Utils/RpcConnector.html +106 -0
- data/html/Gravaty/Utils/RpcConnector/RpcConnector.html +241 -0
- data/html/ISSUES_md.html +165 -0
- data/html/Object.html +183 -0
- data/html/README_md.html +436 -0
- data/html/Rakefile.html +152 -0
- data/html/acknowledgements_md.html +172 -0
- data/html/authors_md.html +178 -0
- data/html/copyright_md.html +553 -0
- data/html/created.rid +59 -0
- data/html/css/fonts.css +167 -0
- data/html/css/rdoc.css +590 -0
- data/html/fonts/Lato-Light.ttf +0 -0
- data/html/fonts/Lato-LightItalic.ttf +0 -0
- data/html/fonts/Lato-Regular.ttf +0 -0
- data/html/fonts/Lato-RegularItalic.ttf +0 -0
- data/html/fonts/SourceCodePro-Bold.ttf +0 -0
- data/html/fonts/SourceCodePro-Regular.ttf +0 -0
- data/html/gravaty_gemspec.html +162 -0
- data/html/images/add.png +0 -0
- data/html/images/arrow_up.png +0 -0
- data/html/images/brick.png +0 -0
- data/html/images/brick_link.png +0 -0
- data/html/images/bug.png +0 -0
- data/html/images/bullet_black.png +0 -0
- data/html/images/bullet_toggle_minus.png +0 -0
- data/html/images/bullet_toggle_plus.png +0 -0
- data/html/images/date.png +0 -0
- data/html/images/delete.png +0 -0
- data/html/images/find.png +0 -0
- data/html/images/loadingAnimation.gif +0 -0
- data/html/images/macFFBgHack.png +0 -0
- data/html/images/package.png +0 -0
- data/html/images/page_green.png +0 -0
- data/html/images/page_white_text.png +0 -0
- data/html/images/page_white_width.png +0 -0
- data/html/images/plugin.png +0 -0
- data/html/images/ruby.png +0 -0
- data/html/images/tag_blue.png +0 -0
- data/html/images/tag_green.png +0 -0
- data/html/images/transparent.png +0 -0
- data/html/images/wrench.png +0 -0
- data/html/images/wrench_orange.png +0 -0
- data/html/images/zoom.png +0 -0
- data/html/index.html +467 -0
- data/html/js/darkfish.js +161 -0
- data/html/js/jquery.js +4 -0
- data/html/js/navigation.js +142 -0
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +109 -0
- data/html/js/search_index.js +1 -0
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js +229 -0
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +479 -0
- data/lib/gravaty.rb +59 -0
- data/lib/gravaty/application.rb +272 -0
- data/lib/gravaty/constants.rb +53 -0
- data/lib/gravaty/locales/en.yml +34 -0
- data/lib/gravaty/locales/it.yml +34 -0
- data/lib/gravaty/locales/ja.yml +35 -0
- data/lib/gravaty/parser.rb +41 -0
- data/lib/gravaty/parsers/avatar.rb +33 -0
- data/lib/gravaty/parsers/callback.rb +34 -0
- data/lib/gravaty/parsers/default.rb +79 -0
- data/lib/gravaty/parsers/force.rb +33 -0
- data/lib/gravaty/parsers/format.rb +38 -0
- data/lib/gravaty/parsers/pixelsize.rb +38 -0
- data/lib/gravaty/parsers/rating.rb +38 -0
- data/lib/gravaty/parsers/secure.rb +32 -0
- data/lib/gravaty/parsers/type.rb +38 -0
- data/lib/gravaty/utils/downloader.rb +150 -0
- data/lib/gravaty/utils/raisers.rb +50 -0
- data/lib/gravaty/utils/rfc5322.rb +102 -0
- data/lib/gravaty/utils/rpc_connector.rb +71 -0
- data/lib/gravaty/version.rb +20 -0
- data/test/gravaty/locales/test_locales.rb +61 -0
- data/test/gravaty/parsers/test_avatar.rb +35 -0
- data/test/gravaty/parsers/test_callback.rb +37 -0
- data/test/gravaty/parsers/test_default.rb +69 -0
- data/test/gravaty/parsers/test_force.rb +35 -0
- data/test/gravaty/parsers/test_format.rb +48 -0
- data/test/gravaty/parsers/test_pixelsize.rb +50 -0
- data/test/gravaty/parsers/test_rating.rb +48 -0
- data/test/gravaty/parsers/test_secure.rb +35 -0
- data/test/gravaty/parsers/test_type.rb +37 -0
- data/test/gravaty/test_application.rb +111 -0
- data/test/gravaty/test_avatar.rb +115 -0
- data/test/gravaty/test_parsable_duck_type.rb +31 -0
- data/test/gravaty/test_parser.rb +55 -0
- data/test/gravaty/test_profile.rb +63 -0
- data/test/gravaty/utils/test_downloader.rb +43 -0
- data/test/gravaty/utils/test_raisers.rb +55 -0
- data/test/gravaty/utils/test_rfc5322.rb +58 -0
- data/test/gravaty/utils/test_rpc_connector.rb +74 -0
- data/test/test_gravaty.rb +44 -0
- data/test/test_helper.rb +77 -0
- metadata +315 -0
data/html/Gemfile.html
ADDED
@@ -0,0 +1,114 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>Gemfile - gravaty 8.0.0</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "./";
|
11
|
+
var index_rel_prefix = "./";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="./js/jquery.js"></script>
|
15
|
+
<script src="./js/darkfish.js"></script>
|
16
|
+
|
17
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
18
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
<body id="top" role="document" class="file">
|
23
|
+
<nav role="navigation">
|
24
|
+
<div id="project-navigation">
|
25
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
26
|
+
<h2>
|
27
|
+
<a href="./index.html" rel="home">Home</a>
|
28
|
+
</h2>
|
29
|
+
|
30
|
+
<div id="table-of-contents-navigation">
|
31
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
32
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
33
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
|
37
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
38
|
+
<form action="#" method="get" accept-charset="utf-8">
|
39
|
+
<div id="search-field-wrapper">
|
40
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
41
|
+
aria-autocomplete="list" aria-controls="search-results"
|
42
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
43
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<ul id="search-results" aria-label="Search Results"
|
47
|
+
aria-busy="false" aria-expanded="false"
|
48
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
49
|
+
</form>
|
50
|
+
</div>
|
51
|
+
|
52
|
+
</div>
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
<div id="project-metadata">
|
57
|
+
<div id="fileindex-section" class="nav-section">
|
58
|
+
<h3>Pages</h3>
|
59
|
+
|
60
|
+
<ul class="link-list">
|
61
|
+
|
62
|
+
<li><a href="./CHANGELOG.html">CHANGELOG</a>
|
63
|
+
|
64
|
+
<li><a href="./COPYING_md.html">COPYING</a>
|
65
|
+
|
66
|
+
<li><a href="./Gemfile.html">Gemfile</a>
|
67
|
+
|
68
|
+
<li><a href="./ISSUES_md.html">ISSUES</a>
|
69
|
+
|
70
|
+
<li><a href="./README_md.html">README</a>
|
71
|
+
|
72
|
+
<li><a href="./Rakefile.html">Rakefile</a>
|
73
|
+
|
74
|
+
<li><a href="./acknowledgements_md.html">acknowledgements</a>
|
75
|
+
|
76
|
+
<li><a href="./authors_md.html">authors</a>
|
77
|
+
|
78
|
+
<li><a href="./copyright_md.html">copyright</a>
|
79
|
+
|
80
|
+
<li><a href="./gravaty_gemspec.html">gravaty.gemspec</a>
|
81
|
+
|
82
|
+
</ul>
|
83
|
+
</div>
|
84
|
+
|
85
|
+
</div>
|
86
|
+
</nav>
|
87
|
+
|
88
|
+
<main role="main" aria-label="Page Gemfile">
|
89
|
+
|
90
|
+
<p># gravaty # Copyright © 2013, 2014, 2015, 2016 Marco Bresciani # # This
|
91
|
+
file is part of gravaty. # # gravaty is free software: you can redistribute
|
92
|
+
it and/or modify it under the terms of the GNU General Public License # as
|
93
|
+
published by the Free Software Foundation, either version 3 of the License,
|
94
|
+
or (at your option) any later version. # # gravaty is distributed in the
|
95
|
+
hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
|
96
|
+
implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
97
|
+
See the GNU General Public License for more details. # # You should have
|
98
|
+
received a copy of the GNU General Public License along with gravaty. If
|
99
|
+
not, see # <<a
|
100
|
+
href="http://www.gnu.org/licenses">www.gnu.org/licenses</a>/>.</p>
|
101
|
+
|
102
|
+
<p>source '<a href="https://rubygems.org">rubygems.org</a>'</p>
|
103
|
+
|
104
|
+
<p>gemspec</p>
|
105
|
+
</main>
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
<footer id="validator-badges" role="contentinfo">
|
110
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
111
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.0.4.
|
112
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
113
|
+
</footer>
|
114
|
+
|
data/html/Gravaty.html
ADDED
@@ -0,0 +1,322 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>module Gravaty - gravaty 8.0.0</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "./";
|
11
|
+
var index_rel_prefix = "./";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="./js/jquery.js"></script>
|
15
|
+
<script src="./js/darkfish.js"></script>
|
16
|
+
|
17
|
+
<link href="./css/fonts.css" rel="stylesheet">
|
18
|
+
<link href="./css/rdoc.css" rel="stylesheet">
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
<body id="top" role="document" class="module">
|
23
|
+
<nav role="navigation">
|
24
|
+
<div id="project-navigation">
|
25
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
26
|
+
<h2>
|
27
|
+
<a href="./index.html" rel="home">Home</a>
|
28
|
+
</h2>
|
29
|
+
|
30
|
+
<div id="table-of-contents-navigation">
|
31
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
32
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
33
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
|
37
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
38
|
+
<form action="#" method="get" accept-charset="utf-8">
|
39
|
+
<div id="search-field-wrapper">
|
40
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
41
|
+
aria-autocomplete="list" aria-controls="search-results"
|
42
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
43
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<ul id="search-results" aria-label="Search Results"
|
47
|
+
aria-busy="false" aria-expanded="false"
|
48
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
49
|
+
</form>
|
50
|
+
</div>
|
51
|
+
|
52
|
+
</div>
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
<div id="class-metadata">
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
<!-- Method Quickref -->
|
62
|
+
<div id="method-list-section" class="nav-section">
|
63
|
+
<h3>Methods</h3>
|
64
|
+
|
65
|
+
<ul class="link-list" role="directory">
|
66
|
+
|
67
|
+
<li ><a href="#method-c-gravatize">::gravatize</a>
|
68
|
+
|
69
|
+
</ul>
|
70
|
+
</div>
|
71
|
+
|
72
|
+
</div>
|
73
|
+
</nav>
|
74
|
+
|
75
|
+
<main role="main" aria-labelledby="module-Gravaty">
|
76
|
+
<h1 id="module-Gravaty" class="module">
|
77
|
+
module Gravaty
|
78
|
+
</h1>
|
79
|
+
|
80
|
+
<section class="description">
|
81
|
+
<dl class="rdoc-list note-list"><dt>Author
|
82
|
+
<dd>
|
83
|
+
<p><a href="mailto:m.bresciani@email.it">Marco Bresciani</a></p>
|
84
|
+
</dd><dt>Copyright
|
85
|
+
<dd>
|
86
|
+
<p>Copyright © 2013, 2014, 2015, 2016 Marco Bresciani</p>
|
87
|
+
</dd><dt>License
|
88
|
+
<dd>
|
89
|
+
<p>GNU General Public License version 3</p>
|
90
|
+
</dd></dl>
|
91
|
+
|
92
|
+
</section>
|
93
|
+
|
94
|
+
|
95
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<section class="constants-list">
|
102
|
+
<header>
|
103
|
+
<h3>Constants</h3>
|
104
|
+
</header>
|
105
|
+
<dl>
|
106
|
+
|
107
|
+
<dt id="ALLOWED_PARAMS">ALLOWED_PARAMS
|
108
|
+
|
109
|
+
<dd><p>Allowed parameters names. Currently: avatar, callback, default, force,
|
110
|
+
format, pixelsize, rating, secure and type.</p>
|
111
|
+
|
112
|
+
|
113
|
+
<dt id="ALLOWED_SIZES">ALLOWED_SIZES
|
114
|
+
|
115
|
+
<dd><p>Allowed sizes (in pixels) for images requests. Currently a range from 1 to
|
116
|
+
2048 (included).</p>
|
117
|
+
|
118
|
+
|
119
|
+
<dt id="AVATAR_FORMATS">AVATAR_FORMATS
|
120
|
+
|
121
|
+
<dd><p>Allowed formats (extensions) for avatar requests. Currently: jp(e)g, png
|
122
|
+
and gif.</p>
|
123
|
+
|
124
|
+
|
125
|
+
<dt id="DEFAULT_OPTIONS">DEFAULT_OPTIONS
|
126
|
+
|
127
|
+
<dd><p>Currently allowed default builtin options. Currently: 404, mm, identicon,
|
128
|
+
monsterid,wavatar, retro and blank.</p>
|
129
|
+
|
130
|
+
|
131
|
+
<dt id="IMAGES_FORMATS">IMAGES_FORMATS
|
132
|
+
|
133
|
+
<dd><p>Allowed formats (extensions) for default own images. Currently: jp(e)g, png
|
134
|
+
and gif.</p>
|
135
|
+
|
136
|
+
|
137
|
+
<dt id="PROFILES">PROFILES
|
138
|
+
|
139
|
+
<dd><p>Formats allowing supplemental options for profile requests. Currently json
|
140
|
+
and qr.</p>
|
141
|
+
|
142
|
+
|
143
|
+
<dt id="PROFILE_FORMATS">PROFILE_FORMATS
|
144
|
+
|
145
|
+
<dd><p>Allowed formats (extensions) for profile requests. Currently: json, xml,
|
146
|
+
php, vcf and qr.</p>
|
147
|
+
|
148
|
+
|
149
|
+
<dt id="RATING_OPTIONS">RATING_OPTIONS
|
150
|
+
|
151
|
+
<dd><p>Allowed rating options. Currently: g, pg, r and x.</p>
|
152
|
+
|
153
|
+
|
154
|
+
<dt id="RPC_ERRORS">RPC_ERRORS
|
155
|
+
|
156
|
+
<dd><p>Possible XML-RPC API errors.</p>
|
157
|
+
|
158
|
+
|
159
|
+
<dt id="RPC_METHODS">RPC_METHODS
|
160
|
+
|
161
|
+
<dd><p>Allowed XML-RPC API methods.</p>
|
162
|
+
|
163
|
+
|
164
|
+
<dt id="RPC_TEST_METHOD">RPC_TEST_METHOD
|
165
|
+
|
166
|
+
<dd><p>Default test method for XML-RPC API.</p>
|
167
|
+
|
168
|
+
|
169
|
+
<dt id="RPC_URI">RPC_URI
|
170
|
+
|
171
|
+
<dd><p>Reference URI for XML-RPC API.</p>
|
172
|
+
|
173
|
+
|
174
|
+
<dt id="TEST_BASIC_AVATAR">TEST_BASIC_AVATAR
|
175
|
+
|
176
|
+
<dd><p>Example basic URI (avatar part) for testing purposes.</p>
|
177
|
+
|
178
|
+
|
179
|
+
<dt id="TEST_BASIC_PROFILE">TEST_BASIC_PROFILE
|
180
|
+
|
181
|
+
<dd><p>Example basic URI (profile part) for testing purposes.</p>
|
182
|
+
|
183
|
+
|
184
|
+
<dt id="TEST_CALLBACK">TEST_CALLBACK
|
185
|
+
|
186
|
+
<dd><p>Example generic callback string for testing purposes.</p>
|
187
|
+
|
188
|
+
|
189
|
+
<dt id="TEST_FORCED">TEST_FORCED
|
190
|
+
|
191
|
+
<dd><p>Example resulting query string when forced default for testing purposes.</p>
|
192
|
+
|
193
|
+
|
194
|
+
<dt id="TEST_JSON_REGEXP">TEST_JSON_REGEXP
|
195
|
+
|
196
|
+
<dd><p>Example json file extension regular expression for testing purposes.</p>
|
197
|
+
|
198
|
+
|
199
|
+
<dt id="TEST_MY_ADDRESS">TEST_MY_ADDRESS
|
200
|
+
|
201
|
+
<dd><p>Example mail address for testing purposes.</p>
|
202
|
+
|
203
|
+
|
204
|
+
<dt id="TEST_MY_MD5">TEST_MY_MD5
|
205
|
+
|
206
|
+
<dd><p>Example MD5'ed mail address for testing purposes.</p>
|
207
|
+
|
208
|
+
|
209
|
+
<dt id="TEST_QR_REGEXP">TEST_QR_REGEXP
|
210
|
+
|
211
|
+
<dd><p>Example QRCode file extension regular expression for testing purposes.</p>
|
212
|
+
|
213
|
+
|
214
|
+
<dt id="TEST_SECURE_URI_REGEXP">TEST_SECURE_URI_REGEXP
|
215
|
+
|
216
|
+
<dd><p>Example secure (HTTPS) URI header regular expression for testing purposes.</p>
|
217
|
+
|
218
|
+
|
219
|
+
<dt id="TEST_SIMPLE_URI_REGEXP">TEST_SIMPLE_URI_REGEXP
|
220
|
+
|
221
|
+
<dd><p>Example simple (HTTP) URI header regular expression for testing purposes.</p>
|
222
|
+
|
223
|
+
|
224
|
+
<dt id="TEST_SIZE_REGEXP">TEST_SIZE_REGEXP
|
225
|
+
|
226
|
+
<dd><p>Example size string regular expression for testing purposes.</p>
|
227
|
+
|
228
|
+
|
229
|
+
<dt id="TEST_STRING">TEST_STRING
|
230
|
+
|
231
|
+
<dd><p>Example hash with basic URI parts for testing purposes.</p>
|
232
|
+
|
233
|
+
|
234
|
+
<dt id="TEST_UNSECURE_URI_REGEXP">TEST_UNSECURE_URI_REGEXP
|
235
|
+
|
236
|
+
<dd><p>Example unsecure (HTTP) URI header regular expression for testing purposes.</p>
|
237
|
+
|
238
|
+
|
239
|
+
<dt id="VERSION">VERSION
|
240
|
+
|
241
|
+
<dd><p>Current version number for <a href="Gravaty/Gravaty.html">Gravaty</a> gem.</p>
|
242
|
+
|
243
|
+
|
244
|
+
</dl>
|
245
|
+
</section>
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
252
|
+
<header>
|
253
|
+
<h3>Public Class Methods</h3>
|
254
|
+
</header>
|
255
|
+
|
256
|
+
|
257
|
+
<div id="method-c-gravatize" class="method-detail ">
|
258
|
+
|
259
|
+
<div class="method-heading">
|
260
|
+
<span class="method-name">gravatize</span><span
|
261
|
+
class="method-args">(email_address)</span>
|
262
|
+
|
263
|
+
<span class="method-click-advice">click to toggle source</span>
|
264
|
+
|
265
|
+
</div>
|
266
|
+
|
267
|
+
|
268
|
+
<div class="method-description">
|
269
|
+
|
270
|
+
<p>Creates a new <a href="Gravaty/Gravaty.html">Gravaty</a> described by the
|
271
|
+
user's <code>email</code>. Throws a <code>ArgumentError</code>
|
272
|
+
exception if the supplied <code>email</code> address is nil or not valid
|
273
|
+
according to RFC5322.</p>
|
274
|
+
<dl class="rdoc-list note-list"><dt>Usage
|
275
|
+
<dd><ul><li>
|
276
|
+
<p><code>new_gravaty = Gravaty::gravatize email</code></p>
|
277
|
+
</li><li>
|
278
|
+
<p><code>new_gravaty = Gravaty::gravatize(email)</code></p>
|
279
|
+
</li></ul>
|
280
|
+
</dd><dt>Params
|
281
|
+
<dd>
|
282
|
+
<p><code>email_address</code>, the user's email address (a syntactically
|
283
|
+
valid one).</p>
|
284
|
+
</dd><dt>Returns
|
285
|
+
<dd>
|
286
|
+
<p>a <code>Gravaty</code> object for the specified <code>email</code> address.</p>
|
287
|
+
</dd><dt>Raises
|
288
|
+
<dd>
|
289
|
+
<p><code>ArgumentError</code>, if the supplied <code>email</code> address is
|
290
|
+
<code>nil</code> or not valid according to RFC 5322.</p>
|
291
|
+
</dd></dl>
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
<div class="method-source-code" id="gravatize-source">
|
297
|
+
<pre><span class="ruby-comment"># File lib/gravaty.rb, line 46</span>
|
298
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">gravatize</span>(<span class="ruby-identifier">email_address</span>)
|
299
|
+
<span class="ruby-constant">Gravaty</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">email_address</span>, <span class="ruby-identifier">parser</span>
|
300
|
+
<span class="ruby-keyword">end</span></pre>
|
301
|
+
</div>
|
302
|
+
|
303
|
+
</div>
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
</div>
|
309
|
+
|
310
|
+
|
311
|
+
</section>
|
312
|
+
|
313
|
+
</section>
|
314
|
+
</main>
|
315
|
+
|
316
|
+
|
317
|
+
<footer id="validator-badges" role="contentinfo">
|
318
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
319
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.0.4.
|
320
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
321
|
+
</footer>
|
322
|
+
|
@@ -0,0 +1,997 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Gravaty::Gravaty - gravaty 8.0.0</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../js/jquery.js"></script>
|
15
|
+
<script src="../js/darkfish.js"></script>
|
16
|
+
|
17
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
18
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
<body id="top" role="document" class="class">
|
23
|
+
<nav role="navigation">
|
24
|
+
<div id="project-navigation">
|
25
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
26
|
+
<h2>
|
27
|
+
<a href="../index.html" rel="home">Home</a>
|
28
|
+
</h2>
|
29
|
+
|
30
|
+
<div id="table-of-contents-navigation">
|
31
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
32
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
33
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
|
37
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
38
|
+
<form action="#" method="get" accept-charset="utf-8">
|
39
|
+
<div id="search-field-wrapper">
|
40
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
41
|
+
aria-autocomplete="list" aria-controls="search-results"
|
42
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
43
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<ul id="search-results" aria-label="Search Results"
|
47
|
+
aria-busy="false" aria-expanded="false"
|
48
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
49
|
+
</form>
|
50
|
+
</div>
|
51
|
+
|
52
|
+
</div>
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
<div id="class-metadata">
|
57
|
+
|
58
|
+
<div id="parent-class-section" class="nav-section">
|
59
|
+
<h3>Parent</h3>
|
60
|
+
|
61
|
+
|
62
|
+
<p class="link"><a href="../Object.html">Object</a>
|
63
|
+
|
64
|
+
</div>
|
65
|
+
|
66
|
+
<div id="includes-section" class="nav-section">
|
67
|
+
<h3>Included Modules</h3>
|
68
|
+
|
69
|
+
<ul class="link-list">
|
70
|
+
|
71
|
+
|
72
|
+
<li><span class="include">Comparable</span>
|
73
|
+
|
74
|
+
|
75
|
+
</ul>
|
76
|
+
</div>
|
77
|
+
|
78
|
+
|
79
|
+
<!-- Method Quickref -->
|
80
|
+
<div id="method-list-section" class="nav-section">
|
81
|
+
<h3>Methods</h3>
|
82
|
+
|
83
|
+
<ul class="link-list" role="directory">
|
84
|
+
|
85
|
+
<li ><a href="#method-c-new">::new</a>
|
86
|
+
|
87
|
+
<li ><a href="#method-i-3C-3D-3E">#<=></a>
|
88
|
+
|
89
|
+
<li ><a href="#method-i-avatar">#avatar</a>
|
90
|
+
|
91
|
+
<li ><a href="#method-i-avatar-21">#avatar!</a>
|
92
|
+
|
93
|
+
<li ><a href="#method-i-download">#download</a>
|
94
|
+
|
95
|
+
<li ><a href="#method-i-json">#json</a>
|
96
|
+
|
97
|
+
<li ><a href="#method-i-json-21">#json!</a>
|
98
|
+
|
99
|
+
<li ><a href="#method-i-profile">#profile</a>
|
100
|
+
|
101
|
+
<li ><a href="#method-i-profile-21">#profile!</a>
|
102
|
+
|
103
|
+
<li ><a href="#method-i-qrcode">#qrcode</a>
|
104
|
+
|
105
|
+
<li ><a href="#method-i-qrcode-21">#qrcode!</a>
|
106
|
+
|
107
|
+
<li ><a href="#method-i-reset">#reset</a>
|
108
|
+
|
109
|
+
<li ><a href="#method-i-to_json">#to_json</a>
|
110
|
+
|
111
|
+
<li ><a href="#method-i-to_s">#to_s</a>
|
112
|
+
|
113
|
+
<li ><a href="#method-i-xmlrpc">#xmlrpc</a>
|
114
|
+
|
115
|
+
</ul>
|
116
|
+
</div>
|
117
|
+
|
118
|
+
</div>
|
119
|
+
</nav>
|
120
|
+
|
121
|
+
<main role="main" aria-labelledby="class-Gravaty::Gravaty">
|
122
|
+
<h1 id="class-Gravaty::Gravaty" class="class">
|
123
|
+
class Gravaty::Gravaty
|
124
|
+
</h1>
|
125
|
+
|
126
|
+
<section class="description">
|
127
|
+
|
128
|
+
<p>This class is a simple API to retrieve an URL with specified options from
|
129
|
+
Gravatar site. It can be used to read data for avatars, profiles or for
|
130
|
+
XML-RPC APi calls. The only needed parameter to create a <a
|
131
|
+
href="Gravaty.html">Gravaty</a> object is the reference <code>email</code>
|
132
|
+
address.</p>
|
133
|
+
<dl class="rdoc-list note-list"><dt>Author
|
134
|
+
<dd>
|
135
|
+
<p><a href="mailto:m.bresciani@email.it">Marco Bresciani</a></p>
|
136
|
+
</dd><dt>Copyright
|
137
|
+
<dd>
|
138
|
+
<p>Copyright © 2013, 2014, 2015, 2016 Marco Bresciani</p>
|
139
|
+
</dd><dt>License
|
140
|
+
<dd>
|
141
|
+
<p>GNU General Public License version 3</p>
|
142
|
+
</dd></dl>
|
143
|
+
|
144
|
+
</section>
|
145
|
+
|
146
|
+
|
147
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
<section class="attribute-method-details" class="method-section">
|
156
|
+
<header>
|
157
|
+
<h3>Attributes</h3>
|
158
|
+
</header>
|
159
|
+
|
160
|
+
|
161
|
+
<div id="attribute-i-digest" class="method-detail">
|
162
|
+
<div class="method-heading attribute-method-heading">
|
163
|
+
<span class="method-name">digest</span><span
|
164
|
+
class="attribute-access-type">[R]</span>
|
165
|
+
</div>
|
166
|
+
|
167
|
+
<div class="method-description">
|
168
|
+
|
169
|
+
<p>Provides the MD5 signature (of the small caps version) of the
|
170
|
+
<code>email</code> address used to build the object.</p>
|
171
|
+
|
172
|
+
</div>
|
173
|
+
</div>
|
174
|
+
|
175
|
+
<div id="attribute-i-email" class="method-detail">
|
176
|
+
<div class="method-heading attribute-method-heading">
|
177
|
+
<span class="method-name">email</span><span
|
178
|
+
class="attribute-access-type">[R]</span>
|
179
|
+
</div>
|
180
|
+
|
181
|
+
<div class="method-description">
|
182
|
+
|
183
|
+
<p>Provides the (small caps version of) <code>email</code> address used to
|
184
|
+
build the object.</p>
|
185
|
+
|
186
|
+
</div>
|
187
|
+
</div>
|
188
|
+
|
189
|
+
</section>
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
194
|
+
<header>
|
195
|
+
<h3>Public Class Methods</h3>
|
196
|
+
</header>
|
197
|
+
|
198
|
+
|
199
|
+
<div id="method-c-new" class="method-detail ">
|
200
|
+
|
201
|
+
<div class="method-heading">
|
202
|
+
<span class="method-name">new</span><span
|
203
|
+
class="method-args">(email_address, parser)</span>
|
204
|
+
|
205
|
+
<span class="method-click-advice">click to toggle source</span>
|
206
|
+
|
207
|
+
</div>
|
208
|
+
|
209
|
+
|
210
|
+
<div class="method-description">
|
211
|
+
|
212
|
+
<p>Creates a <code>Gravaty</code> object described by the user's
|
213
|
+
<code>email</code>. Throws an <code>ArgumentError</code> exception if the
|
214
|
+
supplied <code>email</code> address is <code>nil</code> or not valid
|
215
|
+
according to RFC5322.</p>
|
216
|
+
<dl class="rdoc-list note-list"><dt>Usage
|
217
|
+
<dd>
|
218
|
+
<p><code>new_gravaty = Gravaty.new email, parser</code></p>
|
219
|
+
</dd><dt>Params
|
220
|
+
<dd><ul><li>
|
221
|
+
<p><code>email_address</code>, the user's <a
|
222
|
+
href="Gravaty.html#attribute-i-email">#email</a> address (a syntactically
|
223
|
+
valid one).</p>
|
224
|
+
</li><li>
|
225
|
+
<p><code>parser</code>, a parser duck-responding to the <code>parse</code>
|
226
|
+
method with two parameters, <code>method</code> name and <code>value</code>
|
227
|
+
string</p>
|
228
|
+
</li></ul>
|
229
|
+
</dd><dt>Returns
|
230
|
+
<dd>
|
231
|
+
<p>a <code>Gravaty</code> object for the specified <code>email</code> address.</p>
|
232
|
+
</dd><dt>Raises
|
233
|
+
<dd>
|
234
|
+
<p><code>ArgumentError</code>, if the supplied <code>email</code> address is
|
235
|
+
<code>nil</code> or not valid according to RFC 5322.</p>
|
236
|
+
</dd></dl>
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
<div class="method-source-code" id="new-source">
|
242
|
+
<pre><span class="ruby-comment"># File lib/gravaty/application.rb, line 50</span>
|
243
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">email_address</span>, <span class="ruby-identifier">parser</span>)
|
244
|
+
<span class="ruby-constant">I18n</span>.<span class="ruby-identifier">load_path</span> = <span class="ruby-constant">Dir</span>[<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword">__FILE__</span>), <span class="ruby-string">'/locales/'</span>, <span class="ruby-string">'*.yml'</span>)]
|
245
|
+
|
246
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">t</span>(<span class="ruby-string">'error.nil'</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">email_address</span>.<span class="ruby-identifier">nil?</span>
|
247
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">t</span>(<span class="ruby-string">'error.invalid'</span>, <span class="ruby-value">value:</span> <span class="ruby-identifier">email_address</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">Utils</span><span class="ruby-operator">::</span><span class="ruby-constant">Rfc5322</span><span class="ruby-operator">::</span><span class="ruby-constant">EMAIL</span>.<span class="ruby-identifier">match</span> <span class="ruby-identifier">email_address</span> <span class="ruby-comment"># thanks Peter!</span>
|
248
|
+
|
249
|
+
<span class="ruby-ivar">@email</span> = <span class="ruby-identifier">email_address</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span>
|
250
|
+
<span class="ruby-ivar">@digest</span> = <span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">MD5</span>.<span class="ruby-identifier">hexdigest</span> <span class="ruby-identifier">email</span>
|
251
|
+
<span class="ruby-ivar">@gravaty</span> = <span class="ruby-identifier">email</span>
|
252
|
+
<span class="ruby-ivar">@parser</span> = <span class="ruby-identifier">parser</span>
|
253
|
+
<span class="ruby-keyword">end</span></pre>
|
254
|
+
</div>
|
255
|
+
|
256
|
+
</div>
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
</div>
|
262
|
+
|
263
|
+
|
264
|
+
</section>
|
265
|
+
|
266
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
267
|
+
<header>
|
268
|
+
<h3>Public Instance Methods</h3>
|
269
|
+
</header>
|
270
|
+
|
271
|
+
|
272
|
+
<div id="method-i-3C-3D-3E" class="method-detail ">
|
273
|
+
|
274
|
+
<div class="method-heading">
|
275
|
+
<span class="method-name"><=></span><span
|
276
|
+
class="method-args">(other_gravaty)</span>
|
277
|
+
|
278
|
+
<span class="method-click-advice">click to toggle source</span>
|
279
|
+
|
280
|
+
</div>
|
281
|
+
|
282
|
+
|
283
|
+
<div class="method-description">
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
<div class="method-source-code" id="3C-3D-3E-source">
|
291
|
+
<pre><span class="ruby-comment"># File lib/gravaty/application.rb, line 248</span>
|
292
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title"><=></span>(<span class="ruby-identifier">other_gravaty</span>)
|
293
|
+
<span class="ruby-ivar">@email</span> <span class="ruby-operator"><=></span> <span class="ruby-identifier">other_gravaty</span>.<span class="ruby-identifier">email</span>
|
294
|
+
<span class="ruby-keyword">end</span></pre>
|
295
|
+
</div>
|
296
|
+
|
297
|
+
</div>
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
</div>
|
303
|
+
|
304
|
+
|
305
|
+
<div id="method-i-avatar" class="method-detail ">
|
306
|
+
|
307
|
+
<div class="method-heading">
|
308
|
+
<span class="method-name">avatar</span><span
|
309
|
+
class="method-args">(args = {})</span>
|
310
|
+
|
311
|
+
<span class="method-click-advice">click to toggle source</span>
|
312
|
+
|
313
|
+
</div>
|
314
|
+
|
315
|
+
|
316
|
+
<div class="method-description">
|
317
|
+
|
318
|
+
<p>Returns a string containing the URI of the gravatar associated to internal
|
319
|
+
(provided) <a href="Gravaty.html#attribute-i-email">#email</a> address.
|
320
|
+
Valid keys for the <code>args</code> hash are: :type, :pixel_size, :force,
|
321
|
+
:secure, :rating, :default.</p>
|
322
|
+
<dl class="rdoc-list note-list"><dt>Usage
|
323
|
+
<dd><ul><li>
|
324
|
+
<p><code>a_string = new_gravaty.avatar</code></p>
|
325
|
+
</li><li>
|
326
|
+
<p><code>a_string = new_gravaty.avatar</code></p>
|
327
|
+
</li><li>
|
328
|
+
<p><code>a_string = new_gravaty.avatar pixel_size: 42</code></p>
|
329
|
+
</li><li>
|
330
|
+
<p><code>a_string = new_gravaty.avatar pixel_size: 42, type:
|
331
|
+
'png'</code></p>
|
332
|
+
</li><li>
|
333
|
+
<p><code>a_string = new_gravaty.avatar secure: false</code></p>
|
334
|
+
</li><li>
|
335
|
+
<p><code>a_string = new_gravaty.avatar type: 'jpg', force: true</code></p>
|
336
|
+
</li><li>
|
337
|
+
<p><code>a_string = new_gravaty.avatar secure: true, pixel_size: 42, type:
|
338
|
+
'png'</code></p>
|
339
|
+
</li><li>
|
340
|
+
<p><code>a_string = new_gravaty.avatar rating: pg, type: 'gif'</code></p>
|
341
|
+
</li><li>
|
342
|
+
<p><code>a_string = new_gravaty.avatar default: monsterid, pixel_size:
|
343
|
+
42</code></p>
|
344
|
+
</li></ul>
|
345
|
+
</dd><dt>Params
|
346
|
+
<dd><ul><li>
|
347
|
+
<p><code>type</code>: [String] is the possibly desired specific image format.
|
348
|
+
Valid formats are jp(e)g, png or gif. Default to no extension. Will be
|
349
|
+
downcased. Raises <code>ArgumentError</code> for invalid formats.</p>
|
350
|
+
</li><li>
|
351
|
+
<p><code>pixel_size</code>: [Integer] is the size in pixel of the image. From
|
352
|
+
1 to 2048. Default to no value. Raises <code>ArgumentError</code> for
|
353
|
+
invalid sizes.</p>
|
354
|
+
</li><li>
|
355
|
+
<p><code>force</code>: [TrueClass || FalseClass] is a boolean to specify if
|
356
|
+
the default has to be forced when no image is found. Default to false.</p>
|
357
|
+
</li><li>
|
358
|
+
<p><code>secure</code>: [TrueClass || FalseClass] is a boolean to specify
|
359
|
+
whether the resulting URL shall be HTTPS or HTTP type. Default to true
|
360
|
+
(HTTPS).</p>
|
361
|
+
</li><li>
|
362
|
+
<p><code>rating</code>: [String] is the rating type of the image. Valid values
|
363
|
+
are 'g', 'pg', 'r' and 'x'.</p>
|
364
|
+
</li><li>
|
365
|
+
<p><code>default</code>: [String] is the default type of the image (valid
|
366
|
+
values are '404', 'mm', 'identicon',
|
367
|
+
'monsterid', 'wavatar', 'retro' and
|
368
|
+
'blank'), or the URI for an own default image. For the URI
|
369
|
+
validation see: <a
|
370
|
+
href="http://it.gravatar.com/site/implement/images/#default-image">it.gravatar.com/site/implement/images/#default-image</a>
|
371
|
+
.</p>
|
372
|
+
</li></ul>
|
373
|
+
</dd><dt>Returns
|
374
|
+
<dd>
|
375
|
+
<p>a <code>String</code> containing the Gravatar site URI with specified
|
376
|
+
options and configuration parameters.</p>
|
377
|
+
</dd></dl>
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
|
382
|
+
<div class="method-source-code" id="avatar-source">
|
383
|
+
<pre><span class="ruby-comment"># File lib/gravaty/application.rb, line 82</span>
|
384
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">avatar</span>(<span class="ruby-identifier">args</span> = {})
|
385
|
+
<span class="ruby-identifier">secure</span> = <span class="ruby-keyword">true</span>
|
386
|
+
<span class="ruby-identifier">type</span> = <span class="ruby-keyword">nil</span>
|
387
|
+
|
388
|
+
<span class="ruby-identifier">array</span> = []
|
389
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">nil?</span>
|
390
|
+
<span class="ruby-identifier">type</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value">:type</span>, <span class="ruby-keyword">nil</span>)
|
391
|
+
<span class="ruby-identifier">secure</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value">:secure</span>, <span class="ruby-identifier">secure</span>)
|
392
|
+
|
393
|
+
[<span class="ruby-value">:pixelsize</span>, <span class="ruby-value">:force</span>, <span class="ruby-value">:default</span>, <span class="ruby-value">:rating</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">param</span><span class="ruby-operator">|</span>
|
394
|
+
<span class="ruby-identifier">array</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">param</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">args</span>[<span class="ruby-identifier">param</span>]) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">args</span>[<span class="ruby-identifier">param</span>].<span class="ruby-identifier">nil?</span>
|
395
|
+
<span class="ruby-keyword">end</span>
|
396
|
+
<span class="ruby-keyword">end</span>
|
397
|
+
|
398
|
+
<span class="ruby-identifier">build_uri</span>(<span class="ruby-identifier">secure</span>, <span class="ruby-keyword">true</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">digest</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-string">'type'</span>, <span class="ruby-identifier">type</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">build_query_string</span>(<span class="ruby-identifier">array</span>)
|
399
|
+
<span class="ruby-keyword">end</span></pre>
|
400
|
+
</div>
|
401
|
+
|
402
|
+
</div>
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
</div>
|
408
|
+
|
409
|
+
|
410
|
+
<div id="method-i-avatar-21" class="method-detail ">
|
411
|
+
|
412
|
+
<div class="method-heading">
|
413
|
+
<span class="method-name">avatar!</span><span
|
414
|
+
class="method-args">(args = {})</span>
|
415
|
+
|
416
|
+
<span class="method-click-advice">click to toggle source</span>
|
417
|
+
|
418
|
+
</div>
|
419
|
+
|
420
|
+
|
421
|
+
<div class="method-description">
|
422
|
+
|
423
|
+
<p>See <a href="Gravaty.html#method-i-avatar">#avatar</a> method. This banged
|
424
|
+
version saves the resulting string as internal state.</p>
|
425
|
+
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
<div class="method-source-code" id="avatar-21-source">
|
430
|
+
<pre><span class="ruby-comment"># File lib/gravaty/application.rb, line 100</span>
|
431
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">avatar!</span>(<span class="ruby-identifier">args</span> = {})
|
432
|
+
<span class="ruby-ivar">@gravaty</span> = <span class="ruby-identifier">avatar</span>(<span class="ruby-identifier">args</span>)
|
433
|
+
<span class="ruby-keyword">end</span></pre>
|
434
|
+
</div>
|
435
|
+
|
436
|
+
</div>
|
437
|
+
|
438
|
+
|
439
|
+
|
440
|
+
|
441
|
+
</div>
|
442
|
+
|
443
|
+
|
444
|
+
<div id="method-i-download" class="method-detail ">
|
445
|
+
|
446
|
+
<div class="method-heading">
|
447
|
+
<span class="method-name">download</span><span
|
448
|
+
class="method-args">(filename = nil)</span>
|
449
|
+
|
450
|
+
<span class="method-click-advice">click to toggle source</span>
|
451
|
+
|
452
|
+
</div>
|
453
|
+
|
454
|
+
|
455
|
+
<div class="method-description">
|
456
|
+
|
457
|
+
<p>Saves a file, with specified <code>filename</code>, that contains the
|
458
|
+
current gravaty configuration. Uses the internal state to retrieve data
|
459
|
+
from the URI. Defaults to 'gravaty' with no specific extension.</p>
|
460
|
+
<dl class="rdoc-list note-list"><dt>Usage
|
461
|
+
<dd><ul><li>
|
462
|
+
<p><code>a_string = new_gravaty.download filename</code></p>
|
463
|
+
</li></ul>
|
464
|
+
</dd><dt>Params
|
465
|
+
<dd><ul><li>
|
466
|
+
<p><code>filename</code>: [String] is the filename to be saved.</p>
|
467
|
+
</li></ul>
|
468
|
+
</dd></dl>
|
469
|
+
|
470
|
+
|
471
|
+
|
472
|
+
|
473
|
+
<div class="method-source-code" id="download-source">
|
474
|
+
<pre><span class="ruby-comment"># File lib/gravaty/application.rb, line 144</span>
|
475
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">download</span>(<span class="ruby-identifier">filename</span> = <span class="ruby-keyword">nil</span>)
|
476
|
+
<span class="ruby-identifier">filename</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-ivar">@gravaty</span>).<span class="ruby-identifier">path</span>.<span class="ruby-identifier">rpartition</span>(<span class="ruby-string">'/'</span>).<span class="ruby-identifier">last</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">filename</span>.<span class="ruby-identifier">nil?</span>
|
477
|
+
<span class="ruby-constant">Utils</span><span class="ruby-operator">::</span><span class="ruby-constant">Downloader</span><span class="ruby-operator">::</span><span class="ruby-constant">Downloader</span>.<span class="ruby-identifier">download_file</span> <span class="ruby-ivar">@gravaty</span>, <span class="ruby-identifier">filename</span> <span class="ruby-comment"># thanks Jon!</span>
|
478
|
+
<span class="ruby-keyword">end</span></pre>
|
479
|
+
</div>
|
480
|
+
|
481
|
+
</div>
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
|
486
|
+
</div>
|
487
|
+
|
488
|
+
|
489
|
+
<div id="method-i-json" class="method-detail ">
|
490
|
+
|
491
|
+
<div class="method-heading">
|
492
|
+
<span class="method-name">json</span><span
|
493
|
+
class="method-args">(args = {})</span>
|
494
|
+
|
495
|
+
<span class="method-click-advice">click to toggle source</span>
|
496
|
+
|
497
|
+
</div>
|
498
|
+
|
499
|
+
|
500
|
+
<div class="method-description">
|
501
|
+
|
502
|
+
<p>See <a href="Gravaty.html#method-i-profile">#profile</a> method. Customized
|
503
|
+
version for JSON-specific requests.</p>
|
504
|
+
<dl class="rdoc-list note-list"><dt>Usage
|
505
|
+
<dd><ul><li>
|
506
|
+
<p><code>a_string = new_gravaty.json</code></p>
|
507
|
+
</li><li>
|
508
|
+
<p><code>a_string = new_gravaty.json callback: 'alert'</code></p>
|
509
|
+
</li><li>
|
510
|
+
<p><code>a_string = new_gravaty.qrcode secure: false, callback:
|
511
|
+
'alert'</code></p>
|
512
|
+
</li></ul>
|
513
|
+
</dd><dt>Params
|
514
|
+
<dd><ul><li>
|
515
|
+
<p><code>secure</code>: [TrueClass || FalseClass] is a boolean to specify
|
516
|
+
whether the resulting URL shall be HTTPS or HTTP type. Default to true
|
517
|
+
(HTTPS).</p>
|
518
|
+
</li><li>
|
519
|
+
<p><code>callback</code>: [String] See <a
|
520
|
+
href="https://secure.gravatar.com/site/implement/profiles/json/#request-options">secure.gravatar.com/site/implement/profiles/json/#request-options</a>
|
521
|
+
. No check on parameter meaning or validity, except for <code>nil</code>.</p>
|
522
|
+
</li></ul>
|
523
|
+
</dd><dt>Returns
|
524
|
+
<dd>
|
525
|
+
<p>a <code>String</code> containing the Gravatar site URI with specified
|
526
|
+
options and configuration parameters, in JSON format.</p>
|
527
|
+
</dd></dl>
|
528
|
+
|
529
|
+
|
530
|
+
|
531
|
+
|
532
|
+
<div class="method-source-code" id="json-source">
|
533
|
+
<pre><span class="ruby-comment"># File lib/gravaty/application.rb, line 186</span>
|
534
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">json</span>(<span class="ruby-identifier">args</span> = {})
|
535
|
+
<span class="ruby-identifier">secure</span> = <span class="ruby-keyword">true</span>
|
536
|
+
<span class="ruby-identifier">callback</span> = <span class="ruby-keyword">nil</span>
|
537
|
+
|
538
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">nil?</span>
|
539
|
+
<span class="ruby-identifier">callback</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value">:callback</span>, <span class="ruby-keyword">nil</span>)
|
540
|
+
<span class="ruby-identifier">secure</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value">:secure</span>, <span class="ruby-identifier">secure</span>)
|
541
|
+
<span class="ruby-keyword">end</span>
|
542
|
+
|
543
|
+
<span class="ruby-identifier">profile</span> <span class="ruby-value">format:</span> <span class="ruby-string">'json'</span>, <span class="ruby-value">secure:</span> <span class="ruby-identifier">secure</span>, <span class="ruby-value">callback:</span> <span class="ruby-identifier">callback</span>
|
544
|
+
<span class="ruby-keyword">end</span></pre>
|
545
|
+
</div>
|
546
|
+
|
547
|
+
</div>
|
548
|
+
|
549
|
+
|
550
|
+
|
551
|
+
|
552
|
+
</div>
|
553
|
+
|
554
|
+
|
555
|
+
<div id="method-i-json-21" class="method-detail ">
|
556
|
+
|
557
|
+
<div class="method-heading">
|
558
|
+
<span class="method-name">json!</span><span
|
559
|
+
class="method-args">(args = {})</span>
|
560
|
+
|
561
|
+
<span class="method-click-advice">click to toggle source</span>
|
562
|
+
|
563
|
+
</div>
|
564
|
+
|
565
|
+
|
566
|
+
<div class="method-description">
|
567
|
+
|
568
|
+
<p>See <a href="Gravaty.html#method-i-json">#json</a> method. This banged
|
569
|
+
version saves the resulting string as internal state.</p>
|
570
|
+
|
571
|
+
|
572
|
+
|
573
|
+
|
574
|
+
<div class="method-source-code" id="json-21-source">
|
575
|
+
<pre><span class="ruby-comment"># File lib/gravaty/application.rb, line 199</span>
|
576
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">json!</span>(<span class="ruby-identifier">args</span> = {})
|
577
|
+
<span class="ruby-ivar">@gravaty</span> = <span class="ruby-identifier">json</span>(<span class="ruby-identifier">args</span>)
|
578
|
+
<span class="ruby-keyword">end</span></pre>
|
579
|
+
</div>
|
580
|
+
|
581
|
+
</div>
|
582
|
+
|
583
|
+
|
584
|
+
|
585
|
+
|
586
|
+
</div>
|
587
|
+
|
588
|
+
|
589
|
+
<div id="method-i-profile" class="method-detail ">
|
590
|
+
|
591
|
+
<div class="method-heading">
|
592
|
+
<span class="method-name">profile</span><span
|
593
|
+
class="method-args">(args = {})</span>
|
594
|
+
|
595
|
+
<span class="method-click-advice">click to toggle source</span>
|
596
|
+
|
597
|
+
</div>
|
598
|
+
|
599
|
+
|
600
|
+
<div class="method-description">
|
601
|
+
|
602
|
+
<p>Returns a string containing the URI of the gravatar <a
|
603
|
+
href="Gravaty.html#method-i-profile">#profile</a> associated to internal
|
604
|
+
(provided) <a href="Gravaty.html#attribute-i-email">#email</a> address.
|
605
|
+
Valid keys for the <code>args</code> hash are: :secure, :format.</p>
|
606
|
+
<dl class="rdoc-list note-list"><dt>Usage
|
607
|
+
<dd><ul><li>
|
608
|
+
<p><code>a_string = new_gravaty.profile</code></p>
|
609
|
+
</li><li>
|
610
|
+
<p><code>a_string = new_gravaty.profile secure: false</code></p>
|
611
|
+
</li><li>
|
612
|
+
<p><code>a_string = new_gravaty.profile format: 'php', secure:
|
613
|
+
true</code></p>
|
614
|
+
</li></ul>
|
615
|
+
</dd><dt>Params
|
616
|
+
<dd><ul><li>
|
617
|
+
<p><code>format</code>: [String] is the possibly desired specific <a
|
618
|
+
href="Gravaty.html#method-i-profile">#profile</a> format. Valid formats are
|
619
|
+
'json', 'xml', 'php', 'vcf' and
|
620
|
+
'qr'. Default to no extension. Will be downcased. Defaults to no
|
621
|
+
extension for invalid formats.</p>
|
622
|
+
</li><li>
|
623
|
+
<p><code>secure</code>: [TrueClass || FalseClass] is a boolean to specify
|
624
|
+
whether the resulting URL shall be HTTPS or HTTP type. Default to true
|
625
|
+
(HTTPS).</p>
|
626
|
+
</li></ul>
|
627
|
+
</dd><dt>Returns
|
628
|
+
<dd>
|
629
|
+
<p>a <code>String</code> containing the Gravatar site URI with specified
|
630
|
+
options and configuration parameters.</p>
|
631
|
+
</dd></dl>
|
632
|
+
|
633
|
+
|
634
|
+
|
635
|
+
|
636
|
+
<div class="method-source-code" id="profile-source">
|
637
|
+
<pre><span class="ruby-comment"># File lib/gravaty/application.rb, line 114</span>
|
638
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">profile</span>(<span class="ruby-identifier">args</span> = {})
|
639
|
+
<span class="ruby-identifier">secure</span> = <span class="ruby-keyword">true</span>
|
640
|
+
<span class="ruby-identifier">format</span> = <span class="ruby-keyword">nil</span>
|
641
|
+
|
642
|
+
<span class="ruby-identifier">array</span> = []
|
643
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">nil?</span>
|
644
|
+
<span class="ruby-identifier">format</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">:format</span>].<span class="ruby-identifier">downcase</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">args</span>[<span class="ruby-value">:format</span>].<span class="ruby-identifier">nil?</span>
|
645
|
+
<span class="ruby-identifier">secure</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value">:secure</span>, <span class="ruby-identifier">secure</span>)
|
646
|
+
|
647
|
+
<span class="ruby-keyword">unless</span> (<span class="ruby-identifier">format</span>.<span class="ruby-identifier">nil?</span>) <span class="ruby-keyword">and</span> (<span class="ruby-constant">PROFILES</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">format</span>)
|
648
|
+
<span class="ruby-identifier">selected</span> = (<span class="ruby-identifier">format</span> <span class="ruby-operator">==</span> <span class="ruby-string">'json'</span> <span class="ruby-operator">?</span> <span class="ruby-string">'callback'</span> <span class="ruby-operator">:</span> <span class="ruby-string">'pixelsize'</span>)
|
649
|
+
|
650
|
+
<span class="ruby-identifier">array</span> <span class="ruby-operator"><<</span> <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">selected</span>, <span class="ruby-identifier">args</span>[<span class="ruby-identifier">selected</span>.<span class="ruby-identifier">to_sym</span>]) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">args</span>[<span class="ruby-identifier">selected</span>.<span class="ruby-identifier">to_sym</span>].<span class="ruby-identifier">nil?</span>
|
651
|
+
<span class="ruby-keyword">end</span>
|
652
|
+
<span class="ruby-keyword">end</span>
|
653
|
+
|
654
|
+
<span class="ruby-identifier">build_uri</span>(<span class="ruby-identifier">secure</span>, <span class="ruby-keyword">false</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">digest</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-string">'format'</span>, <span class="ruby-identifier">format</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">build_query_string</span>(<span class="ruby-identifier">array</span>)
|
655
|
+
<span class="ruby-keyword">end</span></pre>
|
656
|
+
</div>
|
657
|
+
|
658
|
+
</div>
|
659
|
+
|
660
|
+
|
661
|
+
|
662
|
+
|
663
|
+
</div>
|
664
|
+
|
665
|
+
|
666
|
+
<div id="method-i-profile-21" class="method-detail ">
|
667
|
+
|
668
|
+
<div class="method-heading">
|
669
|
+
<span class="method-name">profile!</span><span
|
670
|
+
class="method-args">(args = {})</span>
|
671
|
+
|
672
|
+
<span class="method-click-advice">click to toggle source</span>
|
673
|
+
|
674
|
+
</div>
|
675
|
+
|
676
|
+
|
677
|
+
<div class="method-description">
|
678
|
+
|
679
|
+
<p>See <a href="Gravaty.html#method-i-profile">#profile</a> method. This
|
680
|
+
banged version saves the resulting string as internal state.</p>
|
681
|
+
|
682
|
+
|
683
|
+
|
684
|
+
|
685
|
+
<div class="method-source-code" id="profile-21-source">
|
686
|
+
<pre><span class="ruby-comment"># File lib/gravaty/application.rb, line 134</span>
|
687
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">profile!</span>(<span class="ruby-identifier">args</span> = {})
|
688
|
+
<span class="ruby-ivar">@gravaty</span> = <span class="ruby-identifier">profile</span>(<span class="ruby-identifier">args</span>)
|
689
|
+
<span class="ruby-keyword">end</span></pre>
|
690
|
+
</div>
|
691
|
+
|
692
|
+
</div>
|
693
|
+
|
694
|
+
|
695
|
+
|
696
|
+
|
697
|
+
</div>
|
698
|
+
|
699
|
+
|
700
|
+
<div id="method-i-qrcode" class="method-detail ">
|
701
|
+
|
702
|
+
<div class="method-heading">
|
703
|
+
<span class="method-name">qrcode</span><span
|
704
|
+
class="method-args">(args = {})</span>
|
705
|
+
|
706
|
+
<span class="method-click-advice">click to toggle source</span>
|
707
|
+
|
708
|
+
</div>
|
709
|
+
|
710
|
+
|
711
|
+
<div class="method-description">
|
712
|
+
|
713
|
+
<p>See <a href="Gravaty.html#method-i-profile">#profile</a> method. Customized
|
714
|
+
version for QRCode-specific requests.</p>
|
715
|
+
<dl class="rdoc-list note-list"><dt>Usage
|
716
|
+
<dd><ul><li>
|
717
|
+
<p><code>a_string = new_gravaty.qrcode</code></p>
|
718
|
+
</li><li>
|
719
|
+
<p><code>a_string = new_gravaty.qrcode pixel_size: 42</code></p>
|
720
|
+
</li><li>
|
721
|
+
<p><code>a_string = new_gravaty.qrcode secure: false, pixel_size: 42</code></p>
|
722
|
+
</li></ul>
|
723
|
+
</dd><dt>Params
|
724
|
+
<dd><ul><li>
|
725
|
+
<p><code>secure</code>: [TrueClass || FalseClass] is a boolean to specify
|
726
|
+
whether the resulting URL shall be HTTPS or HTTP type. Default to true
|
727
|
+
(HTTPS).</p>
|
728
|
+
</li><li>
|
729
|
+
<p><code>pixel_size</code>: [Integer] is the size in pixel of the image. From
|
730
|
+
1 to 2048. Default to no value. Raises <code>ArgumentError</code> for
|
731
|
+
invalid sizes.</p>
|
732
|
+
</li></ul>
|
733
|
+
</dd><dt>Returns
|
734
|
+
<dd>
|
735
|
+
<p>a <code>String</code> containing the Gravatar site URI with specified
|
736
|
+
options and configuration parameters, in QRCode format.</p>
|
737
|
+
</dd></dl>
|
738
|
+
|
739
|
+
|
740
|
+
|
741
|
+
|
742
|
+
<div class="method-source-code" id="qrcode-source">
|
743
|
+
<pre><span class="ruby-comment"># File lib/gravaty/application.rb, line 159</span>
|
744
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">qrcode</span>(<span class="ruby-identifier">args</span> = {})
|
745
|
+
<span class="ruby-identifier">secure</span> = <span class="ruby-keyword">true</span>
|
746
|
+
<span class="ruby-identifier">size</span> = <span class="ruby-keyword">nil</span>
|
747
|
+
|
748
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">nil?</span>
|
749
|
+
<span class="ruby-identifier">size</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value">:pixelsize</span>, <span class="ruby-keyword">nil</span>)
|
750
|
+
<span class="ruby-identifier">secure</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value">:secure</span>, <span class="ruby-identifier">secure</span>)
|
751
|
+
<span class="ruby-keyword">end</span>
|
752
|
+
|
753
|
+
<span class="ruby-identifier">profile</span> <span class="ruby-value">format:</span> <span class="ruby-string">'qr'</span>, <span class="ruby-value">secure:</span> <span class="ruby-identifier">secure</span>, <span class="ruby-value">pixelsize:</span> <span class="ruby-identifier">size</span>
|
754
|
+
<span class="ruby-keyword">end</span></pre>
|
755
|
+
</div>
|
756
|
+
|
757
|
+
</div>
|
758
|
+
|
759
|
+
|
760
|
+
|
761
|
+
|
762
|
+
</div>
|
763
|
+
|
764
|
+
|
765
|
+
<div id="method-i-qrcode-21" class="method-detail ">
|
766
|
+
|
767
|
+
<div class="method-heading">
|
768
|
+
<span class="method-name">qrcode!</span><span
|
769
|
+
class="method-args">(args = {})</span>
|
770
|
+
|
771
|
+
<span class="method-click-advice">click to toggle source</span>
|
772
|
+
|
773
|
+
</div>
|
774
|
+
|
775
|
+
|
776
|
+
<div class="method-description">
|
777
|
+
|
778
|
+
<p>See <a href="Gravaty.html#method-i-qrcode">#qrcode</a> method. This banged
|
779
|
+
version saves the resulting string as internal state.</p>
|
780
|
+
|
781
|
+
|
782
|
+
|
783
|
+
|
784
|
+
<div class="method-source-code" id="qrcode-21-source">
|
785
|
+
<pre><span class="ruby-comment"># File lib/gravaty/application.rb, line 172</span>
|
786
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">qrcode!</span>(<span class="ruby-identifier">args</span> = {})
|
787
|
+
<span class="ruby-ivar">@gravaty</span> = <span class="ruby-identifier">qrcode</span>(<span class="ruby-identifier">args</span>)
|
788
|
+
<span class="ruby-keyword">end</span></pre>
|
789
|
+
</div>
|
790
|
+
|
791
|
+
</div>
|
792
|
+
|
793
|
+
|
794
|
+
|
795
|
+
|
796
|
+
</div>
|
797
|
+
|
798
|
+
|
799
|
+
<div id="method-i-reset" class="method-detail ">
|
800
|
+
|
801
|
+
<div class="method-heading">
|
802
|
+
<span class="method-name">reset</span><span
|
803
|
+
class="method-args">()</span>
|
804
|
+
|
805
|
+
<span class="method-click-advice">click to toggle source</span>
|
806
|
+
|
807
|
+
</div>
|
808
|
+
|
809
|
+
|
810
|
+
<div class="method-description">
|
811
|
+
|
812
|
+
<p>Restores the original status cleaning up the (possibly) previously saved
|
813
|
+
URIs restoring the default <code>to_s</code>.</p>
|
814
|
+
|
815
|
+
|
816
|
+
|
817
|
+
|
818
|
+
<div class="method-source-code" id="reset-source">
|
819
|
+
<pre><span class="ruby-comment"># File lib/gravaty/application.rb, line 204</span>
|
820
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">reset</span>
|
821
|
+
<span class="ruby-ivar">@gravaty</span> = <span class="ruby-identifier">email</span>
|
822
|
+
<span class="ruby-keyword">end</span></pre>
|
823
|
+
</div>
|
824
|
+
|
825
|
+
</div>
|
826
|
+
|
827
|
+
|
828
|
+
|
829
|
+
|
830
|
+
</div>
|
831
|
+
|
832
|
+
|
833
|
+
<div id="method-i-to_json" class="method-detail ">
|
834
|
+
|
835
|
+
<div class="method-heading">
|
836
|
+
<span class="method-name">to_json</span><span
|
837
|
+
class="method-args">()</span>
|
838
|
+
|
839
|
+
<span class="method-click-advice">click to toggle source</span>
|
840
|
+
|
841
|
+
</div>
|
842
|
+
|
843
|
+
|
844
|
+
<div class="method-description">
|
845
|
+
|
846
|
+
<p>Returns a JSon object representing the <a href="Gravaty.html">Gravaty</a>
|
847
|
+
object.</p>
|
848
|
+
<dl class="rdoc-list note-list"><dt>Usage
|
849
|
+
<dd><ul><li>
|
850
|
+
<p><code>a_json = new_gravaty.to_json</code></p>
|
851
|
+
</li></ul>
|
852
|
+
</dd><dt>Returns
|
853
|
+
<dd>
|
854
|
+
<p>a <code>JSON</code> containing the <a href="Gravaty.html">Gravaty</a>
|
855
|
+
object representation with currently saved options and configuration
|
856
|
+
parameters.</p>
|
857
|
+
</dd></dl>
|
858
|
+
|
859
|
+
|
860
|
+
|
861
|
+
|
862
|
+
<div class="method-source-code" id="to_json-source">
|
863
|
+
<pre><span class="ruby-comment"># File lib/gravaty/application.rb, line 231</span>
|
864
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_json</span>
|
865
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
|
866
|
+
<span class="ruby-identifier">result</span>[<span class="ruby-identifier">email</span>] = <span class="ruby-identifier">digest</span>
|
867
|
+
|
868
|
+
<span class="ruby-identifier">result</span>.<span class="ruby-identifier">to_json</span>
|
869
|
+
<span class="ruby-keyword">end</span></pre>
|
870
|
+
</div>
|
871
|
+
|
872
|
+
</div>
|
873
|
+
|
874
|
+
|
875
|
+
|
876
|
+
|
877
|
+
</div>
|
878
|
+
|
879
|
+
|
880
|
+
<div id="method-i-to_s" class="method-detail ">
|
881
|
+
|
882
|
+
<div class="method-heading">
|
883
|
+
<span class="method-name">to_s</span><span
|
884
|
+
class="method-args">()</span>
|
885
|
+
|
886
|
+
<span class="method-click-advice">click to toggle source</span>
|
887
|
+
|
888
|
+
</div>
|
889
|
+
|
890
|
+
|
891
|
+
<div class="method-description">
|
892
|
+
|
893
|
+
<p>Returns a string representing the <a href="Gravaty.html">Gravaty</a>
|
894
|
+
object.</p>
|
895
|
+
<dl class="rdoc-list note-list"><dt>Usage
|
896
|
+
<dd><ul><li>
|
897
|
+
<p><code>a_string = new_gravaty.to_s</code></p>
|
898
|
+
</li></ul>
|
899
|
+
</dd><dt>Returns
|
900
|
+
<dd>
|
901
|
+
<p>a <code>String</code> containing the <a href="Gravaty.html">Gravaty</a>
|
902
|
+
object representation with currently saved options and configuration
|
903
|
+
parameters.</p>
|
904
|
+
</dd></dl>
|
905
|
+
|
906
|
+
|
907
|
+
|
908
|
+
|
909
|
+
<div class="method-source-code" id="to_s-source">
|
910
|
+
<pre><span class="ruby-comment"># File lib/gravaty/application.rb, line 244</span>
|
911
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_s</span>
|
912
|
+
<span class="ruby-ivar">@gravaty</span>.<span class="ruby-identifier">to_s</span>
|
913
|
+
<span class="ruby-keyword">end</span></pre>
|
914
|
+
</div>
|
915
|
+
|
916
|
+
</div>
|
917
|
+
|
918
|
+
|
919
|
+
|
920
|
+
|
921
|
+
</div>
|
922
|
+
|
923
|
+
|
924
|
+
<div id="method-i-xmlrpc" class="method-detail ">
|
925
|
+
|
926
|
+
<div class="method-heading">
|
927
|
+
<span class="method-name">xmlrpc</span><span
|
928
|
+
class="method-args">(a_method = RPC_TEST_METHOD, password = nil, args = {})</span>
|
929
|
+
|
930
|
+
<span class="method-click-advice">click to toggle source</span>
|
931
|
+
|
932
|
+
</div>
|
933
|
+
|
934
|
+
|
935
|
+
<div class="method-description">
|
936
|
+
|
937
|
+
<p>Interfaces with the Gravatar XML-RPC API.</p>
|
938
|
+
<dl class="rdoc-list note-list"><dt>Usage
|
939
|
+
<dd><ul><li>
|
940
|
+
<p><code>response = new_gravaty.xmlrpc 'grav.test', my_password</code></p>
|
941
|
+
</li></ul>
|
942
|
+
</dd><dt>Params
|
943
|
+
<dd><ul><li>
|
944
|
+
<p><code>a_method</code>: [String] is a valid method supported by Gravatar
|
945
|
+
XML-RPC API. See <a
|
946
|
+
href="https://en.gravatar.com/site/implement/xmlrpc">en.gravatar.com/site/implement/xmlrpc</a>/
|
947
|
+
.</p>
|
948
|
+
</li><li>
|
949
|
+
<p><code>password</code>: [String] is a valid password associated to
|
950
|
+
user's <code>email_address</code> specified to build the <a
|
951
|
+
href="Gravaty.html">Gravaty</a> object.</p>
|
952
|
+
</li><li>
|
953
|
+
<p><code>args</code>: See <a
|
954
|
+
href="https://en.gravatar.com/site/implement/xmlrpc">en.gravatar.com/site/implement/xmlrpc</a>/
|
955
|
+
for possible parameters, depending on called method.</p>
|
956
|
+
</li></ul>
|
957
|
+
</dd><dt>Returns
|
958
|
+
<dd>
|
959
|
+
<p>See <a
|
960
|
+
href="https://en.gravatar.com/site/implement/xmlrpc">en.gravatar.com/site/implement/xmlrpc</a>/
|
961
|
+
for possible return values, depending on called method.</p>
|
962
|
+
</dd></dl>
|
963
|
+
|
964
|
+
|
965
|
+
|
966
|
+
|
967
|
+
<div class="method-source-code" id="xmlrpc-source">
|
968
|
+
<pre><span class="ruby-comment"># File lib/gravaty/application.rb, line 217</span>
|
969
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">xmlrpc</span>(<span class="ruby-identifier">a_method</span> = <span class="ruby-constant">RPC_TEST_METHOD</span>, <span class="ruby-identifier">password</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">args</span> = {})
|
970
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">t</span>(<span class="ruby-string">'error.nil'</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">password</span>.<span class="ruby-identifier">nil?</span>
|
971
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">t</span>(<span class="ruby-string">'error.invalid'</span>, <span class="ruby-value">value:</span> <span class="ruby-identifier">a_method</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">RPC_METHODS</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">a_method</span>
|
972
|
+
|
973
|
+
<span class="ruby-ivar">@rpc_connector</span> = <span class="ruby-constant">Utils</span><span class="ruby-operator">::</span><span class="ruby-constant">RpcConnector</span><span class="ruby-operator">::</span><span class="ruby-constant">RpcConnector</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">digest</span>, <span class="ruby-identifier">password</span>) <span class="ruby-keyword">if</span> <span class="ruby-ivar">@rpc_connector</span>.<span class="ruby-identifier">nil?</span>
|
974
|
+
<span class="ruby-ivar">@rpc_connector</span>.<span class="ruby-identifier">call</span> <span class="ruby-identifier">a_method</span>, <span class="ruby-identifier">args</span>
|
975
|
+
<span class="ruby-keyword">end</span></pre>
|
976
|
+
</div>
|
977
|
+
|
978
|
+
</div>
|
979
|
+
|
980
|
+
|
981
|
+
|
982
|
+
|
983
|
+
</div>
|
984
|
+
|
985
|
+
|
986
|
+
</section>
|
987
|
+
|
988
|
+
</section>
|
989
|
+
</main>
|
990
|
+
|
991
|
+
|
992
|
+
<footer id="validator-badges" role="contentinfo">
|
993
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
994
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.0.4.
|
995
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
996
|
+
</footer>
|
997
|
+
|