robohash 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -0,0 +1,20 @@
1
+ #Description
2
+ This gem downloads the user defined number of robohash images from the robohash.org
3
+
4
+ #Installation
5
+ `gem install robohash`
6
+
7
+ OR in your gemfile
8
+
9
+ `gem robohash`
10
+
11
+ #Use
12
+ 1. Download Images
13
+ `Robohash.get_images`
14
+
15
+ 2.Change default number of images to be downloaded
16
+ ` Robohash.default_num=150`
17
+
18
+ 3.Change default directory to download images
19
+ ` Robohash.default_directory="images/robots"`
20
+
@@ -0,0 +1,90 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+
5
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
+ <head>
7
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
8
+
9
+ <title>File: Gemfile [RDoc Documentation]</title>
10
+
11
+ <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet" />
12
+
13
+ <script src="./js/jquery.js" type="text/javascript"
14
+ charset="utf-8"></script>
15
+ <script src="./js/thickbox-compressed.js" type="text/javascript"
16
+ charset="utf-8"></script>
17
+ <script src="./js/quicksearch.js" type="text/javascript"
18
+ charset="utf-8"></script>
19
+ <script src="./js/darkfish.js" type="text/javascript"
20
+ charset="utf-8"></script>
21
+ </head>
22
+
23
+ <body class="file">
24
+ <div id="metadata">
25
+ <div id="home-metadata">
26
+ <div id="home-section" class="section">
27
+ <h3 class="section-header">
28
+ <a href="./index.html">Home</a>
29
+ <a href="./index.html#classes">Classes</a>
30
+ <a href="./index.html#methods">Methods</a>
31
+ </h3>
32
+ </div>
33
+ </div>
34
+
35
+ <div id="project-metadata">
36
+
37
+
38
+ <div id="fileindex-section" class="section project-section">
39
+ <h3 class="section-header">Files</h3>
40
+ <ul>
41
+
42
+ <li class="file"><a href="./Gemfile.html">Gemfile</a></li>
43
+
44
+ <li class="file"><a href="./Rakefile.html">Rakefile</a></li>
45
+
46
+ </ul>
47
+ </div>
48
+
49
+
50
+ <div id="classindex-section" class="section project-section">
51
+ <h3 class="section-header">Class Index
52
+ <span class="search-toggle"><img src="./images/find.png"
53
+ height="16" width="16" alt="[+]"
54
+ title="show/hide quicksearch" /></span></h3>
55
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
56
+ <fieldset>
57
+ <legend>Quicksearch</legend>
58
+ <input type="text" name="quicksearch" value=""
59
+ class="quicksearch-field" />
60
+ </fieldset>
61
+ </form>
62
+
63
+ <ul class="link-list">
64
+
65
+ <li><a href="./Robohash.html">Robohash</a></li>
66
+
67
+ </ul>
68
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
69
+ </div>
70
+
71
+
72
+ </div>
73
+ </div>
74
+
75
+ <div id="documentation">
76
+
77
+ <p>source “<a href="http://rubygems.org">rubygems.org</a>”</p>
78
+
79
+ <p># Specify your gem’s dependencies in robohash.gemspec gemspec</p>
80
+
81
+ </div>
82
+
83
+ <div id="validator-badges">
84
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
85
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
86
+ Rdoc Generator</a> 2</small>.</p>
87
+ </div>
88
+ </body>
89
+ </html>
90
+
@@ -0,0 +1,89 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+
5
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
+ <head>
7
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
8
+
9
+ <title>File: Rakefile [RDoc Documentation]</title>
10
+
11
+ <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet" />
12
+
13
+ <script src="./js/jquery.js" type="text/javascript"
14
+ charset="utf-8"></script>
15
+ <script src="./js/thickbox-compressed.js" type="text/javascript"
16
+ charset="utf-8"></script>
17
+ <script src="./js/quicksearch.js" type="text/javascript"
18
+ charset="utf-8"></script>
19
+ <script src="./js/darkfish.js" type="text/javascript"
20
+ charset="utf-8"></script>
21
+ </head>
22
+
23
+ <body class="file">
24
+ <div id="metadata">
25
+ <div id="home-metadata">
26
+ <div id="home-section" class="section">
27
+ <h3 class="section-header">
28
+ <a href="./index.html">Home</a>
29
+ <a href="./index.html#classes">Classes</a>
30
+ <a href="./index.html#methods">Methods</a>
31
+ </h3>
32
+ </div>
33
+ </div>
34
+
35
+ <div id="project-metadata">
36
+
37
+
38
+ <div id="fileindex-section" class="section project-section">
39
+ <h3 class="section-header">Files</h3>
40
+ <ul>
41
+
42
+ <li class="file"><a href="./Gemfile.html">Gemfile</a></li>
43
+
44
+ <li class="file"><a href="./Rakefile.html">Rakefile</a></li>
45
+
46
+ </ul>
47
+ </div>
48
+
49
+
50
+ <div id="classindex-section" class="section project-section">
51
+ <h3 class="section-header">Class Index
52
+ <span class="search-toggle"><img src="./images/find.png"
53
+ height="16" width="16" alt="[+]"
54
+ title="show/hide quicksearch" /></span></h3>
55
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
56
+ <fieldset>
57
+ <legend>Quicksearch</legend>
58
+ <input type="text" name="quicksearch" value=""
59
+ class="quicksearch-field" />
60
+ </fieldset>
61
+ </form>
62
+
63
+ <ul class="link-list">
64
+
65
+ <li><a href="./Robohash.html">Robohash</a></li>
66
+
67
+ </ul>
68
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
69
+ </div>
70
+
71
+
72
+ </div>
73
+ </div>
74
+
75
+ <div id="documentation">
76
+
77
+ <p>require ‘bundler/gem_tasks’ require ‘rspec/core/rake_task’
78
+ RSpec::Core::RakeTask.new(‘spec’)</p>
79
+
80
+ </div>
81
+
82
+ <div id="validator-badges">
83
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
84
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
85
+ Rdoc Generator</a> 2</small>.</p>
86
+ </div>
87
+ </body>
88
+ </html>
89
+
@@ -0,0 +1,381 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
7
+
8
+ <title>Module: Robohash</title>
9
+
10
+ <link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
11
+
12
+ <script src="./js/jquery.js" type="text/javascript" charset="utf-8"></script>
13
+ <script src="./js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
14
+ <script src="./js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
15
+ <script src="./js/darkfish.js" type="text/javascript" charset="utf-8"></script>
16
+
17
+ </head>
18
+ <body id="top" class="module">
19
+
20
+ <div id="metadata">
21
+ <div id="home-metadata">
22
+ <div id="home-section" class="section">
23
+ <h3 class="section-header">
24
+ <a href="./index.html">Home</a>
25
+ <a href="./index.html#classes">Classes</a>
26
+ <a href="./index.html#methods">Methods</a>
27
+ </h3>
28
+ </div>
29
+ </div>
30
+
31
+ <div id="file-metadata">
32
+ <div id="file-list-section" class="section">
33
+ <h3 class="section-header">In Files</h3>
34
+ <div class="section-body">
35
+ <ul>
36
+
37
+ <li><a href="./lib/robohash/version_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
38
+ class="thickbox" title="lib/robohash/version.rb">lib/robohash/version.rb</a></li>
39
+
40
+ <li><a href="./lib/robohash_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
41
+ class="thickbox" title="lib/robohash.rb">lib/robohash.rb</a></li>
42
+
43
+ </ul>
44
+ </div>
45
+ </div>
46
+
47
+
48
+ </div>
49
+
50
+ <div id="class-metadata">
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+ <!-- Method Quickref -->
59
+ <div id="method-list-section" class="section">
60
+ <h3 class="section-header">Methods</h3>
61
+ <ul class="link-list">
62
+
63
+ <li><a href="#method-c-get_images">::get_images</a></li>
64
+
65
+ <li><a href="#method-i-Version">#Version</a></li>
66
+
67
+ <li><a href="#method-i-default_directory">#default_directory</a></li>
68
+
69
+ <li><a href="#method-i-default_directory-3D">#default_directory=</a></li>
70
+
71
+ <li><a href="#method-i-default_num">#default_num</a></li>
72
+
73
+ <li><a href="#method-i-default_num-3D">#default_num=</a></li>
74
+
75
+ </ul>
76
+ </div>
77
+
78
+
79
+
80
+ </div>
81
+
82
+ <div id="project-metadata">
83
+
84
+
85
+ <div id="fileindex-section" class="section project-section">
86
+ <h3 class="section-header">Files</h3>
87
+ <ul>
88
+
89
+ <li class="file"><a href="./Gemfile.html">Gemfile</a></li>
90
+
91
+ <li class="file"><a href="./Rakefile.html">Rakefile</a></li>
92
+
93
+ </ul>
94
+ </div>
95
+
96
+
97
+ <div id="classindex-section" class="section project-section">
98
+ <h3 class="section-header">Class/Module Index
99
+ <span class="search-toggle"><img src="./images/find.png"
100
+ height="16" width="16" alt="[+]"
101
+ title="show/hide quicksearch" /></span></h3>
102
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
103
+ <fieldset>
104
+ <legend>Quicksearch</legend>
105
+ <input type="text" name="quicksearch" value=""
106
+ class="quicksearch-field" />
107
+ </fieldset>
108
+ </form>
109
+
110
+ <ul class="link-list">
111
+
112
+ <li><a href="./Robohash.html">Robohash</a></li>
113
+
114
+ </ul>
115
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
116
+ </div>
117
+
118
+
119
+ </div>
120
+ </div>
121
+
122
+ <div id="documentation">
123
+ <h1 class="module">Robohash</h1>
124
+
125
+ <div id="description" class="description">
126
+
127
+ </div><!-- description -->
128
+
129
+
130
+
131
+
132
+ <div id="5Buntitled-5D" class="documentation-section">
133
+
134
+
135
+
136
+
137
+
138
+ <!-- Constants -->
139
+ <div id="constants-list" class="section">
140
+ <h3 class="section-header">Constants</h3>
141
+ <dl>
142
+
143
+ <dt><a name="VERSION">VERSION</a></dt>
144
+
145
+ <dd class="description"></dd>
146
+
147
+
148
+ </dl>
149
+ </div>
150
+
151
+
152
+
153
+
154
+ <!-- Methods -->
155
+
156
+ <div id="public-class-method-details" class="method-section section">
157
+ <h3 class="section-header">Public Class Methods</h3>
158
+
159
+
160
+ <div id="get_images-method" class="method-detail ">
161
+ <a name="method-c-get_images"></a>
162
+
163
+
164
+ <div class="method-heading">
165
+ <span class="method-name">get_images</span><span
166
+ class="method-args">()</span>
167
+ <span class="method-click-advice">click to toggle source</span>
168
+ </div>
169
+
170
+
171
+ <div class="method-description">
172
+
173
+
174
+
175
+
176
+
177
+ <div class="method-source-code" id="get_images-source">
178
+ <pre>
179
+ <span class="ruby-comment"># File lib/robohash.rb, line 15</span>
180
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">get_images</span>
181
+ <span class="ruby-keyword">if</span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">exists?</span> <span class="ruby-ivar">@default_directory</span>
182
+ <span class="ruby-keyword">self</span>.<span class="ruby-constant">Delete_directory</span>
183
+ <span class="ruby-keyword">else</span>
184
+ <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">mkdir</span>(<span class="ruby-ivar">@default_directory</span>)
185
+ <span class="ruby-keyword">end</span>
186
+ (<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-identifier">default_num</span>).<span class="ruby-identifier">each</span>{
187
+ <span class="ruby-identifier">o</span> = [(<span class="ruby-string">'a'</span><span class="ruby-operator">..</span><span class="ruby-string">'z'</span>),(<span class="ruby-string">'A'</span><span class="ruby-operator">..</span><span class="ruby-string">'Z'</span>)].<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">i</span>.<span class="ruby-identifier">to_a</span>}.<span class="ruby-identifier">flatten</span>;
188
+ <span class="ruby-identifier">string</span> = (<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">10</span>).<span class="ruby-identifier">map</span>{ <span class="ruby-identifier">o</span>[<span class="ruby-identifier">rand</span>(<span class="ruby-identifier">o</span>.<span class="ruby-identifier">length</span>)] }.<span class="ruby-identifier">join</span>;
189
+ <span class="ruby-identifier">image</span> = <span class="ruby-constant">HTTParty</span>.<span class="ruby-identifier">get</span> <span class="ruby-node">&quot;http://robohash.org/#{string}.png&quot;</span>
190
+ <span class="ruby-identifier">open</span>( <span class="ruby-node">&quot;#{@default_directory}/#{string}.png&quot;</span>, <span class="ruby-string">'wb'</span> ) { <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
191
+ <span class="ruby-identifier">file</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">image</span>.<span class="ruby-identifier">body</span>)
192
+ }
193
+ }
194
+ <span class="ruby-keyword">end</span></pre>
195
+ </div><!-- get_images-source -->
196
+
197
+ </div>
198
+
199
+
200
+
201
+
202
+ </div><!-- get_images-method -->
203
+
204
+
205
+ </div><!-- public-class-method-details -->
206
+
207
+ <div id="public-instance-method-details" class="method-section section">
208
+ <h3 class="section-header">Public Instance Methods</h3>
209
+
210
+
211
+ <div id="Version-method" class="method-detail ">
212
+ <a name="method-i-Version"></a>
213
+
214
+
215
+ <div class="method-heading">
216
+ <span class="method-name">Version</span><span
217
+ class="method-args">()</span>
218
+ <span class="method-click-advice">click to toggle source</span>
219
+ </div>
220
+
221
+
222
+ <div class="method-description">
223
+
224
+
225
+
226
+
227
+
228
+ <div class="method-source-code" id="Version-source">
229
+ <pre>
230
+ <span class="ruby-comment"># File lib/robohash.rb, line 13</span>
231
+ <span class="ruby-keyword">def</span> <span class="ruby-constant">Version</span>; <span class="ruby-keyword">self</span><span class="ruby-operator">::</span><span class="ruby-constant">VERSION</span> <span class="ruby-keyword">end</span></pre>
232
+ </div><!-- Version-source -->
233
+
234
+ </div>
235
+
236
+
237
+
238
+
239
+ </div><!-- Version-method -->
240
+
241
+
242
+ <div id="default_directory-method" class="method-detail ">
243
+ <a name="method-i-default_directory"></a>
244
+
245
+
246
+ <div class="method-heading">
247
+ <span class="method-name">default_directory</span><span
248
+ class="method-args">()</span>
249
+ <span class="method-click-advice">click to toggle source</span>
250
+ </div>
251
+
252
+
253
+ <div class="method-description">
254
+
255
+
256
+
257
+
258
+
259
+ <div class="method-source-code" id="default_directory-source">
260
+ <pre>
261
+ <span class="ruby-comment"># File lib/robohash.rb, line 11</span>
262
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">default_directory</span>; <span class="ruby-ivar">@default_directory</span> <span class="ruby-keyword">end</span></pre>
263
+ </div><!-- default_directory-source -->
264
+
265
+ </div>
266
+
267
+
268
+
269
+
270
+ </div><!-- default_directory-method -->
271
+
272
+
273
+ <div id="default_directory-3D-method" class="method-detail ">
274
+ <a name="method-i-default_directory-3D"></a>
275
+
276
+
277
+ <div class="method-heading">
278
+ <span class="method-name">default_directory=</span><span
279
+ class="method-args">(v;)</span>
280
+ <span class="method-click-advice">click to toggle source</span>
281
+ </div>
282
+
283
+
284
+ <div class="method-description">
285
+
286
+
287
+
288
+
289
+
290
+ <div class="method-source-code" id="default_directory-3D-source">
291
+ <pre>
292
+ <span class="ruby-comment"># File lib/robohash.rb, line 12</span>
293
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">default_directory=</span> <span class="ruby-identifier">v</span>; <span class="ruby-ivar">@default_directory</span> = <span class="ruby-identifier">v</span> <span class="ruby-keyword">end</span></pre>
294
+ </div><!-- default_directory-3D-source -->
295
+
296
+ </div>
297
+
298
+
299
+
300
+
301
+ </div><!-- default_directory-3D-method -->
302
+
303
+
304
+ <div id="default_num-method" class="method-detail ">
305
+ <a name="method-i-default_num"></a>
306
+
307
+
308
+ <div class="method-heading">
309
+ <span class="method-name">default_num</span><span
310
+ class="method-args">()</span>
311
+ <span class="method-click-advice">click to toggle source</span>
312
+ </div>
313
+
314
+
315
+ <div class="method-description">
316
+
317
+
318
+
319
+
320
+
321
+ <div class="method-source-code" id="default_num-source">
322
+ <pre>
323
+ <span class="ruby-comment"># File lib/robohash.rb, line 9</span>
324
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">default_num</span>; <span class="ruby-ivar">@default_num</span> <span class="ruby-keyword">end</span></pre>
325
+ </div><!-- default_num-source -->
326
+
327
+ </div>
328
+
329
+
330
+
331
+
332
+ </div><!-- default_num-method -->
333
+
334
+
335
+ <div id="default_num-3D-method" class="method-detail ">
336
+ <a name="method-i-default_num-3D"></a>
337
+
338
+
339
+ <div class="method-heading">
340
+ <span class="method-name">default_num=</span><span
341
+ class="method-args">(v;)</span>
342
+ <span class="method-click-advice">click to toggle source</span>
343
+ </div>
344
+
345
+
346
+ <div class="method-description">
347
+
348
+
349
+
350
+
351
+
352
+ <div class="method-source-code" id="default_num-3D-source">
353
+ <pre>
354
+ <span class="ruby-comment"># File lib/robohash.rb, line 10</span>
355
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">default_num=</span> <span class="ruby-identifier">v</span>; <span class="ruby-ivar">@default_num</span> = <span class="ruby-identifier">v</span> <span class="ruby-keyword">end</span></pre>
356
+ </div><!-- default_num-3D-source -->
357
+
358
+ </div>
359
+
360
+
361
+
362
+
363
+ </div><!-- default_num-3D-method -->
364
+
365
+
366
+ </div><!-- public-instance-method-details -->
367
+
368
+ </div><!-- 5Buntitled-5D -->
369
+
370
+
371
+ </div><!-- documentation -->
372
+
373
+ <div id="validator-badges">
374
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
375
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
376
+ Rdoc Generator</a> 2</small>.</p>
377
+ </div>
378
+
379
+ </body>
380
+ </html>
381
+