benschwarz-smoke 0.4.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +47 -0
- data/VERSION.yml +2 -2
- data/lib/core_ext/string.rb +6 -0
- data/lib/smoke/cache.rb +38 -23
- data/lib/smoke/request.rb +4 -8
- data/lib/smoke.rb +7 -2
- data/rdoc/classes/Smoke/Origin.html +340 -0
- data/rdoc/classes/Smoke/Source/Data.html +126 -0
- data/rdoc/classes/Smoke/Source/Feed.html +117 -0
- data/rdoc/classes/Smoke/Source/YQL.html +223 -0
- data/rdoc/classes/Smoke.html +260 -0
- data/rdoc/created.rid +1 -0
- data/rdoc/files/README_markdown.html +180 -0
- data/rdoc/files/lib/core_ext/hash_rb.html +49 -0
- data/rdoc/files/lib/smoke/origin_rb.html +49 -0
- data/rdoc/files/lib/smoke/request_rb.html +49 -0
- data/rdoc/files/lib/smoke/source/data_rb.html +49 -0
- data/rdoc/files/lib/smoke/source/feed_rb.html +49 -0
- data/rdoc/files/lib/smoke/source/join_rb.html +49 -0
- data/rdoc/files/lib/smoke/source/yql_rb.html +49 -0
- data/rdoc/files/lib/smoke_rb.html +65 -0
- data/rdoc/fr_class_index.html +21 -0
- data/rdoc/fr_file_index.html +28 -0
- data/rdoc/fr_method_index.html +4459 -0
- data/rdoc/index.html +15 -0
- data/rdoc/rdoc-style.css +319 -0
- data/spec/smoke/cache_spec.rb +28 -6
- data/vendor/crack/History +15 -0
- data/vendor/crack/LICENSE +20 -0
- data/vendor/crack/README.rdoc +42 -0
- data/vendor/crack/Rakefile +49 -0
- data/vendor/crack/VERSION.yml +4 -0
- data/vendor/crack/crack.gemspec +61 -0
- data/vendor/crack/lib/crack/core_extensions.rb +128 -0
- data/vendor/crack/lib/crack/json.rb +68 -0
- data/vendor/crack/lib/crack/xml.rb +214 -0
- data/vendor/crack/lib/crack.rb +7 -0
- data/vendor/crack/test/crack_test.rb +4 -0
- data/vendor/crack/test/data/twittersearch-firefox.json +1 -0
- data/vendor/crack/test/data/twittersearch-ie.json +1 -0
- data/vendor/crack/test/hash_test.rb +56 -0
- data/vendor/crack/test/json_test.rb +66 -0
- data/vendor/crack/test/string_test.rb +31 -0
- data/vendor/crack/test/test_helper.rb +12 -0
- data/vendor/crack/test/xml_test.rb +489 -0
- data/vendor/dependencies/README.markdown +113 -0
- data/vendor/dependencies/Rakefile +5 -0
- data/vendor/dependencies/bin/dep +83 -0
- data/vendor/dependencies/dependencies.gemspec +15 -0
- data/vendor/dependencies/dependencies.gemspec.erb +27 -0
- data/vendor/dependencies/lib/dependencies/dep.rb +99 -0
- data/vendor/dependencies/lib/dependencies.rb +5 -0
- data/vendor/dependencies/test/dependencies_test.rb +228 -0
- data/vendor/dependencies/test/foobaz-0.3.gem +0 -0
- data/vendor/fakeweb/CHANGELOG +163 -0
- data/vendor/fakeweb/LICENSE.txt +281 -0
- data/vendor/fakeweb/README.rdoc +193 -0
- data/vendor/fakeweb/Rakefile +76 -0
- data/vendor/fakeweb/fakeweb.gemspec +21 -0
- data/vendor/fakeweb/lib/fake_web/ext/net_http.rb +71 -0
- data/vendor/fakeweb/lib/fake_web/registry.rb +103 -0
- data/vendor/fakeweb/lib/fake_web/responder.rb +113 -0
- data/vendor/fakeweb/lib/fake_web/response.rb +10 -0
- data/vendor/fakeweb/lib/fake_web/stub_socket.rb +15 -0
- data/vendor/fakeweb/lib/fake_web/utility.rb +22 -0
- data/vendor/fakeweb/lib/fake_web.rb +172 -0
- data/vendor/fakeweb/lib/fakeweb.rb +2 -0
- data/vendor/fakeweb/test/fixtures/google_response_from_curl +12 -0
- data/vendor/fakeweb/test/fixtures/google_response_with_transfer_encoding +17 -0
- data/vendor/fakeweb/test/fixtures/google_response_without_transfer_encoding +11 -0
- data/vendor/fakeweb/test/fixtures/test_example.txt +1 -0
- data/vendor/fakeweb/test/fixtures/test_txt_file +3 -0
- data/vendor/fakeweb/test/test_allow_net_connect.rb +85 -0
- data/vendor/fakeweb/test/test_deprecations.rb +54 -0
- data/vendor/fakeweb/test/test_fake_authentication.rb +92 -0
- data/vendor/fakeweb/test/test_fake_web.rb +535 -0
- data/vendor/fakeweb/test/test_fake_web_open_uri.rb +58 -0
- data/vendor/fakeweb/test/test_helper.rb +74 -0
- data/vendor/fakeweb/test/test_missing_open_uri.rb +25 -0
- data/vendor/fakeweb/test/test_precedence.rb +51 -0
- data/vendor/fakeweb/test/test_query_string.rb +45 -0
- data/vendor/fakeweb/test/test_regexes.rb +103 -0
- data/vendor/fakeweb/test/test_response_headers.rb +73 -0
- data/vendor/fakeweb/test/test_trailing_slashes.rb +53 -0
- data/vendor/fakeweb/test/test_utility.rb +70 -0
- data/vendor/json-1.1.3/CHANGES +93 -0
- data/vendor/json-1.1.3/GPL +340 -0
- data/vendor/json-1.1.3/README +78 -0
- data/vendor/json-1.1.3/RUBY +58 -0
- data/vendor/json-1.1.3/Rakefile +309 -0
- data/vendor/json-1.1.3/TODO +1 -0
- data/vendor/json-1.1.3/VERSION +1 -0
- data/vendor/json-1.1.3/benchmarks/benchmark.txt +133 -0
- data/vendor/json-1.1.3/benchmarks/benchmark_generator.rb +48 -0
- data/vendor/json-1.1.3/benchmarks/benchmark_parser.rb +26 -0
- data/vendor/json-1.1.3/benchmarks/benchmark_rails.rb +26 -0
- data/vendor/json-1.1.3/bin/edit_json.rb +10 -0
- data/vendor/json-1.1.3/bin/prettify_json.rb +76 -0
- data/vendor/json-1.1.3/data/example.json +1 -0
- data/vendor/json-1.1.3/data/index.html +38 -0
- data/vendor/json-1.1.3/data/prototype.js +4184 -0
- data/vendor/json-1.1.3/ext/json/ext/generator/extconf.rb +9 -0
- data/vendor/json-1.1.3/ext/json/ext/generator/generator.c +875 -0
- data/vendor/json-1.1.3/ext/json/ext/generator/unicode.c +182 -0
- data/vendor/json-1.1.3/ext/json/ext/generator/unicode.h +53 -0
- data/vendor/json-1.1.3/ext/json/ext/parser/extconf.rb +9 -0
- data/vendor/json-1.1.3/ext/json/ext/parser/parser.c +1758 -0
- data/vendor/json-1.1.3/ext/json/ext/parser/parser.rl +638 -0
- data/vendor/json-1.1.3/ext/json/ext/parser/unicode.c +154 -0
- data/vendor/json-1.1.3/ext/json/ext/parser/unicode.h +58 -0
- data/vendor/json-1.1.3/install.rb +26 -0
- data/vendor/json-1.1.3/lib/json/Array.xpm +21 -0
- data/vendor/json-1.1.3/lib/json/FalseClass.xpm +21 -0
- data/vendor/json-1.1.3/lib/json/Hash.xpm +21 -0
- data/vendor/json-1.1.3/lib/json/Key.xpm +73 -0
- data/vendor/json-1.1.3/lib/json/NilClass.xpm +21 -0
- data/vendor/json-1.1.3/lib/json/Numeric.xpm +28 -0
- data/vendor/json-1.1.3/lib/json/String.xpm +96 -0
- data/vendor/json-1.1.3/lib/json/TrueClass.xpm +21 -0
- data/vendor/json-1.1.3/lib/json/add/core.rb +135 -0
- data/vendor/json-1.1.3/lib/json/add/rails.rb +58 -0
- data/vendor/json-1.1.3/lib/json/common.rb +354 -0
- data/vendor/json-1.1.3/lib/json/editor.rb +1362 -0
- data/vendor/json-1.1.3/lib/json/ext.rb +13 -0
- data/vendor/json-1.1.3/lib/json/json.xpm +1499 -0
- data/vendor/json-1.1.3/lib/json/pure/generator.rb +394 -0
- data/vendor/json-1.1.3/lib/json/pure/parser.rb +259 -0
- data/vendor/json-1.1.3/lib/json/pure.rb +75 -0
- data/vendor/json-1.1.3/lib/json/version.rb +9 -0
- data/vendor/json-1.1.3/lib/json.rb +235 -0
- data/vendor/json-1.1.3/tests/fixtures/fail1.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail10.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail11.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail12.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail13.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail14.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail18.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail19.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail2.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail20.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail21.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail22.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail23.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail24.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail25.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail27.json +2 -0
- data/vendor/json-1.1.3/tests/fixtures/fail28.json +2 -0
- data/vendor/json-1.1.3/tests/fixtures/fail3.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail4.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail5.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail6.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail7.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail8.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/fail9.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/pass1.json +56 -0
- data/vendor/json-1.1.3/tests/fixtures/pass15.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/pass16.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/pass17.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/pass2.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/pass26.json +1 -0
- data/vendor/json-1.1.3/tests/fixtures/pass3.json +6 -0
- data/vendor/json-1.1.3/tests/runner.rb +25 -0
- data/vendor/json-1.1.3/tests/test_json.rb +293 -0
- data/vendor/json-1.1.3/tests/test_json_addition.rb +161 -0
- data/vendor/json-1.1.3/tests/test_json_fixtures.rb +30 -0
- data/vendor/json-1.1.3/tests/test_json_generate.rb +100 -0
- data/vendor/json-1.1.3/tests/test_json_rails.rb +118 -0
- data/vendor/json-1.1.3/tests/test_json_unicode.rb +61 -0
- data/vendor/json-1.1.3/tools/fuzz.rb +140 -0
- data/vendor/json-1.1.3/tools/server.rb +62 -0
- data/vendor/moneta/LICENSE +20 -0
- data/vendor/moneta/README +51 -0
- data/vendor/moneta/Rakefile +60 -0
- data/vendor/moneta/TODO +4 -0
- data/vendor/moneta/benchmarks/various.rb +234 -0
- data/vendor/moneta/lib/moneta/basic_file.rb +111 -0
- data/vendor/moneta/lib/moneta/berkeley.rb +53 -0
- data/vendor/moneta/lib/moneta/couch.rb +63 -0
- data/vendor/moneta/lib/moneta/datamapper.rb +117 -0
- data/vendor/moneta/lib/moneta/file.rb +91 -0
- data/vendor/moneta/lib/moneta/lmc.rb +52 -0
- data/vendor/moneta/lib/moneta/memcache.rb +53 -0
- data/vendor/moneta/lib/moneta/memory.rb +11 -0
- data/vendor/moneta/lib/moneta/mongodb.rb +58 -0
- data/vendor/moneta/lib/moneta/redis.rb +49 -0
- data/vendor/moneta/lib/moneta/rufus.rb +41 -0
- data/vendor/moneta/lib/moneta/s3.rb +162 -0
- data/vendor/moneta/lib/moneta/sdbm.rb +33 -0
- data/vendor/moneta/lib/moneta/tyrant.rb +58 -0
- data/vendor/moneta/lib/moneta/xattr.rb +58 -0
- data/vendor/moneta/lib/moneta.rb +76 -0
- data/vendor/moneta/moneta.gemspec +32 -0
- data/vendor/moneta/script/destroy +14 -0
- data/vendor/moneta/script/generate +14 -0
- data/vendor/moneta/spec/moneta_basic_file_spec.rb +50 -0
- data/vendor/moneta/spec/moneta_berkeley_spec.rb +20 -0
- data/vendor/moneta/spec/moneta_couch_spec.rb +22 -0
- data/vendor/moneta/spec/moneta_datamapper_spec.rb +79 -0
- data/vendor/moneta/spec/moneta_file_spec.rb +21 -0
- data/vendor/moneta/spec/moneta_lmc_spec.rb +24 -0
- data/vendor/moneta/spec/moneta_memcache_spec.rb +16 -0
- data/vendor/moneta/spec/moneta_memory_spec.rb +12 -0
- data/vendor/moneta/spec/moneta_mongodb_spec.rb +16 -0
- data/vendor/moneta/spec/moneta_redis_spec.rb +16 -0
- data/vendor/moneta/spec/moneta_rufus_spec.rb +15 -0
- data/vendor/moneta/spec/moneta_s3_spec.rb +19 -0
- data/vendor/moneta/spec/moneta_sdbm_spec.rb +21 -0
- data/vendor/moneta/spec/moneta_tyrant_spec.rb +15 -0
- data/vendor/moneta/spec/moneta_xattr_spec.rb +21 -0
- data/vendor/moneta/spec/shared.rb +122 -0
- data/vendor/moneta/spec/spec_helper.rb +7 -0
- data/vendor/rest-client/README.rdoc +151 -0
- data/vendor/rest-client/Rakefile +58 -0
- data/vendor/rest-client/VERSION +1 -0
- data/vendor/rest-client/bin/restclient +87 -0
- data/vendor/rest-client/lib/rest_client.rb +2 -0
- data/vendor/rest-client/lib/restclient/exceptions.rb +88 -0
- data/vendor/rest-client/lib/restclient/mixin/response.rb +43 -0
- data/vendor/rest-client/lib/restclient/raw_response.rb +30 -0
- data/vendor/rest-client/lib/restclient/request.rb +238 -0
- data/vendor/rest-client/lib/restclient/resource.rb +146 -0
- data/vendor/rest-client/lib/restclient/response.rb +20 -0
- data/vendor/rest-client/lib/restclient.rb +99 -0
- data/vendor/rest-client/rest-client.gemspec +66 -0
- data/vendor/rest-client/spec/base.rb +4 -0
- data/vendor/rest-client/spec/exceptions_spec.rb +65 -0
- data/vendor/rest-client/spec/mixin/response_spec.rb +46 -0
- data/vendor/rest-client/spec/raw_response_spec.rb +17 -0
- data/vendor/rest-client/spec/request_spec.rb +476 -0
- data/vendor/rest-client/spec/resource_spec.rb +75 -0
- data/vendor/rest-client/spec/response_spec.rb +16 -0
- data/vendor/rest-client/spec/restclient_spec.rb +53 -0
- data/vendor/simple-rss/LICENSE +429 -0
- data/vendor/simple-rss/README +43 -0
- data/vendor/simple-rss/Rakefile +212 -0
- data/vendor/simple-rss/install.rb +40 -0
- data/vendor/simple-rss/lib/simple-rss.rb +150 -0
- data/vendor/simple-rss/simple-rss.gemspec +12 -0
- data/vendor/simple-rss/test/base/base_test.rb +51 -0
- data/vendor/simple-rss/test/data/atom.xml +45 -0
- data/vendor/simple-rss/test/data/not-rss.xml +8 -0
- data/vendor/simple-rss/test/data/rss09.rdf +79 -0
- data/vendor/simple-rss/test/data/rss20.xml +818 -0
- data/vendor/simple-rss/test/test_helper.rb +4 -0
- metadata +314 -40
@@ -0,0 +1,126 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2
|
+
<html lang='en'>
|
3
|
+
<head>
|
4
|
+
<title>: Smoke::Source::Data [smoke]</title>
|
5
|
+
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
|
6
|
+
<link href='../../../rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
|
7
|
+
<script type='text/javascript'>
|
8
|
+
//<![CDATA[
|
9
|
+
function popupCode(url) {
|
10
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
11
|
+
}
|
12
|
+
|
13
|
+
function toggleCode(id) {
|
14
|
+
var code = document.getElementById(id)
|
15
|
+
|
16
|
+
code.style.display = code.style.display != 'block' ? 'block' : 'none'
|
17
|
+
return true
|
18
|
+
}
|
19
|
+
|
20
|
+
// Make codeblocks hidden by default
|
21
|
+
document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
|
22
|
+
//]]>
|
23
|
+
</script>
|
24
|
+
</head>
|
25
|
+
<body class='page'>
|
26
|
+
<div class='class' id='wrapper'>
|
27
|
+
<div class='header'>
|
28
|
+
<h1 class='name'>
|
29
|
+
<span class='type'>Class</span>
|
30
|
+
Smoke::Source::Data
|
31
|
+
</h1>
|
32
|
+
<ol class='paths'>
|
33
|
+
<li>
|
34
|
+
<a href="../../../files/lib/smoke/source/data_rb.html">lib/smoke/source/data.rb</a>
|
35
|
+
</li>
|
36
|
+
</ol>
|
37
|
+
<div class='parent'>
|
38
|
+
Parent:
|
39
|
+
<strong><a href="../Origin.html">Smoke::Origin</a></strong>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
<div id='content'>
|
43
|
+
<div id='text'>
|
44
|
+
<div id='description'>
|
45
|
+
<p>
|
46
|
+
The “Data” source allows you to query datasources that are
|
47
|
+
“complete” urls and rely on the automagic object parsing that
|
48
|
+
smoke provides.
|
49
|
+
</p>
|
50
|
+
<p>
|
51
|
+
For example, you may use this source to query a complete restful api call
|
52
|
+
unpackage the xml response and get a clean ruby object.
|
53
|
+
</p>
|
54
|
+
<p>
|
55
|
+
<a href="Data.html">Data</a> can take as many urls as you’d like to
|
56
|
+
throw at it.
|
57
|
+
</p>
|
58
|
+
<p>
|
59
|
+
Usage:
|
60
|
+
</p>
|
61
|
+
<pre>Smoke.data(:ruby) do
 url "http://api.flickr.com/services/rest/?user_id=36821533%40N00&tags=benschwarz-site&nojsoncallback=1&method=flickr.photos.search&format=json&api_key=your_api_key_here
 path :photos, :photo
