middleman 0.9.10 → 0.9.11
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.
- data/VERSION +1 -1
- data/lib/middleman/templater+dynamic_renderer.rb +30 -0
- data/middleman.gemspec +2 -1
- metadata +2 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.11
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Monkey-patch to use a dynamic renderer
|
2
|
+
class Templater::Actions::File
|
3
|
+
def identical?
|
4
|
+
if exists?
|
5
|
+
return true if File.mtime(source) < File.mtime(destination)
|
6
|
+
FileUtils.identical?(source, destination)
|
7
|
+
else
|
8
|
+
false
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
class Templater::Actions::Template
|
14
|
+
def render
|
15
|
+
# The default render just requests the page over Rack and writes the response
|
16
|
+
request_path = destination.gsub(File.join(Dir.pwd, Middleman::Base.build_dir), "")
|
17
|
+
browser = Rack::Test::Session.new(Rack::MockSession.new(Middleman::Base))
|
18
|
+
browser.get(request_path)
|
19
|
+
browser.last_response.body
|
20
|
+
end
|
21
|
+
|
22
|
+
def identical?
|
23
|
+
if File.exists?(destination)
|
24
|
+
return true if File.exists?(source) && File.mtime(source) < File.mtime(destination)
|
25
|
+
File.read(destination) == render
|
26
|
+
else
|
27
|
+
false
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/middleman.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{middleman}
|
8
|
-
s.version = "0.9.
|
8
|
+
s.version = "0.9.11"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Thomas Reynolds"]
|
@@ -49,6 +49,7 @@ Gem::Specification.new do |s|
|
|
49
49
|
"lib/middleman/template/views/index.html.haml",
|
50
50
|
"lib/middleman/template/views/layout.html.haml",
|
51
51
|
"lib/middleman/template/views/stylesheets/site.css.sass",
|
52
|
+
"lib/middleman/templater+dynamic_renderer.rb",
|
52
53
|
"middleman.gemspec",
|
53
54
|
"spec/builder_spec.rb",
|
54
55
|
"spec/cache_buster_spec.rb",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Reynolds
|
@@ -136,6 +136,7 @@ files:
|
|
136
136
|
- lib/middleman/template/views/index.html.haml
|
137
137
|
- lib/middleman/template/views/layout.html.haml
|
138
138
|
- lib/middleman/template/views/stylesheets/site.css.sass
|
139
|
+
- lib/middleman/templater+dynamic_renderer.rb
|
139
140
|
- middleman.gemspec
|
140
141
|
- spec/builder_spec.rb
|
141
142
|
- spec/cache_buster_spec.rb
|