caboodle 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. data/.document +5 -0
  2. data/.gitignore +21 -0
  3. data/LICENSE +20 -0
  4. data/README.rdoc +21 -0
  5. data/Rakefile +64 -0
  6. data/VERSION +1 -0
  7. data/bin/caboodle +14 -0
  8. data/lib/.yardoc/checksums +2 -0
  9. data/lib/.yardoc/objects/Pago/App.dat +0 -0
  10. data/lib/.yardoc/objects/Pago/MenuItems.dat +0 -0
  11. data/lib/.yardoc/objects/Pago/Plugin/is_a_pago_plugin_c.dat +0 -0
  12. data/lib/.yardoc/objects/Pago/Plugin/load_all_c.dat +0 -0
  13. data/lib/.yardoc/objects/Pago/Plugin/menu_c.dat +0 -0
  14. data/lib/.yardoc/objects/Pago/Plugin/use_all_c.dat +0 -0
  15. data/lib/.yardoc/objects/Pago/Plugin.dat +0 -0
  16. data/lib/.yardoc/objects/Pago/Plugins.dat +0 -0
  17. data/lib/.yardoc/objects/Pago/Site.dat +0 -0
  18. data/lib/.yardoc/objects/Pago.dat +0 -0
  19. data/lib/.yardoc/objects/root.dat +0 -0
  20. data/lib/.yardoc/proxy_types +2 -0
  21. data/lib/caboodle/app/.gems +1 -0
  22. data/lib/caboodle/app/config/site.yml +4 -0
  23. data/lib/caboodle/app/config.ru +2 -0
  24. data/lib/caboodle/app/public/favicon.ico +0 -0
  25. data/lib/caboodle/app/public/images/favicon.ico +0 -0
  26. data/lib/caboodle/app/public/images/grid.png +0 -0
  27. data/lib/caboodle/app/public/js/application.js +0 -0
  28. data/lib/caboodle/app/public/stylesheets/ie.css +1 -0
  29. data/lib/caboodle/app/public/stylesheets/print.css +122 -0
  30. data/lib/caboodle/app/public/stylesheets/screen.css +196 -0
  31. data/lib/caboodle/app/stylesheets/_base.scss +49 -0
  32. data/lib/caboodle/app/stylesheets/_defaults.scss +257 -0
  33. data/lib/caboodle/app/stylesheets/ie.scss +10 -0
  34. data/lib/caboodle/app/stylesheets/print.scss +33 -0
  35. data/lib/caboodle/app/stylesheets/screen.scss +292 -0
  36. data/lib/caboodle/app/views/layout.haml +66 -0
  37. data/lib/caboodle/app.rb +35 -0
  38. data/lib/caboodle/command.rb +38 -0
  39. data/lib/caboodle/config.rb +12 -0
  40. data/lib/caboodle/kit.rb +148 -0
  41. data/lib/caboodle/kits/flickr/flickr.rb +65 -0
  42. data/lib/caboodle/kits/flickr/galleria.noconflict.min.js +18 -0
  43. data/lib/caboodle/kits/flickr/views/photography.haml +108 -0
  44. data/lib/caboodle/kits/github/github.rb +44 -0
  45. data/lib/caboodle/kits/github/views/_repo.haml +7 -0
  46. data/lib/caboodle/kits/github/views/github.haml +11 -0
  47. data/lib/caboodle/kits/identity/identity.rb +18 -0
  48. data/lib/caboodle/kits/identity/views/me.haml +22 -0
  49. data/lib/caboodle/kits/lazyload/lazyload.rb +6 -0
  50. data/lib/caboodle/kits/lazyload/public/jquery.lazyload.mini.js +12 -0
  51. data/lib/caboodle/kits/lazyload/public/lazyload.js +3 -0
  52. data/lib/caboodle/kits/linkedin/linkedin.rb +33 -0
  53. data/lib/caboodle/kits/linkedin/views/cv.haml +6 -0
  54. data/lib/caboodle/kits/onepage/card.html +220 -0
  55. data/lib/caboodle/kits/onepage/onepage.rb +16 -0
  56. data/lib/caboodle/kits/onepage/views/contact.haml +2 -0
  57. data/lib/caboodle/kits/page/page.rb +69 -0
  58. data/lib/caboodle/kits/page/views/page.haml +2 -0
  59. data/lib/caboodle/kits/portfolio/portfolio.rb +14 -0
  60. data/lib/caboodle/kits/portfolio/views/portfolio.haml +29 -0
  61. data/lib/caboodle/kits/posterous/posterous.rb +163 -0
  62. data/lib/caboodle/kits/posterous/views/_post.haml +29 -0
  63. data/lib/caboodle/kits/posterous/views/post.haml +14 -0
  64. data/lib/caboodle/kits/posterous/views/posts.haml +21 -0
  65. data/lib/caboodle/kits/soundcloud/soundcloud.rb +31 -0
  66. data/lib/caboodle/kits/soundcloud/views/soundcloud.haml +17 -0
  67. data/lib/caboodle/kits/twitter/public/images/ajax-loader.gif +0 -0
  68. data/lib/caboodle/kits/twitter/public/images/link.png +0 -0
  69. data/lib/caboodle/kits/twitter/twitter.rb +16 -0
  70. data/lib/caboodle/kits/twitter/views/twitter.haml +101 -0
  71. data/lib/caboodle/kits/typekit/public/typekit.js +1 -0
  72. data/lib/caboodle/kits/typekit/typekit.rb +10 -0
  73. data/lib/caboodle/scrape.rb +9 -0
  74. data/lib/caboodle.rb +3 -0
  75. data/test/helper.rb +10 -0
  76. data/test/test_caboodle.rb +7 -0
  77. metadata +348 -0