end</pre>
|
62
|
+
</div>
|
63
|
+
<div id='method-list'>
|
64
|
+
<h2>Methods</h2>
|
65
|
+
<h3>public instance</h3>
|
66
|
+
<ol>
|
67
|
+
<li><a href="#M000012">url</a></li>
|
68
|
+
</ol>
|
69
|
+
<h3>protected instance</h3>
|
70
|
+
<ol>
|
71
|
+
<li><a href="#M000013">dispatch</a></li>
|
72
|
+
</ol>
|
73
|
+
</div>
|
74
|
+
<div id='section'>
|
75
|
+
<div id='attribute-list'>
|
76
|
+
<h2 class='section-bar'>Attributes</h2>
|
77
|
+
<div class='name-list'>
|
78
|
+
<table>
|
79
|
+
<tr class='top-aligned-row context-row'>
|
80
|
+
<td class='context-item-name'>request</td>
|
81
|
+
<td class='context-item-value'>[R]</td>
|
82
|
+
<td class='context-item-desc'></td>
|
83
|
+
</tr>
|
84
|
+
</table>
|
85
|
+
</div>
|
86
|
+
</div>
|
87
|
+
<div id='methods'>
|
88
|
+
<h2>Public instance methods</h2>
|
89
|
+
<div class='public-instance method' id='method-M000012'>
|
90
|
+
<a name='M000012'> </a>
|
91
|
+
<div class='synopsis'>
|
92
|
+
<span class='name'>url</span>
|
93
|
+
<span class='arguments'>(source_url)</span>
|
94
|
+
</div>
|
95
|
+
<div class='source'>
|
96
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000012-source'); return false">
|
97
|
+
[show source]
|
98
|
+
</a>
|
99
|
+
<pre id='M000012-source'> <span class="ruby-comment cmt"># File lib/smoke/source/data.rb, line 24</span>
24: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">url</span>(<span class="ruby-identifier">source_url</span>)
25: <span class="ruby-ivar">@url</span> = <span class="ruby-identifier">source_url</span>
26: <span class="ruby-keyword kw">end</span></pre>
|
100
|
+
</div>
|
101
|
+
</div>
|
102
|
+
<h2>Protected instance methods</h2>
|
103
|
+
<div class='protected-instance method' id='method-M000013'>
|
104
|
+
<a name='M000013'> </a>
|
105
|
+
<div class='synopsis'>
|
106
|
+
<span class='name'>dispatch</span>
|
107
|
+
<span class='arguments'>()</span>
|
108
|
+
</div>
|
109
|
+
<div class='source'>
|
110
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000013-source'); return false">
|
111
|
+
[show source]
|
112
|
+
</a>
|
113
|
+
<pre id='M000013-source'> <span class="ruby-comment cmt"># File lib/smoke/source/data.rb, line 29</span>
29: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dispatch</span>
30: <span class="ruby-ivar">@request</span> = <span class="ruby-constant">Smoke</span><span class="ruby-operator">::</span><span class="ruby-constant">Request</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@url</span>)
31: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">items</span> = (<span class="ruby-ivar">@path</span>.<span class="ruby-identifier">nil?</span>) <span class="ruby-operator">?</span> <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">body</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">drill</span>(<span class="ruby-ivar">@request</span>.<span class="ruby-identifier">body</span>, <span class="ruby-operator">*</span><span class="ruby-ivar">@path</span>)
32: <span class="ruby-keyword kw">end</span></pre>
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
</div>
|
117
|
+
</div>
|
118
|
+
</div>
|
119
|
+
</div>
|
120
|
+
<div id='footer-push'></div>
|
121
|
+
</div>
|
122
|
+
<div id='footer'>
|
123
|
+
<a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
|
124
|
+
</div>
|
125
|
+
</body>
|
126
|
+
</html>
|
@@ -0,0 +1,117 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2
|
+
<html lang='en'>
|
3
|
+
<head>
|
4
|
+
<title>: Smoke::Source::Feed [smoke]</title>
|
5
|
+
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
|
6
|
+
<link href='../../../rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
|
7
|
+
<script type='text/javascript'>
|
8
|
+
//<![CDATA[
|
9
|
+
function popupCode(url) {
|
10
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
11
|
+
}
|
12
|
+
|
13
|
+
function toggleCode(id) {
|
14
|
+
var code = document.getElementById(id)
|
15
|
+
|
16
|
+
code.style.display = code.style.display != 'block' ? 'block' : 'none'
|
17
|
+
return true
|
18
|
+
}
|
19
|
+
|
20
|
+
// Make codeblocks hidden by default
|
21
|
+
document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
|
22
|
+
//]]>
|
23
|
+
</script>
|
24
|
+
</head>
|
25
|
+
<body class='page'>
|
26
|
+
<div class='class' id='wrapper'>
|
27
|
+
<div class='header'>
|
28
|
+
<h1 class='name'>
|
29
|
+
<span class='type'>Class</span>
|
30
|
+
Smoke::Source::Feed
|
31
|
+
</h1>
|
32
|
+
<ol class='paths'>
|
33
|
+
<li>
|
34
|
+
<a href="../../../files/lib/smoke/source/feed_rb.html">lib/smoke/source/feed.rb</a>
|
35
|
+
</li>
|
36
|
+
</ol>
|
37
|
+
<div class='parent'>
|
38
|
+
Parent:
|
39
|
+
<strong><a href="../Origin.html">Smoke::Origin</a></strong>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
<div id='content'>
|
43
|
+
<div id='text'>
|
44
|
+
<div id='description'>
|
45
|
+
<p>
|
46
|
+
<a href="Feed.html">Feed</a> can take multiple rss or atom feeds and munge
|
47
|
+
them up together.
|
48
|
+
</p>
|
49
|
+
<p>
|
50
|
+
Usage:
|
51
|
+
</p>
|
52
|
+
<pre>Smoke.feed(:ruby) do
 url "domain.tld/rss"
 url "site.tld/atom"
