tumblargh 0.1.0 → 0.2.0

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.
@@ -1,41 +0,0 @@
1
- require 'rack/tumblargh'
2
-
3
- module Middleman::Features::Tumblargh
4
-
5
- class << self
6
-
7
- def registered(app)
8
- options = {}
9
- app.set(:tumblr_options, options)
10
- app.extend(ClassMethods)
11
-
12
- unless app.build?
13
- app.use(Rack::Tumblargh, options)
14
-
15
- ['/tweets.js', %r{/api.*}].each do |route|
16
- app.get route do
17
- redirect "http://#{app.tumblr_options[:blog]}#{request.path}?#{request.query_string}"
18
- end
19
- end
20
-
21
- app.page '/post/:id*', :proxy => '/index.html'
22
- end
23
- end
24
-
25
- alias :included :registered
26
-
27
- module ClassMethods
28
- def tumblr_api_key=(key)
29
- Tumblargh::API::set_api_key(key)
30
- end
31
-
32
- def tumblr_blog=(blog=nil)
33
- tumblr_options[:blog] = blog
34
- end
35
-
36
- alias_method :set_tumblr_api_key, :tumblr_api_key=
37
- alias_method :set_tumblr_blog, :tumblr_blog=
38
- end
39
-
40
- end
41
- end