smoke 0.0.3 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. data/LICENSE +20 -0
  2. data/README.markdown +101 -0
  3. data/Rakefile +53 -4
  4. data/VERSION.yml +4 -0
  5. data/examples/web_search_joined.rb +25 -0
  6. data/examples/yql_web_search.rb +11 -0
  7. data/lib/core_ext/hash.rb +20 -0
  8. data/lib/core_ext/string.rb +6 -0
  9. data/lib/smoke.rb +103 -3
  10. data/lib/smoke/cache.rb +56 -0
  11. data/lib/smoke/origin.rb +251 -0
  12. data/lib/smoke/request.rb +57 -0
  13. data/lib/smoke/source/data.rb +39 -0
  14. data/lib/smoke/source/feed.rb +24 -0
  15. data/lib/smoke/source/join.rb +33 -0
  16. data/lib/smoke/source/yql.rb +85 -0
  17. data/rdoc/classes/Smoke.html +260 -0
  18. data/rdoc/classes/Smoke/Origin.html +340 -0
  19. data/rdoc/classes/Smoke/Source/Data.html +126 -0
  20. data/rdoc/classes/Smoke/Source/Feed.html +117 -0
  21. data/rdoc/classes/Smoke/Source/YQL.html +223 -0
  22. data/rdoc/created.rid +1 -0
  23. data/rdoc/files/README_markdown.html +180 -0
  24. data/rdoc/files/lib/core_ext/hash_rb.html +49 -0
  25. data/rdoc/files/lib/smoke/origin_rb.html +49 -0
  26. data/rdoc/files/lib/smoke/request_rb.html +49 -0
  27. data/rdoc/files/lib/smoke/source/data_rb.html +49 -0
  28. data/rdoc/files/lib/smoke/source/feed_rb.html +49 -0
  29. data/rdoc/files/lib/smoke/source/join_rb.html +49 -0
  30. data/rdoc/files/lib/smoke/source/yql_rb.html +49 -0
  31. data/rdoc/files/lib/smoke_rb.html +65 -0
  32. data/rdoc/fr_class_index.html +21 -0
  33. data/rdoc/fr_file_index.html +28 -0
  34. data/rdoc/fr_method_index.html +4459 -0
  35. data/rdoc/index.html +15 -0
  36. data/rdoc/rdoc-style.css +319 -0
  37. data/spec/core_ext/hash_spec.rb +25 -0
  38. data/spec/smoke/cache_spec.rb +75 -0
  39. data/spec/smoke/origin_spec.rb +220 -0
  40. data/spec/smoke/request_spec.rb +49 -0
  41. data/spec/smoke/shared_spec.rb +182 -0
  42. data/spec/smoke/source/data_spec.rb +65 -0
  43. data/spec/smoke/source/feed_spec.rb +49 -0
  44. data/spec/smoke/source/join_spec.rb +53 -0
  45. data/spec/smoke/source/yql_spec.rb +111 -0
  46. data/spec/smoke_spec.rb +51 -0
  47. data/spec/spec.opts +1 -0
  48. data/spec/spec_helper.rb +17 -0
  49. data/spec/supports/amc_pacer.json.yql +10 -0
  50. data/spec/supports/datatables.yql +12 -0
  51. data/spec/supports/flickr-photo.json +7 -0
  52. data/spec/supports/gzip_response.txt +0 -0
  53. data/spec/supports/search-web.json.yql +12 -0
  54. data/spec/supports/search-web.xml.yql +83 -0
  55. data/spec/supports/slashdot.xml +98 -0
  56. data/spec/supports/test_source.rb +10 -0
  57. metadata +144 -67
  58. data/History.txt +0 -13
  59. data/License.txt +0 -21
  60. data/Manifest.txt +0 -44
  61. data/README.txt +0 -3
  62. data/bin/smoke +0 -41
  63. data/bin/smoked +0 -43
  64. data/config/hoe.rb +0 -70
  65. data/config/requirements.rb +0 -17
  66. data/contrib/processors/smoke/remote_port_status_check_processor.rb +0 -10
  67. data/contrib/processors/smoke/system_load_processor.rb +0 -52
  68. data/contrib/signals/smoke/remote_port_status_check.rb +0 -39
  69. data/contrib/signals/smoke/system_load.rb +0 -23
  70. data/lib/smoke/client.rb +0 -50
  71. data/lib/smoke/client/connection.rb +0 -44
  72. data/lib/smoke/client/signal_runner.rb +0 -40
  73. data/lib/smoke/client/version.rb +0 -11
  74. data/lib/smoke/server.rb +0 -18
  75. data/lib/smoke/server/signal_handler.rb +0 -64
  76. data/lib/smoke/server/signal_router.rb +0 -38
  77. data/lib/smoke/server/version.rb +0 -11
  78. data/lib/smoke/signal.rb +0 -19
  79. data/lib/smoke/signal_processor.rb +0 -29
  80. data/lib/smoke/version.rb +0 -9
  81. data/log/debug.log +0 -0
  82. data/log/development.log +0 -0
  83. data/log/production.log +0 -0
  84. data/log/server.log +0 -0
  85. data/log/test.log +0 -0
  86. data/script/destroy +0 -14
  87. data/script/generate +0 -14
  88. data/script/txt2html +0 -74
  89. data/setup.rb +0 -1585
  90. data/tasks/deployment.rake +0 -35
  91. data/tasks/environment.rake +0 -7
  92. data/tasks/website.rake +0 -17
  93. data/test/test_helper.rb +0 -2
  94. data/test/test_server.rb +0 -11
  95. data/website/index.html +0 -87
  96. data/website/index.txt +0 -29
  97. data/website/javascripts/rounded_corners_lite.inc.js +0 -285
  98. data/website/stylesheets/screen.css +0 -138
  99. data/website/template.rhtml +0 -48