end</pre>
|
53
|
+
</div>
|
54
|
+
<div id='method-list'>
|
55
|
+
<h2>Methods</h2>
|
56
|
+
<h3>public instance</h3>
|
57
|
+
<ol>
|
58
|
+
<li><a href="#M000010">url</a></li>
|
59
|
+
</ol>
|
60
|
+
<h3>protected instance</h3>
|
61
|
+
<ol>
|
62
|
+
<li><a href="#M000011">dispatch</a></li>
|
63
|
+
</ol>
|
64
|
+
</div>
|
65
|
+
<div id='section'>
|
66
|
+
<div id='attribute-list'>
|
67
|
+
<h2 class='section-bar'>Attributes</h2>
|
68
|
+
<div class='name-list'>
|
69
|
+
<table>
|
70
|
+
<tr class='top-aligned-row context-row'>
|
71
|
+
<td class='context-item-name'>requests</td>
|
72
|
+
<td class='context-item-value'>[R]</td>
|
73
|
+
<td class='context-item-desc'></td>
|
74
|
+
</tr>
|
75
|
+
</table>
|
76
|
+
</div>
|
77
|
+
</div>
|
78
|
+
<div id='methods'>
|
79
|
+
<h2>Public instance methods</h2>
|
80
|
+
<div class='public-instance method' id='method-M000010'>
|
81
|
+
<a name='M000010'> </a>
|
82
|
+
<div class='synopsis'>
|
83
|
+
<span class='name'>url</span>
|
84
|
+
<span class='arguments'>(feed_uri)</span>
|
85
|
+
</div>
|
86
|
+
<div class='source'>
|
87
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000010-source'); return false">
|
88
|
+
[show source]
|
89
|
+
</a>
|
90
|
+
<pre id='M000010-source'> <span class="ruby-comment cmt"># File lib/smoke/source/feed.rb, line 13</span>
13: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">url</span>(<span class="ruby-identifier">feed_uri</span>)
14: (<span class="ruby-ivar">@feeds</span> <span class="ruby-operator">||=</span> [] ) <span class="ruby-operator"><<</span> <span class="ruby-identifier">feed_uri</span>
15: <span class="ruby-keyword kw">end</span></pre>
|
91
|
+
</div>
|
92
|
+
</div>
|
93
|
+
<h2>Protected instance methods</h2>
|
94
|
+
<div class='protected-instance method' id='method-M000011'>
|
95
|
+
<a name='M000011'> </a>
|
96
|
+
<div class='synopsis'>
|
97
|
+
<span class='name'>dispatch</span>
|
98
|
+
<span class='arguments'>()</span>
|
99
|
+
</div>
|
100
|
+
<div class='source'>
|
101
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000011-source'); return false">
|
102
|
+
[show source]
|
103
|
+
</a>
|
104
|
+
<pre id='M000011-source'> <span class="ruby-comment cmt"># File lib/smoke/source/feed.rb, line 18</span>
18: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dispatch</span>
19: <span class="ruby-ivar">@requests</span> = <span class="ruby-ivar">@feeds</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">Smoke</span><span class="ruby-operator">::</span><span class="ruby-constant">Request</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">f</span>, <span class="ruby-identifier">:raw_response</span>) }
20: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">items</span> = <span class="ruby-ivar">@requests</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span> <span class="ruby-operator">::</span><span class="ruby-constant">SimpleRSS</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">r</span>.<span class="ruby-identifier">body</span>).<span class="ruby-identifier">items</span> }.<span class="ruby-identifier">flatten</span>
21: <span class="ruby-keyword kw">end</span></pre>
|
105
|
+
</div>
|
106
|
+
</div>
|
107
|
+
</div>
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
</div>
|
111
|
+
<div id='footer-push'></div>
|
112
|
+
</div>
|
113
|
+
<div id='footer'>
|
114
|
+
<a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
|
115
|
+
</div>
|
116
|
+
</body>
|
117
|
+
</html>
|
@@ -0,0 +1,223 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2
|
+
<html lang='en'>
|
3
|
+
<head>
|
4
|
+
<title>: Smoke::Source::YQL [smoke]</title>
|
5
|
+
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
|
6
|
+
<link href='../../../rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
|
7
|
+
<script type='text/javascript'>
|
8
|
+
//<![CDATA[
|
9
|
+
function popupCode(url) {
|
10
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
11
|
+
}
|
12
|
+
|
13
|
+
function toggleCode(id) {
|
14
|
+
var code = document.getElementById(id)
|
15
|
+
|
16
|
+
code.style.display = code.style.display != 'block' ? 'block' : 'none'
|
17
|
+
return true
|
18
|
+
}
|
19
|
+
|
20
|
+
// Make codeblocks hidden by default
|
21
|
+
document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
|
22
|
+
//]]>
|
23
|
+
</script>
|
24
|
+
</head>
|
25
|
+
<body class='page'>
|
26
|
+
<div class='class' id='wrapper'>
|
27
|
+
<div class='header'>
|
28
|
+
<h1 class='name'>
|
29
|
+
<span class='type'>Class</span>
|
30
|
+
Smoke::Source::YQL
|
31
|
+
</h1>
|
32
|
+
<ol class='paths'>
|
33
|
+
<li>
|
34
|
+
<a href="../../../files/lib/smoke/source/yql_rb.html">lib/smoke/source/yql.rb</a>
|
35
|
+
</li>
|
36
|
+
</ol>
|
37
|
+
<div class='parent'>
|
38
|
+
Parent:
|
39
|
+
<strong><a href="../Origin.html">Smoke::Origin</a></strong>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
<div id='content'>
|
43
|
+
<div id='text'>
|
44
|
+
<div id='description'>
|
45
|
+
<p>
|
46
|
+
<a href="YQL.html">YQL</a> will call to Yahoo <a href="YQL.html">YQL</a>
|
47
|
+
services
|
48
|
+
</p>
|
49
|
+
<p>
|
50
|
+
Usage:
|
51
|
+
</p>
|
52
|
+
<pre>Smoke.yql(:ruby) do
 select :all
 from "search.web"
 where :query, "ruby"
