smoke 0.5.17 → 0.5.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. data/README.markdown +5 -5
  2. data/Rakefile +1 -0
  3. data/VERSION.yml +2 -2
  4. data/lib/core_ext/array.rb +12 -0
  5. data/lib/smoke.rb +24 -13
  6. data/lib/smoke/cache.rb +4 -4
  7. data/lib/smoke/origin.rb +6 -11
  8. data/lib/smoke/request.rb +5 -14
  9. data/lib/smoke/transformer.rb +7 -0
  10. data/lib/smoke/transformers/json.rb +15 -0
  11. data/lib/smoke/transformers/ruby.rb +11 -0
  12. data/lib/smoke/{output → transformers}/xml.rb +12 -6
  13. data/lib/smoke/transformers/yaml.rb +15 -0
  14. data/spec/smoke/origin_spec.rb +4 -0
  15. data/spec/smoke/request_spec.rb +7 -0
  16. data/spec/smoke/{output → transformers}/xml_spec.rb +4 -6
  17. data/spec/smoke/transformers_spec.rb +35 -0
  18. data/spec/smoke_spec.rb +18 -10
  19. data/spec/supports/twitter_timeline.json +22 -0
  20. metadata +23 -30
  21. data/rdoc/classes/Smoke.html +0 -260
  22. data/rdoc/classes/Smoke/Origin.html +0 -340
  23. data/rdoc/classes/Smoke/Source/Data.html +0 -126
  24. data/rdoc/classes/Smoke/Source/Feed.html +0 -117
  25. data/rdoc/classes/Smoke/Source/YQL.html +0 -223
  26. data/rdoc/created.rid +0 -1
  27. data/rdoc/files/README_markdown.html +0 -180
  28. data/rdoc/files/lib/core_ext/hash_rb.html +0 -49
  29. data/rdoc/files/lib/smoke/origin_rb.html +0 -49
  30. data/rdoc/files/lib/smoke/request_rb.html +0 -49
  31. data/rdoc/files/lib/smoke/source/data_rb.html +0 -49
  32. data/rdoc/files/lib/smoke/source/feed_rb.html +0 -49
  33. data/rdoc/files/lib/smoke/source/join_rb.html +0 -49
  34. data/rdoc/files/lib/smoke/source/yql_rb.html +0 -49
  35. data/rdoc/files/lib/smoke_rb.html +0 -65
  36. data/rdoc/fr_class_index.html +0 -21
  37. data/rdoc/fr_file_index.html +0 -28
  38. data/rdoc/fr_method_index.html +0 -4459
  39. data/rdoc/index.html +0 -15
  40. data/rdoc/rdoc-style.css +0 -319
  41. data/spec/smoke/input/xls_spec.rb +0 -15
  42. data/spec/smoke/shared_spec.rb +0 -182
  43. data/spec/supports/gov_act_toliets.xls +0 -0
@@ -1 +0,0 @@
1
- Mon, 08 Jun 2009 23:18:27 +1000
@@ -1,180 +0,0 @@
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>
@@ -1,49 +0,0 @@
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: hash.rb [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'>hash.rb</h1>
29
- <div class='paths'>
30
- lib/core_ext/hash.rb
31
- </div>
32
- <div class='last-update'>
33
- Last Update:
34
- <span class='datetime'>Wed Apr 08 15:45:49 +1000 2009</span>
35
- </div>
36
- </div>
37
- <div id='content'>
38
- <div id='text'>
39
- <div id='section'>
40
- </div>
41
- </div>
42
- </div>
43
- <div id='footer-push'></div>
44
- </div>
45
- <div id='footer'>
46
- <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
47
- </div>
48
- </body>
49
- </html>
@@ -1,49 +0,0 @@
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: origin.rb [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'>origin.rb</h1>
29
- <div class='paths'>
30
- lib/smoke/origin.rb
31
- </div>
32
- <div class='last-update'>
33
- Last Update:
34
- <span class='datetime'>Mon Jun 08 21:45:08 +1000 2009</span>
35
- </div>
36
- </div>
37
- <div id='content'>
38
- <div id='text'>
39
- <div id='section'>
40
- </div>
41
- </div>
42
- </div>
43
- <div id='footer-push'></div>
44
- </div>
45
- <div id='footer'>
46
- <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
47
- </div>
48
- </body>
49
- </html>
@@ -1,49 +0,0 @@
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: request.rb [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'>request.rb</h1>
29
- <div class='paths'>
30
- lib/smoke/request.rb
31
- </div>
32
- <div class='last-update'>
33
- Last Update:
34
- <span class='datetime'>Wed Jun 03 21:40:58 +1000 2009</span>
35
- </div>
36
- </div>
37
- <div id='content'>
38
- <div id='text'>
39
- <div id='section'>
40
- </div>
41
- </div>
42
- </div>
43
- <div id='footer-push'></div>
44
- </div>
45
- <div id='footer'>
46
- <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
47
- </div>
48
- </body>
49
- </html>
@@ -1,49 +0,0 @@
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: data.rb [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'>data.rb</h1>
29
- <div class='paths'>
30
- lib/smoke/source/data.rb
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='section'>
40
- </div>
41
- </div>
42
- </div>
43
- <div id='footer-push'></div>
44
- </div>
45
- <div id='footer'>
46
- <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
47
- </div>
48
- </body>
49
- </html>
@@ -1,49 +0,0 @@
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: feed.rb [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'>feed.rb</h1>
29
- <div class='paths'>
30
- lib/smoke/source/feed.rb
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='section'>
40
- </div>
41
- </div>
42
- </div>
43
- <div id='footer-push'></div>
44
- </div>
45
- <div id='footer'>
46
- <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
47
- </div>
48
- </body>
49
- </html>
@@ -1,49 +0,0 @@
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: join.rb [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'>join.rb</h1>
29
- <div class='paths'>
30
- lib/smoke/source/join.rb
31
- </div>
32
- <div class='last-update'>
33
- Last Update:
34
- <span class='datetime'>Mon Jun 08 23:09:33 +1000 2009</span>
35
- </div>
36
- </div>
37
- <div id='content'>
38
- <div id='text'>
39
- <div id='section'>
40
- </div>
41
- </div>
42
- </div>
43
- <div id='footer-push'></div>
44
- </div>
45
- <div id='footer'>
46
- <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
47
- </div>
48
- </body>
49
- </html>