wonki 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -11,7 +11,7 @@ begin
11
11
  gem.homepage = "http://github.com/rubyyot/wonki"
12
12
  gem.authors = ["rubyyot"]
13
13
  gem.add_dependency 'grit'
14
- gem.add_dependency 'flannel', '>= 0.1.5'
14
+ gem.add_dependency 'flannel', '>= 0.2.1'
15
15
  gem.add_development_dependency 'shoulda', '>= 2.10.2'
16
16
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
17
17
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.7
1
+ 0.0.8
@@ -1,12 +1,14 @@
1
1
  require 'wonki/storage'
2
2
  require 'wonki/page_not_found'
3
3
  require 'flannel'
4
+ require 'flannel/file_cache'
4
5
 
5
6
  module Wonki
6
7
  class WikiPage
7
- def initialize(repo_path, cache_control=nil)
8
+ def initialize(repo_path, flannel_cache=nil, cache_control=nil)
8
9
  @cache_control = cache_control
9
10
  @repo_path = repo_path
11
+ @flannel_cache = Flannel::FileCache.new(flannel_cache) if flannel_cache
10
12
  end
11
13
 
12
14
  def call(env)
@@ -39,7 +41,13 @@ module Wonki
39
41
  end
40
42
 
41
43
  def format_data data
42
- %Q{<h2 id="location">#{data[:route_name]}</h2><div id="content">#{Flannel.quilt(data[:content])}</div>}
44
+ if @flannel_cache
45
+ output = Flannel.quilt(data[:content], :cache => @flannel_cache)
46
+ else
47
+ output = Flannel.quilt(data[:content])
48
+ end
49
+
50
+ %Q{<h2 id="location">#{data[:route_name]}</h2><div id="content">#{output}</div>}
43
51
  end
44
52
 
45
53
  def set_cache_control headers
@@ -39,21 +39,21 @@ class WikiPageTest < Test::Unit::TestCase
39
39
  end
40
40
 
41
41
  should "set max age" do
42
- page = Wonki::WikiPage.new("~/working/rubyyot-wiki-test", :max_age => 300)
42
+ page = Wonki::WikiPage.new("~/working/rubyyot-wiki-test", nil, :max_age => 300)
43
43
  status, headers, body = page.build_response("/foo")
44
44
 
45
45
  assert_equal("max-age=300", headers["Cache-Control"])
46
46
  end
47
47
 
48
48
  should "set response directive" do
49
- page = Wonki::WikiPage.new("~/working/rubyyot-wiki-test", :response_directive => 'public')
49
+ page = Wonki::WikiPage.new("~/working/rubyyot-wiki-test", nil, :response_directive => 'public')
50
50
  status, headers, body = page.build_response("/foo")
51
51
 
52
52
  assert_equal("public", headers["Cache-Control"])
53
53
  end
54
54
 
55
55
  should "set both response directive and max_age when passed" do
56
- page = Wonki::WikiPage.new("~/working/rubyyot-wiki-test", :response_directive => 'public', :max_age => 20)
56
+ page = Wonki::WikiPage.new("~/working/rubyyot-wiki-test", nil, :response_directive => 'public', :max_age => 20)
57
57
  status, headers, body = page.build_response("/foo")
58
58
 
59
59
  assert_equal("max-age=20, public", headers["Cache-Control"])
data/wonki.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{wonki}
8
- s.version = "0.0.7"
8
+ s.version = "0.0.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["rubyyot"]
12
- s.date = %q{2010-01-13}
12
+ s.date = %q{2010-01-14}
13
13
  s.description = %q{a Rack and Git based wiki like thing}
14
14
  s.email = %q{jamal.hansen@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -49,16 +49,16 @@ Gem::Specification.new do |s|
49
49
 
50
50
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
51
51
  s.add_runtime_dependency(%q<grit>, [">= 0"])
52
- s.add_runtime_dependency(%q<flannel>, [">= 0.1.5"])
52
+ s.add_runtime_dependency(%q<flannel>, [">= 0.2.1"])
53
53
  s.add_development_dependency(%q<shoulda>, [">= 2.10.2"])
54
54
  else
55
55
  s.add_dependency(%q<grit>, [">= 0"])
56
- s.add_dependency(%q<flannel>, [">= 0.1.5"])
56
+ s.add_dependency(%q<flannel>, [">= 0.2.1"])
57
57
  s.add_dependency(%q<shoulda>, [">= 2.10.2"])
58
58
  end
59
59
  else
60
60
  s.add_dependency(%q<grit>, [">= 0"])
61
- s.add_dependency(%q<flannel>, [">= 0.1.5"])
61
+ s.add_dependency(%q<flannel>, [">= 0.2.1"])
62
62
  s.add_dependency(%q<shoulda>, [">= 2.10.2"])
63
63
  end
64
64
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wonki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - rubyyot
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-13 00:00:00 -06:00
12
+ date: 2010-01-14 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.1.5
33
+ version: 0.2.1
34
34
  version:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: shoulda