@@ -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&#x000A; url &quot;domain.tld/rss&quot;&#x000A; url &quot;site.tld/atom&quot;&#x000A;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>&#x000A;13: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">url</span>(<span class="ruby-identifier">feed_uri</span>)&#x000A;14: (<span class="ruby-ivar">@feeds</span> <span class="ruby-operator">||=</span> [] ) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">feed_uri</span>&#x000A;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>&#x000A;18: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dispatch</span>&#x000A;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>) }&#x000A;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>&#x000A;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&#x000A; select :all&#x000A; from &quot;search.web&quot;&#x000A; where :query, &quot;ruby&quot;&#x000A;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'>&quot;http://query.yahooapis.com/v1/public/yql&quot;</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 &quot;search.web&quot;</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>&#x000A;34: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">from</span>(<span class="ruby-identifier">source</span>)&#x000A;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>&#x000A;36: <span class="ruby-ivar">@from</span> = <span class="ruby-identifier">source</span>.<span class="ruby-identifier">to_s</span>&#x000A;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&#x000A;=&gt; &quot;SELECT *&quot;&#x000A;select :title&#x000A;=&gt; &quot;SELECT title&quot;&#x000A;select :title, :description&#x000A;=&gt; &quot;SELECT title, description&quot;</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>&#x000A;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>)&#x000A;24: <span class="ruby-ivar">@select</span> = <span class="ruby-identifier">what</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;,&quot;</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>&#x000A;25: <span class="ruby-ivar">@select</span> = <span class="ruby-value str">&quot;*&quot;</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>&#x000A;26: <span class="ruby-ivar">@select</span> = <span class="ruby-identifier">what</span>.<span class="ruby-identifier">to_s</span>&#x000A;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 &quot;http://datatables.org/alltables.env&quot;</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>&#x000A;55: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">use</span>(<span class="ruby-identifier">url</span>)&#x000A;56: <span class="ruby-identifier">params</span>.<span class="ruby-identifier">merge!</span>({<span class="ruby-identifier">:env</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">url</span>})&#x000A;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, &quot;//div/div/a&quot;</pre>
174
+ <p>
175
+ or
176
+ </p>
177
+ <pre>where :query, &quot;python&quot;</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>&#x000A;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>)&#x000A;46: <span class="ruby-ivar">@where</span> = <span class="ruby-ivar">@where</span> <span class="ruby-operator">||</span> []&#x000A;47: <span class="ruby-ivar">@where</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{column.to_s} = '#{value}'&quot;</span>&#x000A;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>&#x000A;64: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dispatch</span>&#x000A;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>)&#x000A;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>)]&#x000A;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>&#x000A;60: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">params</span> &#x000A;61: <span class="ruby-ivar">@params</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@params</span> = {}&#x000A;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>
data/rdoc/created.rid ADDED
@@ -0,0 +1 @@
1
+ Mon, 08 Jun 2009 23:18:27 +1000
@@ -0,0 +1,180 @@
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>File: README.markdown [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='file' id='wrapper'>
27
+ <div class='header'>
28
+ <h1 class='name'>README.markdown</h1>
29
+ <div class='paths'>
30
+ README.markdown
31
+ </div>
32
+ <div class='last-update'>
33
+ Last Update:
34
+ <span class='datetime'>Mon Jun 08 19:58:40 +1000 2009</span>
35
+ </div>
36
+ </div>
37
+ <div id='content'>
38
+ <div id='text'>
39
+ <div id='description'>
40
+ <p>
41
+ # smoke
42
+ </p>
43
+ <p>
44
+ smoke is a Ruby based DSL that allows you to take data from YQL, RSS / Atom
45
+ (and more, if you think of a useful source). This &#8220;data&#8221; can
46
+ then be re-represented, sorted and filtered. You can collect data from a
47
+ multiude of sources, sort them on a common property and return a plain old
48
+ ruby object or json (You could add in something to output XML too)
49
+ </p>
50
+ <p>
51
+ ## Media
52
+ </p>
53
+ <ul>
54
+ <li>[Presentation from Melbourne roro](<a
55
+ href="http://www.slideshare.net/benschwarz/smoke-1371124">www.slideshare.net/benschwarz/smoke-1371124</a>)
56
+
57
+ </li>
58
+ <li>Early [screencast](<a
59
+ href="http://vimeo.com/4272804">vimeo.com/4272804</a>) to get developer /
60
+ peer feedback
61
+
62
+ </li>
63
+ </ul>
64
+ <p>
65
+ ## The concept
66
+ </p>
67
+ <p>
68
+ The concept comes from using [Yahoo Pipes](<a
69
+ href="http://pipes.yahoo.com">pipes.yahoo.com</a>) to make little mash ups,
70
+ get a list of tv shows for my torrent client, compile a recipe book or make
71
+ tools to give me a list of albums that artists in my music library are
72
+ about to be release.
73
+ </p>
74
+ <p>
75
+ ## How or what to contribute
76
+ </p>
77
+ <ul>
78
+ <li>Test everything you do
79
+
80
+ </li>
81
+ <li>Add a way to output (XML, anyone?)
82
+
83
+ </li>
84
+ <li>Examples of queries you&#8217;d like to be able to do (email / github
85
+ message them to me)
86
+
87
+ </li>
88
+ </ul>
89
+ <p>
90
+ ## API Examples ### YQL
91
+ </p>
92
+ <pre># This will use yahoo search to get an array of search results about Ruby&#x000A;Smoke.yql(:ruby) do&#x000A; select :all&#x000A; from &quot;search.web&quot;&#x000A; where :query, &quot;ruby&quot;&#x000A;&#x000A; discard :title, /tuesday/i&#x000A;end&#x000A;&#x000A;Smoke.yql(:python) do&#x000A; select :all&#x000A; from &quot;search.web&quot;&#x000A; where :query, &quot;python&quot;&#x000A;end</pre>
93
+ <p>
94
+ ### Join sources and use them together
95
+ </p>
96
+ <pre>Smoke.join(:ruby, :python)</pre>
97
+ <p>
98
+ or even
99
+ </p>
100
+ <pre>Smoke.join(:python, :ruby) do&#x000A; emit do&#x000A; sort :title&#x000A; rename :shit_name =&gt; :title&#x000A; end&#x000A;end</pre>
101
+ <p>
102
+ ### Define a source allowing for variables to be injected later
103
+ </p>
104
+ <p>
105
+ Source definition:
106
+ </p>
107
+ <pre>Smoke.feed :delicious do&#x000A; prepare do&#x000A; url &quot;http://feeds.delicious.com/v2/rss/#{username}?count=15&quot;&#x000A; end&#x000A;end</pre>
108
+ <p>
109
+ Execution:
110
+ </p>
111
+ <pre>Smoke[:delicious].username(&quot;bschwarz&quot;).output</pre>
112
+ <p>
113
+ ### CI
114
+ </p>
115
+ <p>
116
+ Integrity [is running for smoke](<a
117
+ href="http://integrity.ffolio.net/smoke">integrity.ffolio.net/smoke</a>)
118
+ </p>
119
+ <p>
120
+ ### TODO (working on, just mental notes)
121
+ </p>
122
+ <ul>
123
+ <li>Joined sources require a call to dispatch when their parent calls output
124
+
125
+ </li>
126
+ <li>Sources that are renamed also need their @name&#8217;s renaming
127
+
128
+ </li>
129
+ <li>Implement a disaptch / request method that will actually thread property
130
+ (event-machine)
131
+
132
+ </li>
133
+ <li>Checkout experimental fakeweb version to stub out the yql specs
134
+
135
+ </li>
136
+ </ul>
137
+ <p>
138
+ #### Later / maybe
139
+ </p>
140
+ <ul>
141
+ <li>Allow for sources to explicitly set the content type being returned for
142
+ those stupid content providers
143
+
144
+ </li>
145
+ <li>YQL w/oAuth
146
+
147
+ </li>
148
+ <li>YQL Subqueries?
149
+
150
+ </li>
151
+ </ul>
152
+ <p>
153
+ #### For wiki pages (docs, later)
154
+ </p>
155
+ <ul>
156
+ <li>How to use `path`
157
+
158
+ </li>
159
+ <li>YQL Definitions
160
+
161
+ </li>
162
+ </ul>
163
+ <p>
164
+ ### Copyright
165
+ </p>
166
+ <p>
167
+ Copyright &#169; 2009 Ben Schwarz. See LICENSE for details.
168
+ </p>
169
+ </div>
170
+ <div id='section'>
171
+ </div>
172
+ </div>
173
+ </div>
174
+ <div id='footer-push'></div>
175
+ </div>
176
+ <div id='footer'>
177
+ <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
178
+ </div>
179
+ </body>
180
+ </html>