padrino-cache 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +20 -0
- data/README.rdoc +7 -0
- data/Rakefile +58 -0
- data/VERSION +1 -0
- data/lib/padrino-cache.rb +0 -0
- data/padrino-cache.gemspec +71 -0
- data/test/active_support_helpers.rb +7 -0
- data/test/helper.rb +74 -0
- data/test/test_padrino_cache.rb +7 -0
- metadata +130 -0
data/.document
ADDED
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Padrino
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "padrino-cache"
|
8
|
+
gem.summary = "Page and fragment caching for Padrino"
|
9
|
+
gem.description = "Caching support for memcached, page and fragment"
|
10
|
+
gem.email = "nesquena@gmail.com"
|
11
|
+
gem.homepage = "http://github.com/padrino/padrino-cache"
|
12
|
+
gem.authors = ["Padrino Team", "Nathan Esquenazi", "Davide D'Agostino", "Arthur Chiu"]
|
13
|
+
gem.add_runtime_dependency "sinatra", ">= 0.9.2"
|
14
|
+
gem.add_development_dependency "haml", ">= 2.2.1"
|
15
|
+
gem.add_development_dependency "shoulda", ">= 0"
|
16
|
+
gem.add_development_dependency "mocha", ">= 0.9.7"
|
17
|
+
gem.add_development_dependency "rack-test", ">= 0.5.0"
|
18
|
+
gem.add_development_dependency "webrat", ">= 0.5.1"
|
19
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
20
|
+
end
|
21
|
+
Jeweler::GemcutterTasks.new
|
22
|
+
rescue LoadError
|
23
|
+
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
24
|
+
end
|
25
|
+
|
26
|
+
require 'rake/testtask'
|
27
|
+
Rake::TestTask.new(:test) do |test|
|
28
|
+
test.libs << 'lib' << 'test'
|
29
|
+
test.pattern = 'test/**/test_*.rb'
|
30
|
+
test.verbose = true
|
31
|
+
end
|
32
|
+
|
33
|
+
begin
|
34
|
+
require 'rcov/rcovtask'
|
35
|
+
Rcov::RcovTask.new do |test|
|
36
|
+
test.libs << 'test'
|
37
|
+
test.pattern = 'test/**/test_*.rb'
|
38
|
+
test.verbose = true
|
39
|
+
end
|
40
|
+
rescue LoadError
|
41
|
+
task :rcov do
|
42
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
task :test => :check_dependencies
|
47
|
+
|
48
|
+
task :default => :test
|
49
|
+
|
50
|
+
require 'rake/rdoctask'
|
51
|
+
Rake::RDocTask.new do |rdoc|
|
52
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
53
|
+
|
54
|
+
rdoc.rdoc_dir = 'rdoc'
|
55
|
+
rdoc.title = "padrino-admin #{version}"
|
56
|
+
rdoc.rdoc_files.include('README*')
|
57
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
58
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
File without changes
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{padrino-cache}
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Padrino Team", "Nathan Esquenazi", "Davide D'Agostino", "Arthur Chiu"]
|
12
|
+
s.date = %q{2009-11-16}
|
13
|
+
s.description = %q{Caching support for memcached, page and fragment}
|
14
|
+
s.email = %q{nesquena@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"LICENSE",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"lib/padrino-cache.rb",
|
27
|
+
"padrino-cache.gemspec",
|
28
|
+
"test/active_support_helpers.rb",
|
29
|
+
"test/helper.rb",
|
30
|
+
"test/test_padrino_cache.rb"
|
31
|
+
]
|
32
|
+
s.homepage = %q{http://github.com/padrino/padrino-cache}
|
33
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
34
|
+
s.require_paths = ["lib"]
|
35
|
+
s.rubygems_version = %q{1.3.5}
|
36
|
+
s.summary = %q{Page and fragment caching for Padrino}
|
37
|
+
s.test_files = [
|
38
|
+
"test/active_support_helpers.rb",
|
39
|
+
"test/helper.rb",
|
40
|
+
"test/test_padrino_cache.rb"
|
41
|
+
]
|
42
|
+
|
43
|
+
if s.respond_to? :specification_version then
|
44
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
45
|
+
s.specification_version = 3
|
46
|
+
|
47
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
48
|
+
s.add_runtime_dependency(%q<sinatra>, [">= 0.9.2"])
|
49
|
+
s.add_development_dependency(%q<haml>, [">= 2.2.1"])
|
50
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
51
|
+
s.add_development_dependency(%q<mocha>, [">= 0.9.7"])
|
52
|
+
s.add_development_dependency(%q<rack-test>, [">= 0.5.0"])
|
53
|
+
s.add_development_dependency(%q<webrat>, [">= 0.5.1"])
|
54
|
+
else
|
55
|
+
s.add_dependency(%q<sinatra>, [">= 0.9.2"])
|
56
|
+
s.add_dependency(%q<haml>, [">= 2.2.1"])
|
57
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
58
|
+
s.add_dependency(%q<mocha>, [">= 0.9.7"])
|
59
|
+
s.add_dependency(%q<rack-test>, [">= 0.5.0"])
|
60
|
+
s.add_dependency(%q<webrat>, [">= 0.5.1"])
|
61
|
+
end
|
62
|
+
else
|
63
|
+
s.add_dependency(%q<sinatra>, [">= 0.9.2"])
|
64
|
+
s.add_dependency(%q<haml>, [">= 2.2.1"])
|
65
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
66
|
+
s.add_dependency(%q<mocha>, [">= 0.9.7"])
|
67
|
+
s.add_dependency(%q<rack-test>, [">= 0.5.0"])
|
68
|
+
s.add_dependency(%q<webrat>, [">= 0.5.1"])
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
data/test/helper.rb
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'test/unit'
|
3
|
+
require 'shoulda'
|
4
|
+
require 'mocha'
|
5
|
+
require 'rack/test'
|
6
|
+
require 'webrat'
|
7
|
+
|
8
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
9
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
10
|
+
require 'active_support_helpers'
|
11
|
+
require File.dirname(__FILE__) + '/../../padrino-helpers/lib/padrino-helpers.rb'
|
12
|
+
require File.dirname(__FILE__) + '/../lib/padrino-cache.rb'
|
13
|
+
|
14
|
+
class Test::Unit::TestCase
|
15
|
+
include Padrino::Helpers::OutputHelpers
|
16
|
+
include Padrino::Helpers::TagHelpers
|
17
|
+
include Padrino::Helpers::AssetTagHelpers
|
18
|
+
include Rack::Test::Methods
|
19
|
+
include Webrat::Methods
|
20
|
+
include Webrat::Matchers
|
21
|
+
|
22
|
+
Webrat.configure do |config|
|
23
|
+
config.mode = :rack
|
24
|
+
end
|
25
|
+
|
26
|
+
def stop_time_for_test
|
27
|
+
time = Time.now
|
28
|
+
Time.stubs(:now).returns(time)
|
29
|
+
return time
|
30
|
+
end
|
31
|
+
|
32
|
+
# assert_has_tag(:h1, :content => "yellow") { "<h1>yellow</h1>" }
|
33
|
+
# In this case, block is the html to evaluate
|
34
|
+
def assert_has_tag(name, attributes = {}, &block)
|
35
|
+
html = block && block.call
|
36
|
+
matcher = HaveSelector.new(name, attributes)
|
37
|
+
raise "Please specify a block!" if html.blank?
|
38
|
+
assert matcher.matches?(html), matcher.failure_message
|
39
|
+
end
|
40
|
+
|
41
|
+
# assert_has_no_tag, tag(:h1, :content => "yellow") { "<h1>green</h1>" }
|
42
|
+
# In this case, block is the html to evaluate
|
43
|
+
def assert_has_no_tag(name, attributes = {}, &block)
|
44
|
+
html = block && block.call
|
45
|
+
attributes.merge!(:count => 0)
|
46
|
+
matcher = HaveSelector.new(name, attributes)
|
47
|
+
raise "Please specify a block!" if html.blank?
|
48
|
+
assert matcher.matches?(html), matcher.failure_message
|
49
|
+
end
|
50
|
+
|
51
|
+
# Silences the output by redirecting to stringIO
|
52
|
+
# silence_logger { ...commands... } => "...output..."
|
53
|
+
def silence_logger(&block)
|
54
|
+
orig_stdout = $stdout
|
55
|
+
$stdout = log_buffer = StringIO.new
|
56
|
+
block.call
|
57
|
+
$stdout = orig_stdout
|
58
|
+
log_buffer.rewind && log_buffer.read
|
59
|
+
end
|
60
|
+
|
61
|
+
# Asserts that a file matches the pattern
|
62
|
+
def assert_match_in_file(pattern, file)
|
63
|
+
assert File.exist?(file), "File '#{file}' does not exist!"
|
64
|
+
assert_match pattern, File.read(file)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
module Webrat
|
69
|
+
module Logging
|
70
|
+
def logger # :nodoc:
|
71
|
+
@logger = nil
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
metadata
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: padrino-cache
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Padrino Team
|
8
|
+
- Nathan Esquenazi
|
9
|
+
- Davide D'Agostino
|
10
|
+
- Arthur Chiu
|
11
|
+
autorequire:
|
12
|
+
bindir: bin
|
13
|
+
cert_chain: []
|
14
|
+
|
15
|
+
date: 2009-11-16 00:00:00 -08:00
|
16
|
+
default_executable:
|
17
|
+
dependencies:
|
18
|
+
- !ruby/object:Gem::Dependency
|
19
|
+
name: sinatra
|
20
|
+
type: :runtime
|
21
|
+
version_requirement:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.9.2
|
27
|
+
version:
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: haml
|
30
|
+
type: :development
|
31
|
+
version_requirement:
|
32
|
+
version_requirements: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 2.2.1
|
37
|
+
version:
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: shoulda
|
40
|
+
type: :development
|
41
|
+
version_requirement:
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: "0"
|
47
|
+
version:
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: mocha
|
50
|
+
type: :development
|
51
|
+
version_requirement:
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 0.9.7
|
57
|
+
version:
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: rack-test
|
60
|
+
type: :development
|
61
|
+
version_requirement:
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 0.5.0
|
67
|
+
version:
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: webrat
|
70
|
+
type: :development
|
71
|
+
version_requirement:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 0.5.1
|
77
|
+
version:
|
78
|
+
description: Caching support for memcached, page and fragment
|
79
|
+
email: nesquena@gmail.com
|
80
|
+
executables: []
|
81
|
+
|
82
|
+
extensions: []
|
83
|
+
|
84
|
+
extra_rdoc_files:
|
85
|
+
- LICENSE
|
86
|
+
- README.rdoc
|
87
|
+
files:
|
88
|
+
- .document
|
89
|
+
- .gitignore
|
90
|
+
- LICENSE
|
91
|
+
- README.rdoc
|
92
|
+
- Rakefile
|
93
|
+
- VERSION
|
94
|
+
- lib/padrino-cache.rb
|
95
|
+
- padrino-cache.gemspec
|
96
|
+
- test/active_support_helpers.rb
|
97
|
+
- test/helper.rb
|
98
|
+
- test/test_padrino_cache.rb
|
99
|
+
has_rdoc: true
|
100
|
+
homepage: http://github.com/padrino/padrino-cache
|
101
|
+
licenses: []
|
102
|
+
|
103
|
+
post_install_message:
|
104
|
+
rdoc_options:
|
105
|
+
- --charset=UTF-8
|
106
|
+
require_paths:
|
107
|
+
- lib
|
108
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: "0"
|
113
|
+
version:
|
114
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: "0"
|
119
|
+
version:
|
120
|
+
requirements: []
|
121
|
+
|
122
|
+
rubyforge_project:
|
123
|
+
rubygems_version: 1.3.5
|
124
|
+
signing_key:
|
125
|
+
specification_version: 3
|
126
|
+
summary: Page and fragment caching for Padrino
|
127
|
+
test_files:
|
128
|
+
- test/active_support_helpers.rb
|
129
|
+
- test/helper.rb
|
130
|
+
- test/test_padrino_cache.rb
|