@@ -0,0 +1,16 @@
1
+ module Caboodle
2
+ class Twitter < Caboodle::Kit
3
+
4
+ set :views, File.join(File.dirname(__FILE__), "views")
5
+ set :public, File.join(File.dirname(__FILE__), "public")
6
+
7
+ get "/twitter" do
8
+ @title = "Twitter"
9
+ haml :twitter
10
+ end
11
+
12
+ menu "Twitter", "/twitter"
13
+
14
+ required [:twitter_username]
15
+ end
16
+ end
@@ -0,0 +1,101 @@
1
+ :javascript
2
+ /*
3
+ * Adapted from: Marco Kuiper (http://www.marcofolio.net/)
4
+ * And: Simon Whatley (http://www.simonwhatley.co.uk/parsing-twitter-usernames-hashtags-and-urls-with-javascript)
5
+ */
6
+
7
+ String.prototype.parseHashtag = function() {
8
+ return this.replace(/[#]+[A-Za-z0-9-_]+/g, function(t) {
9
+ var tag = t.replace("#","%23")
10
+ return t.link("http://search.twitter.com/search?q="+tag);
11
+ });
12
+ };
13
+
14
+ String.prototype.parseUsername = function() {
15
+ return this.replace(/[@]+[A-Za-z0-9-_]+/g, function(u) {
16
+ var username = u.replace("@","")
17
+ return u.link("http://twitter.com/"+username);
18
+ });
19
+ };
20
+
21
+ String.prototype.parseURL = function() {
22
+ return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/g, function(url) {
23
+ return url.link(url);
24
+ });
25
+ };
26
+
27
+ $(document).ready(function()
28
+ {
29
+ /**
30
+ * Set the size for each page to load
31
+ */
32
+ var pageSize = 15;
33
+
34
+ /**
35
+ * Username to load the timeline from
36
+ */
37
+ var username = '#{Caboodle::Site.twitter_username}';
38
+
39
+ /**
40
+ * Variable for the current page
41
+ */
42
+ var currentPage = 1;
43
+
44
+ // Appends the new tweet to the UI
45
+ var appendTweet = function(tweet, id) {
46
+ $("<p class='tweet' />")
47
+
48
+ .html($("<a class='status_link' />")
49
+ .attr("href", "http://twitter.com/" + username + "/status/" + id)
50
+ .attr("title", "Go to Twitter status")
51
+ .append($("<img class='status' />")
52
+ .attr("src", "/images/link.png")
53
+ )
54
+ )
55
+ .append(tweet)
56
+ .appendTo($("#tweets"));
57
+ };
58
+
59
+ // Loads the next tweets
60
+ var loadTweets = function() {
61
+ var url = "http://twitter.com/status/user_timeline/"
62
+ + username + ".json?count="+pageSize+"&page="+currentPage+"&callback=?";
63
+
64
+ $.getJSON(url,function(data) {
65
+ $.each(data, function(i, post) {
66
+ appendTweet("<p>" + post.text.parseURL().parseUsername().parseHashtag() + "</p>", post.id);
67
+ });
68
+
69
+ // We're done loading the tweets, so hide the overlay and update the UI
70
+ $("#overlay").fadeOut();
71
+ $("#pageCount").html(currentPage);
72
+ $("#tweetCount").html(currentPage * pageSize);
73
+ });
74
+
75
+ };
76
+
77
+ // First time, directly load the tweets
78
+ loadTweets();
79
+
80
+ // Append a scroll event handler to the container
81
+
82
+ $(window).scroll(function(){
83
+ if ($(window).scrollTop() == $(document).height() - $(window).height()){
84
+ currentPage++;
85
+
86
+ if(currentPage > 10) {
87
+ alert('We should not spam the Twitter API with calls. I hope you get the idea!');
88
+ return false;
89
+ }
90
+
91
+ $("#overlay").fadeIn();
92
+ loadTweets();
93
+ }
94
+ });
95
+
96
+ });
97
+
98
+ #twitter.page
99
+ #tweets
100
+ #overlay
101
+ %img{:src=>"/images/ajax-loader.gif"}
@@ -0,0 +1 @@
1
+ try{Typekit.load();}catch(e){}
@@ -0,0 +1,10 @@
1
+ module Caboodle
2
+ class Typekit < Caboodle::Kit
3
+
4
+ set :public, File.join(File.dirname(__FILE__), "public")
5
+
6
+ javascripts ["http://use.typekit.com/#{Caboodle::Site.typekit}.js","/typekit.js"]
7
+
8
+ required [:typekit]
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ module Caboodle
2
+ def self.scrape url
3
+ Nokogiri::HTML(Weary.get(url).perform_sleepily.body)
4
+ end
5
+
6
+ def self.mash req
7
+ Hashie::Mash.new(req.perform_sleepily.parse)
8
+ end
9
+ end
data/lib/caboodle.rb ADDED
@@ -0,0 +1,3 @@
1
+ $:<<File.dirname(__FILE__)
2
+ $:<<File.join(File.dirname(__FILE__),"caboodle")
3
+ %{sinatra/base sinatra/content_for yaml hashie haml find sinatra/base sinatra/compass sinatra/advanced_routes compass susy pp sleepy caboodle/config caboodle/kit caboodle/app caboodle/scrape}.split.each{|a| require a}
data/test/helper.rb ADDED
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'shoulda'
4
+
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
7
+ require 'caboodle'
8
+
9
+ class Test::Unit::TestCase
10
+ end
@@ -0,0 +1,7 @@
1
+ require 'helper'
2
+
3
+ class TestCaboodle < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,348 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: caboodle
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 0
10
+ version: 0.1.0
11
+ platform: ruby
12
+ authors:
13
+ - steflewandowski
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-08-13 00:00:00 +01:00
19
+ default_executable: caboodle
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: heroku
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: sinatra
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 15
44
+ segments:
45
+ - 1
46
+ - 0
47
+ version: "1.0"
48
+ type: :runtime
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: hashie
52
+ prerelease: false
53
+ requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ hash: 23
59
+ segments:
60
+ - 0
61
+ - 2
62
+ - 0
63
+ version: 0.2.0
64
+ type: :runtime
65
+ version_requirements: *id003
66
+ - !ruby/object:Gem::Dependency
67
+ name: haml
68
+ prerelease: false
69
+ requirement: &id004 !ruby/object:Gem::Requirement
70
+ none: false
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ hash: 31
75
+ segments:
76
+ - 3
77
+ - 0
78
+ - 12
79
+ version: 3.0.12
80
+ type: :runtime
81
+ version_requirements: *id004
82
+ - !ruby/object:Gem::Dependency
83
+ name: compass
84
+ prerelease: false
85
+ requirement: &id005 !ruby/object:Gem::Requirement
86
+ none: false
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ hash: 51
91
+ segments:
92
+ - 0
93
+ - 10
94
+ - 2
95
+ version: 0.10.2
96
+ type: :runtime
97
+ version_requirements: *id005
98
+ - !ruby/object:Gem::Dependency
99
+ name: compass-susy-plugin
100
+ prerelease: false
101
+ requirement: &id006 !ruby/object:Gem::Requirement
102
+ none: false
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ hash: 3
107
+ segments:
108
+ - 0
109
+ - 7
110
+ - 0
111
+ version: 0.7.0
112
+ type: :runtime
113
+ version_requirements: *id006
114
+ - !ruby/object:Gem::Dependency
115
+ name: sinatra-compass
116
+ prerelease: false
117
+ requirement: &id007 !ruby/object:Gem::Requirement
118
+ none: false
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ hash: 11
123
+ segments:
124
+ - 0
125
+ - 5
126
+ - 0
127
+ version: 0.5.0
128
+ type: :runtime
129
+ version_requirements: *id007
130
+ - !ruby/object:Gem::Dependency
131
+ name: sinatra-advanced-routes
132
+ prerelease: false
133
+ requirement: &id008 !ruby/object:Gem::Requirement
134
+ none: false
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ hash: 9
139
+ segments:
140
+ - 0
141
+ - 5
142
+ - 1
143
+ version: 0.5.1
144
+ type: :runtime
145
+ version_requirements: *id008
146
+ - !ruby/object:Gem::Dependency
147
+ name: sinatra-content-for
148
+ prerelease: false
149
+ requirement: &id009 !ruby/object:Gem::Requirement
150
+ none: false
151
+ requirements:
152
+ - - ">="
153
+ - !ruby/object:Gem::Version
154
+ hash: 23
155
+ segments:
156
+ - 0
157
+ - 2
158
+ - 0
159
+ version: 0.2.0
160
+ type: :runtime
161
+ version_requirements: *id009
162
+ - !ruby/object:Gem::Dependency
163
+ name: memcached
164
+ prerelease: false
165
+ requirement: &id010 !ruby/object:Gem::Requirement
166
+ none: false
167
+ requirements:
168
+ - - ">="
169
+ - !ruby/object:Gem::Version
170
+ hash: 65
171
+ segments:
172
+ - 0
173
+ - 19
174
+ - 9
175
+ version: 0.19.9
176
+ type: :runtime
177
+ version_requirements: *id010
178
+ - !ruby/object:Gem::Dependency
179
+ name: nokogiri
180
+ prerelease: false
181
+ requirement: &id011 !ruby/object:Gem::Requirement
182
+ none: false
183
+ requirements:
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ hash: 7
187
+ segments:
188
+ - 1
189
+ - 4
190
+ - 0
191
+ version: 1.4.0
192
+ type: :runtime
193
+ version_requirements: *id011
194
+ - !ruby/object:Gem::Dependency
195
+ name: weary
196
+ prerelease: false
197
+ requirement: &id012 !ruby/object:Gem::Requirement
198
+ none: false
199
+ requirements:
200
+ - - ">="
201
+ - !ruby/object:Gem::Version
202
+ hash: 7
203
+ segments:
204
+ - 0
205
+ - 7
206
+ - 2
207
+ version: 0.7.2
208
+ type: :runtime
209
+ version_requirements: *id012
210
+ - !ruby/object:Gem::Dependency
211
+ name: sleepy
212
+ prerelease: false
213
+ requirement: &id013 !ruby/object:Gem::Requirement
214
+ none: false
215
+ requirements:
216
+ - - ">="
217
+ - !ruby/object:Gem::Version
218
+ hash: 29
219
+ segments:
220
+ - 0
221
+ - 1
222
+ - 3
223
+ version: 0.1.3
224
+ type: :runtime
225
+ version_requirements: *id013
226
+ description: Use Kits to create simple mashups.
227
+ email: stef@stef.io
228
+ executables:
229
+ - caboodle
230
+ extensions: []
231
+
232
+ extra_rdoc_files:
233
+ - LICENSE
234
+ - README.rdoc
235
+ files:
236
+ - .document
237
+ - .gitignore
238
+ - LICENSE
239
+ - README.rdoc
240
+ - Rakefile
241
+ - VERSION
242
+ - bin/caboodle
243
+ - lib/.yardoc/checksums
244
+ - lib/.yardoc/objects/Pago.dat
245
+ - lib/.yardoc/objects/Pago/App.dat
246
+ - lib/.yardoc/objects/Pago/MenuItems.dat
247
+ - lib/.yardoc/objects/Pago/Plugin.dat
248
+ - lib/.yardoc/objects/Pago/Plugin/is_a_pago_plugin_c.dat
249
+ - lib/.yardoc/objects/Pago/Plugin/load_all_c.dat
250
+ - lib/.yardoc/objects/Pago/Plugin/menu_c.dat
251
+ - lib/.yardoc/objects/Pago/Plugin/use_all_c.dat
252
+ - lib/.yardoc/objects/Pago/Plugins.dat
253
+ - lib/.yardoc/objects/Pago/Site.dat
254
+ - lib/.yardoc/objects/root.dat
255
+ - lib/.yardoc/proxy_types
256
+ - lib/caboodle.rb
257
+ - lib/caboodle/app.rb
258
+ - lib/caboodle/app/.gems
259
+ - lib/caboodle/app/config.ru
260
+ - lib/caboodle/app/config/site.yml
261
+ - lib/caboodle/app/public/favicon.ico
262
+ - lib/caboodle/app/public/images/favicon.ico
263
+ - lib/caboodle/app/public/images/grid.png
264
+ - lib/caboodle/app/public/js/application.js
265
+ - lib/caboodle/app/public/stylesheets/ie.css
266
+ - lib/caboodle/app/public/stylesheets/print.css
267
+ - lib/caboodle/app/public/stylesheets/screen.css
268
+ - lib/caboodle/app/stylesheets/_base.scss
269
+ - lib/caboodle/app/stylesheets/_defaults.scss
270
+ - lib/caboodle/app/stylesheets/ie.scss
271
+ - lib/caboodle/app/stylesheets/print.scss
272
+ - lib/caboodle/app/stylesheets/screen.scss
273
+ - lib/caboodle/app/views/layout.haml
274
+ - lib/caboodle/command.rb
275
+ - lib/caboodle/config.rb
276
+ - lib/caboodle/kit.rb
277
+ - lib/caboodle/kits/flickr/flickr.rb
278
+ - lib/caboodle/kits/flickr/galleria.noconflict.min.js
279
+ - lib/caboodle/kits/flickr/views/photography.haml
280
+ - lib/caboodle/kits/github/github.rb
281
+ - lib/caboodle/kits/github/views/_repo.haml
282
+ - lib/caboodle/kits/github/views/github.haml
283
+ - lib/caboodle/kits/identity/identity.rb
284
+ - lib/caboodle/kits/identity/views/me.haml
285
+ - lib/caboodle/kits/lazyload/lazyload.rb
286
+ - lib/caboodle/kits/lazyload/public/jquery.lazyload.mini.js
287
+ - lib/caboodle/kits/lazyload/public/lazyload.js
288
+ - lib/caboodle/kits/linkedin/linkedin.rb
289
+ - lib/caboodle/kits/linkedin/views/cv.haml
290
+ - lib/caboodle/kits/onepage/card.html
291
+ - lib/caboodle/kits/onepage/onepage.rb
292
+ - lib/caboodle/kits/onepage/views/contact.haml
293
+ - lib/caboodle/kits/page/page.rb
294
+ - lib/caboodle/kits/page/views/page.haml
295
+ - lib/caboodle/kits/portfolio/portfolio.rb
296
+ - lib/caboodle/kits/portfolio/views/portfolio.haml
297
+ - lib/caboodle/kits/posterous/posterous.rb
298
+ - lib/caboodle/kits/posterous/views/_post.haml
299
+ - lib/caboodle/kits/posterous/views/post.haml
300
+ - lib/caboodle/kits/posterous/views/posts.haml
301
+ - lib/caboodle/kits/soundcloud/soundcloud.rb
302
+ - lib/caboodle/kits/soundcloud/views/soundcloud.haml
303
+ - lib/caboodle/kits/twitter/public/images/ajax-loader.gif
304
+ - lib/caboodle/kits/twitter/public/images/link.png
305
+ - lib/caboodle/kits/twitter/twitter.rb
306
+ - lib/caboodle/kits/twitter/views/twitter.haml
307
+ - lib/caboodle/kits/typekit/public/typekit.js
308
+ - lib/caboodle/kits/typekit/typekit.rb
309
+ - lib/caboodle/scrape.rb
310
+ - test/helper.rb
311
+ - test/test_caboodle.rb
312
+ has_rdoc: true
313
+ homepage: http://github.com/steflewandowski/caboodle
314
+ licenses: []
315
+
316
+ post_install_message:
317
+ rdoc_options:
318
+ - --charset=UTF-8
319
+ require_paths:
320
+ - lib
321
+ required_ruby_version: !ruby/object:Gem::Requirement
322
+ none: false
323
+ requirements:
324
+ - - ">="
325
+ - !ruby/object:Gem::Version
326
+ hash: 3
327
+ segments:
328
+ - 0
329
+ version: "0"
330
+ required_rubygems_version: !ruby/object:Gem::Requirement
331
+ none: false
332
+ requirements:
333
+ - - ">="
334
+ - !ruby/object:Gem::Version
335
+ hash: 3
336
+ segments:
337
+ - 0
338
+ version: "0"
339
+ requirements: []
340
+
341
+ rubyforge_project:
342
+ rubygems_version: 1.3.7
343
+ signing_key:
344
+ specification_version: 3
345
+ summary: Web mashups the simple way
346
+ test_files:
347
+ - test/helper.rb
348
+ - test/test_caboodle.rb