end</pre>
|
53
|
+
</div>
|
54
|
+
<div id='method-list'>
|
55
|
+
<h2>Methods</h2>
|
56
|
+
<h3>public instance</h3>
|
57
|
+
<ol>
|
58
|
+
<li><a href="#M000015">from</a></li>
|
59
|
+
<li><a href="#M000014">select</a></li>
|
60
|
+
<li><a href="#M000017">use</a></li>
|
61
|
+
<li><a href="#M000016">where</a></li>
|
62
|
+
</ol>
|
63
|
+
<h3>protected instance</h3>
|
64
|
+
<ol>
|
65
|
+
<li><a href="#M000019">dispatch</a></li>
|
66
|
+
<li><a href="#M000018">params</a></li>
|
67
|
+
</ol>
|
68
|
+
</div>
|
69
|
+
<div id='section'>
|
70
|
+
<div id='constants-list'>
|
71
|
+
<h2>Constants</h2>
|
72
|
+
<div class='name-list'>
|
73
|
+
<table summary='Constants'>
|
74
|
+
<tr class='top-aligned-row context-row'>
|
75
|
+
<td class='context-item-name'>API_BASE</td>
|
76
|
+
<td>=</td>
|
77
|
+
<td class='context-item-value'>"http://query.yahooapis.com/v1/public/yql"</td>
|
78
|
+
</tr>
|
79
|
+
</table>
|
80
|
+
</div>
|
81
|
+
</div>
|
82
|
+
<div id='attribute-list'>
|
83
|
+
<h2 class='section-bar'>Attributes</h2>
|
84
|
+
<div class='name-list'>
|
85
|
+
<table>
|
86
|
+
<tr class='top-aligned-row context-row'>
|
87
|
+
<td class='context-item-name'>request</td>
|
88
|
+
<td class='context-item-value'>[R]</td>
|
89
|
+
<td class='context-item-desc'></td>
|
90
|
+
</tr>
|
91
|
+
</table>
|
92
|
+
</div>
|
93
|
+
</div>
|
94
|
+
<div id='methods'>
|
95
|
+
<h2>Public instance methods</h2>
|
96
|
+
<div class='public-instance method' id='method-M000015'>
|
97
|
+
<a name='M000015'> </a>
|
98
|
+
<div class='synopsis'>
|
99
|
+
<span class='name'>from</span>
|
100
|
+
<span class='arguments'>(source)</span>
|
101
|
+
</div>
|
102
|
+
<div class='description'>
|
103
|
+
<p>
|
104
|
+
from corresponds to the from fragment of the <a href="YQL.html">YQL</a>
|
105
|
+
query Usage:
|
106
|
+
</p>
|
107
|
+
<pre>from "search.web"</pre>
|
108
|
+
<p>
|
109
|
+
or
|
110
|
+
</p>
|
111
|
+
<pre>from :html</pre>
|
112
|
+
</div>
|
113
|
+
<div class='source'>
|
114
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000015-source'); return false">
|
115
|
+
[show source]
|
116
|
+
</a>
|
117
|
+
<pre id='M000015-source'> <span class="ruby-comment cmt"># File lib/smoke/source/yql.rb, line 34</span>
34: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">from</span>(<span class="ruby-identifier">source</span>)
35: <span class="ruby-ivar">@from</span> = <span class="ruby-identifier">source</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">','</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">source</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Array</span>
36: <span class="ruby-ivar">@from</span> = <span class="ruby-identifier">source</span>.<span class="ruby-identifier">to_s</span>
37: <span class="ruby-keyword kw">end</span></pre>
|
118
|
+
</div>
|
119
|
+
</div>
|
120
|
+
<div class='public-instance method' id='method-M000014'>
|
121
|
+
<a name='M000014'> </a>
|
122
|
+
<div class='synopsis'>
|
123
|
+
<span class='name'>select</span>
|
124
|
+
<span class='arguments'>(what = :all)</span>
|
125
|
+
</div>
|
126
|
+
<div class='description'>
|
127
|
+
<p>
|
128
|
+
Select indicates what <a href="YQL.html">YQL</a> will be selecting Usage:
|
129
|
+
</p>
|
130
|
+
<pre>select :all
=> "SELECT *"
select :title
=> "SELECT title"
select :title, :description
=> "SELECT title, description"</pre>
|
131
|
+
</div>
|
132
|
+
<div class='source'>
|
133
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000014-source'); return false">
|
134
|
+
[show source]
|
135
|
+
</a>
|
136
|
+
<pre id='M000014-source'> <span class="ruby-comment cmt"># File lib/smoke/source/yql.rb, line 23</span>
23: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">select</span>(<span class="ruby-identifier">what</span> = <span class="ruby-identifier">:all</span>)
24: <span class="ruby-ivar">@select</span> = <span class="ruby-identifier">what</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">","</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">what</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Array</span>
25: <span class="ruby-ivar">@select</span> = <span class="ruby-value str">"*"</span> <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">what</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:all</span>
26: <span class="ruby-ivar">@select</span> = <span class="ruby-identifier">what</span>.<span class="ruby-identifier">to_s</span>
27: <span class="ruby-keyword kw">end</span></pre>
|
137
|
+
</div>
|
138
|
+
</div>
|
139
|
+
<div class='public-instance method' id='method-M000017'>
|
140
|
+
<a name='M000017'> </a>
|
141
|
+
<div class='synopsis'>
|
142
|
+
<span class='name'>use</span>
|
143
|
+
<span class='arguments'>(url)</span>
|
144
|
+
</div>
|
145
|
+
<div class='description'>
|
146
|
+
<p>
|
147
|
+
`use` can be used to set the url location of the data-table that you want
|
148
|
+
<a href="YQL.html">YQL</a> to search upon
|
149
|
+
</p>
|
150
|
+
<p>
|
151
|
+
Usage:
|
152
|
+
</p>
|
153
|
+
<pre>use "http://datatables.org/alltables.env"</pre>
|
154
|
+
</div>
|
155
|
+
<div class='source'>
|
156
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000017-source'); return false">
|
157
|
+
[show source]
|
158
|
+
</a>
|
159
|
+
<pre id='M000017-source'> <span class="ruby-comment cmt"># File lib/smoke/source/yql.rb, line 55</span>
55: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">use</span>(<span class="ruby-identifier">url</span>)
56: <span class="ruby-identifier">params</span>.<span class="ruby-identifier">merge!</span>({<span class="ruby-identifier">:env</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">url</span>})
57: <span class="ruby-keyword kw">end</span></pre>
|
160
|
+
</div>
|
161
|
+
</div>
|
162
|
+
<div class='public-instance method' id='method-M000016'>
|
163
|
+
<a name='M000016'> </a>
|
164
|
+
<div class='synopsis'>
|
165
|
+
<span class='name'>where</span>
|
166
|
+
<span class='arguments'>(column, value)</span>
|
167
|
+
</div>
|
168
|
+
<div class='description'>
|
169
|
+
<p>
|
170
|
+
where is a straight up match, no fancy matchers are currently supported
|
171
|
+
Usage:
|
172
|
+
</p>
|
173
|
+
<pre>where :xpath, "//div/div/a"</pre>
|
174
|
+
<p>
|
175
|
+
or
|
176
|
+
</p>
|
177
|
+
<pre>where :query, "python"</pre>
|
178
|
+
</div>
|
179
|
+
<div class='source'>
|
180
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000016-source'); return false">
|
181
|
+
[show source]
|
182
|
+
</a>
|
183
|
+
<pre id='M000016-source'> <span class="ruby-comment cmt"># File lib/smoke/source/yql.rb, line 45</span>
45: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">where</span>(<span class="ruby-identifier">column</span>, <span class="ruby-identifier">value</span>)
46: <span class="ruby-ivar">@where</span> = <span class="ruby-ivar">@where</span> <span class="ruby-operator">||</span> []
47: <span class="ruby-ivar">@where</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{column.to_s} = '#{value}'"</span>
48: <span class="ruby-keyword kw">end</span></pre>
|
184
|
+
</div>
|
185
|
+
</div>
|
186
|
+
<h2>Protected instance methods</h2>
|
187
|
+
<div class='protected-instance method' id='method-M000019'>
|
188
|
+
<a name='M000019'> </a>
|
189
|
+
<div class='synopsis'>
|
190
|
+
<span class='name'>dispatch</span>
|
191
|
+
<span class='arguments'>()</span>
|
192
|
+
</div>
|
193
|
+
<div class='source'>
|
194
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000019-source'); return false">
|
195
|
+
[show source]
|
196
|
+
</a>
|
197
|
+
<pre id='M000019-source'> <span class="ruby-comment cmt"># File lib/smoke/source/yql.rb, line 64</span>
64: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dispatch</span>
65: <span class="ruby-ivar">@request</span> = <span class="ruby-constant">Smoke</span><span class="ruby-operator">::</span><span class="ruby-constant">Request</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">build_uri</span>)
66: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">items</span> = [(<span class="ruby-ivar">@path</span>.<span class="ruby-identifier">nil?</span>) <span class="ruby-operator">?</span> <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">body</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">drill</span>(<span class="ruby-ivar">@request</span>.<span class="ruby-identifier">body</span>, <span class="ruby-operator">*</span><span class="ruby-ivar">@path</span>)]
67: <span class="ruby-keyword kw">end</span></pre>
|
198
|
+
</div>
|
199
|
+
</div>
|
200
|
+
<div class='protected-instance method' id='method-M000018'>
|
201
|
+
<a name='M000018'> </a>
|
202
|
+
<div class='synopsis'>
|
203
|
+
<span class='name'>params</span>
|
204
|
+
<span class='arguments'>()</span>
|
205
|
+
</div>
|
206
|
+
<div class='source'>
|
207
|
+
<a class='source-toggle' href='#' onclick="toggleCode('M000018-source'); return false">
|
208
|
+
[show source]
|
209
|
+
</a>
|
210
|
+
<pre id='M000018-source'> <span class="ruby-comment cmt"># File lib/smoke/source/yql.rb, line 60</span>
60: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">params</span> 
61: <span class="ruby-ivar">@params</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@params</span> = {}
62: <span class="ruby-keyword kw">end</span></pre>
|
211
|
+
</div>
|
212
|
+
</div>
|
213
|
+
</div>
|
214
|
+
</div>
|
215
|
+
</div>
|
216
|
+
</div>
|
217
|
+
<div id='footer-push'></div>
|
218
|
+
</div>
|
219
|
+
<div id='footer'>
|
220
|
+
<a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
|
221
|
+
</div>
|
222
|
+
</body>
|
223
|
+
</html>
|