middleman 1.1.0.beta.0 → 1.1.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/mm-build +2 -4
- data/lib/middleman/builder.rb +80 -44
- data/lib/middleman/features.rb +2 -1
- data/lib/middleman/features/lorem.rb +104 -0
- data/lib/middleman/server.rb +3 -0
- data/lib/middleman/version.rb +1 -1
- data/middleman.gemspec +4 -3
- metadata +92 -32
- data/lib/middleman/templater+dynamic_renderer.rb +0 -26
data/bin/mm-build
CHANGED
@@ -9,7 +9,5 @@ require 'middleman/builder'
|
|
9
9
|
# Initialize server once so features are loaded
|
10
10
|
Middleman::Server.new
|
11
11
|
|
12
|
-
# Middleman::
|
13
|
-
Middleman::Builder.
|
14
|
-
|
15
|
-
Middleman::Generators.run_cli(Dir.pwd, 'mm-build', 1, %w(build --force).concat(ARGV))
|
12
|
+
# Middleman::ThorBuilder.source_root(Dir.pwd)
|
13
|
+
Middleman::Builder.start
|
data/lib/middleman/builder.rb
CHANGED
@@ -1,59 +1,95 @@
|
|
1
1
|
require 'middleman/server'
|
2
|
-
require
|
3
|
-
require
|
2
|
+
require "thor"
|
3
|
+
require "thor/group"
|
4
|
+
require 'rack/test'
|
4
5
|
|
5
|
-
|
6
|
-
module
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
def self.source_root; Dir.pwd; end
|
11
|
-
def destination_root; File.join(Dir.pwd, Middleman::Server.build_dir); end
|
6
|
+
module Middleman
|
7
|
+
module ThorActions
|
8
|
+
def tilt_template(source, *args, &block)
|
9
|
+
config = args.last.is_a?(Hash) ? args.pop : {}
|
10
|
+
destination = args.first || source
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
return if args[0].include?('layout')
|
12
|
+
source = File.expand_path(find_in_source_paths(source.to_s))
|
13
|
+
context = instance_eval('binding')
|
16
14
|
|
17
|
-
|
18
|
-
return if part[0,1] == '_'
|
19
|
-
end
|
15
|
+
@@rack_test ||= Rack::Test::Session.new(Rack::MockSession.new(Middleman::Server))
|
20
16
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
17
|
+
create_file destination, nil, config do
|
18
|
+
# The default render just requests the page over Rack and writes the response
|
19
|
+
request_path = destination.gsub(Middleman::Server.build_dir, "")
|
20
|
+
@@rack_test.get(request_path)
|
21
|
+
@@rack_test.last_response.body
|
26
22
|
end
|
27
|
-
|
28
|
-
super(name, *args, &block)
|
29
23
|
end
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
super(name, *args, &block)
|
24
|
+
end
|
25
|
+
|
26
|
+
class Builder < Thor::Group
|
27
|
+
include Thor::Actions
|
28
|
+
include Middleman::ThorActions
|
29
|
+
|
30
|
+
def initialize(*args)
|
31
|
+
::Tilt.mappings.keys << "js"
|
32
|
+
super
|
40
33
|
end
|
41
|
-
|
42
|
-
def
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
34
|
+
|
35
|
+
def source_paths
|
36
|
+
[
|
37
|
+
Middleman::Server.public,
|
38
|
+
Middleman::Server.views
|
39
|
+
]
|
47
40
|
end
|
48
41
|
|
49
|
-
def
|
42
|
+
def build_static_files
|
43
|
+
action Directory.new(self, Middleman::Server.public, Middleman::Server.build_dir)
|
44
|
+
end
|
45
|
+
|
46
|
+
def build_dynamic_files
|
47
|
+
action Directory.new(self, Middleman::Server.views, Middleman::Server.build_dir)
|
50
48
|
end
|
51
49
|
end
|
52
50
|
|
53
|
-
|
54
|
-
|
55
|
-
|
51
|
+
class Directory < ::Thor::Actions::EmptyDirectory
|
52
|
+
attr_reader :source
|
53
|
+
|
54
|
+
def initialize(base, source, destination=nil, config={}, &block)
|
55
|
+
@source = File.expand_path(base.find_in_source_paths(source.to_s))
|
56
|
+
@block = block
|
57
|
+
super(base, destination, { :recursive => true }.merge(config))
|
58
|
+
end
|
59
|
+
|
60
|
+
def invoke!
|
61
|
+
base.empty_directory given_destination, config
|
62
|
+
execute!
|
63
|
+
end
|
64
|
+
|
65
|
+
def revoke!
|
66
|
+
execute!
|
67
|
+
end
|
68
|
+
|
69
|
+
protected
|
70
|
+
|
71
|
+
def execute!
|
72
|
+
lookup = config[:recursive] ? File.join(source, '**') : source
|
73
|
+
lookup = File.join(lookup, '{*,.[a-z]*}')
|
74
|
+
|
75
|
+
Dir[lookup].sort.each do |file_source|
|
76
|
+
next if File.directory?(file_source)
|
77
|
+
next if file_source.include?('layout')
|
78
|
+
next unless file_source.split('/').select { |p| p[0,1] == '_' }.empty?
|
79
|
+
|
80
|
+
file_extension = File.extname(file_source)
|
81
|
+
file_destination = File.join(given_destination, file_source.gsub(source, '.'))
|
82
|
+
file_destination.gsub!('/./', '/')
|
83
|
+
|
84
|
+
handled_by_tilt = ::Tilt.mappings.keys.include?(file_extension.gsub(/^\./, ""))
|
85
|
+
if handled_by_tilt
|
86
|
+
file_destination.gsub!(file_extension, "")
|
87
|
+
destination = base.tilt_template(file_source, file_destination, config, &@block)
|
88
|
+
else
|
89
|
+
destination = base.copy_file(file_source, file_destination, config, &@block)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
56
93
|
|
57
|
-
add :build, ::Middleman::Builder
|
58
94
|
end
|
59
|
-
end
|
95
|
+
end
|
data/lib/middleman/features.rb
CHANGED
@@ -10,6 +10,7 @@ module Middleman::Features
|
|
10
10
|
autoload :Slickmap, "middleman/features/slickmap"
|
11
11
|
autoload :SmushPNGs, "middleman/features/smush_pngs"
|
12
12
|
autoload :CodeRay, "middleman/features/code_ray"
|
13
|
+
autoload :Lorem, "middleman/features/lorem"
|
13
14
|
# autoload :LiveReload, "middleman/features/live_reload"
|
14
15
|
|
15
16
|
class << self
|
@@ -33,4 +34,4 @@ module Middleman::Features
|
|
33
34
|
super(feature_name)
|
34
35
|
end
|
35
36
|
end
|
36
|
-
end
|
37
|
+
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
module Middleman::Features::Lorem
|
2
|
+
class << self
|
3
|
+
def registered(app)
|
4
|
+
app.helpers Middleman::Features::Lorem::Helpers
|
5
|
+
end
|
6
|
+
alias :included :registered
|
7
|
+
end
|
8
|
+
|
9
|
+
module Helpers
|
10
|
+
def lorem
|
11
|
+
@@lorem ||= Middleman::Features::Lorem::LoremObject.new
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
# Adapted from Frank:
|
16
|
+
# https://github.com/blahed/frank/
|
17
|
+
class LoremObject
|
18
|
+
WORDS = %w(alias consequatur aut perferendis sit voluptatem accusantium doloremque aperiam eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo aspernatur aut odit aut fugit sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt neque dolorem ipsum quia dolor sit amet consectetur adipisci velit sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem ut enim ad minima veniam quis nostrum exercitationem ullam corporis nemo enim ipsam voluptatem quia voluptas sit suscipit laboriosam nisi ut aliquid ex ea commodi consequatur quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae et iusto odio dignissimos ducimus qui blanditiis praesentium laudantium totam rem voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident sed ut perspiciatis unde omnis iste natus error similique sunt in culpa qui officia deserunt mollitia animi id est laborum et dolorum fuga et harum quidem rerum facilis est et expedita distinctio nam libero tempore cum soluta nobis est eligendi optio cumque nihil impedit quo porro quisquam est qui minus id quod maxime placeat facere possimus omnis voluptas assumenda est omnis dolor repellendus temporibus autem quibusdam et aut consequatur vel illum qui dolorem eum fugiat quo voluptas nulla pariatur at vero eos et accusamus officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae itaque earum rerum hic tenetur a sapiente delectus ut aut reiciendis voluptatibus maiores doloribus asperiores repellat)
|
19
|
+
|
20
|
+
def word
|
21
|
+
words(1)
|
22
|
+
end
|
23
|
+
|
24
|
+
def words(total)
|
25
|
+
(1..total).map do
|
26
|
+
randm(WORDS)
|
27
|
+
end.join(' ')
|
28
|
+
end
|
29
|
+
|
30
|
+
def sentence
|
31
|
+
sentences(1)
|
32
|
+
end
|
33
|
+
|
34
|
+
def sentences(total)
|
35
|
+
(1..total).map do
|
36
|
+
words(randm(4..15)).capitalize
|
37
|
+
end.join('. ')
|
38
|
+
end
|
39
|
+
|
40
|
+
def paragraph
|
41
|
+
paragraphs(1)
|
42
|
+
end
|
43
|
+
|
44
|
+
def paragraphs(total)
|
45
|
+
(1..total).map do
|
46
|
+
sentences(randm(3..7)).capitalize
|
47
|
+
end.join("\n\n")
|
48
|
+
end
|
49
|
+
|
50
|
+
def date(fmt = '%a %b %d, %Y')
|
51
|
+
y = rand(20) + 1990
|
52
|
+
m = rand(12) + 1
|
53
|
+
d = rand(31) + 1
|
54
|
+
Time.local(y,m,d).strftime(fmt)
|
55
|
+
end
|
56
|
+
|
57
|
+
def name
|
58
|
+
"#{first_name} #{last_name}"
|
59
|
+
end
|
60
|
+
|
61
|
+
def first_name
|
62
|
+
names = "Judith Angelo Margarita Kerry Elaine Lorenzo Justice Doris Raul Liliana Kerry Elise Ciaran Johnny Moses Davion Penny Mohammed Harvey Sheryl Hudson Brendan Brooklynn Denis Sadie Trisha Jacquelyn Virgil Cindy Alexa Marianne Giselle Casey Alondra Angela Katherine Skyler Kyleigh Carly Abel Adrianna Luis Dominick Eoin Noel Ciara Roberto Skylar Brock Earl Dwayne Jackie Hamish Sienna Nolan Daren Jean Shirley Connor Geraldine Niall Kristi Monty Yvonne Tammie Zachariah Fatima Ruby Nadia Anahi Calum Peggy Alfredo Marybeth Bonnie Gordon Cara John Staci Samuel Carmen Rylee Yehudi Colm Beth Dulce Darius inley Javon Jason Perla Wayne Laila Kaleigh Maggie Don Quinn Collin Aniya Zoe Isabel Clint Leland Esmeralda Emma Madeline Byron Courtney Vanessa Terry Antoinette George Constance Preston Rolando Caleb Kenneth Lynette Carley Francesca Johnnie Jordyn Arturo Camila Skye Guy Ana Kaylin Nia Colton Bart Brendon Alvin Daryl Dirk Mya Pete Joann Uriel Alonzo Agnes Chris Alyson Paola Dora Elias Allen Jackie Eric Bonita Kelvin Emiliano Ashton Kyra Kailey Sonja Alberto Ty Summer Brayden Lori Kelly Tomas Joey Billie Katie Stephanie Danielle Alexis Jamal Kieran Lucinda Eliza Allyson Melinda Alma Piper Deana Harriet Bryce Eli Jadyn Rogelio Orlaith Janet Randal Toby Carla Lorie Caitlyn Annika Isabelle inn Ewan Maisie Michelle Grady Ida Reid Emely Tricia Beau Reese Vance Dalton Lexi Rafael Makenzie Mitzi Clinton Xena Angelina Kendrick Leslie Teddy Jerald Noelle Neil Marsha Gayle Omar Abigail Alexandra Phil Andre Billy Brenden Bianca Jared Gretchen Patrick Antonio Josephine Kyla Manuel Freya Kellie Tonia Jamie Sydney Andres Ruben Harrison Hector Clyde Wendell Kaden Ian Tracy Cathleen Shawn".split(" ")
|
63
|
+
names[rand(names.size)]
|
64
|
+
end
|
65
|
+
|
66
|
+
def last_name
|
67
|
+
names = "Chung Chen Melton Hill Puckett Song Hamilton Bender Wagner McLaughlin McNamara Raynor Moon Woodard Desai Wallace Lawrence Griffin Dougherty Powers May Steele Teague Vick Gallagher Solomon Walsh Monroe Connolly Hawkins Middleton Goldstein Watts Johnston Weeks Wilkerson Barton Walton Hall Ross Chung Bender Woods Mangum Joseph Rosenthal Bowden Barton Underwood Jones Baker Merritt Cross Cooper Holmes Sharpe Morgan Hoyle Allen Rich Rich Grant Proctor Diaz Graham Watkins Hinton Marsh Hewitt Branch Walton O'Brien Case Watts Christensen Parks Hardin Lucas Eason Davidson Whitehead Rose Sparks Moore Pearson Rodgers Graves Scarborough Sutton Sinclair Bowman Olsen Love McLean Christian Lamb James Chandler Stout Cowan Golden Bowling Beasley Clapp Abrams Tilley Morse Boykin Sumner Cassidy Davidson Heath Blanchard McAllister McKenzie Byrne Schroeder Griffin Gross Perkins Robertson Palmer Brady Rowe Zhang Hodge Li Bowling Justice Glass Willis Hester Floyd Graves Fischer Norman Chan Hunt Byrd Lane Kaplan Heller May Jennings Hanna Locklear Holloway Jones Glover Vick O'Donnell Goldman McKenna Starr Stone McClure Watson Monroe Abbott Singer Hall Farrell Lucas Norman Atkins Monroe Robertson Sykes Reid Chandler Finch Hobbs Adkins Kinney Whitaker Alexander Conner Waters Becker Rollins Love Adkins Black Fox Hatcher Wu Lloyd Joyce Welch Matthews Chappell MacDonald Kane Butler Pickett Bowman Barton Kennedy Branch Thornton McNeill Weinstein Middleton Moss Lucas Rich Carlton Brady Schultz Nichols Harvey Stevenson Houston Dunn West O'Brien Barr Snyder Cain Heath Boswell Olsen Pittman Weiner Petersen Davis Coleman Terrell Norman Burch Weiner Parrott Henry Gray Chang McLean Eason Weeks Siegel Puckett Heath Hoyle Garrett Neal Baker Goldman Shaffer Choi Carver".split(" ")
|
68
|
+
names[rand(names.size)]
|
69
|
+
end
|
70
|
+
|
71
|
+
def email
|
72
|
+
delimiters = [ '_', '-', '' ]
|
73
|
+
domains = %w(gmail.com yahoo.com hotmail.com email.com live.com me.com mac.com aol.com fastmail.com mail.com)
|
74
|
+
username = name.gsub(/[^\w]/, delimiters[rand(delimiters.size)])
|
75
|
+
"#{username}@#{domains[rand(domains.size)]}".downcase
|
76
|
+
end
|
77
|
+
|
78
|
+
def image(size, options={})
|
79
|
+
src = "http://placehold.it/#{size}"
|
80
|
+
hex = %w[a b c d e f 0 1 2 3 4 5 6 7 8 9]
|
81
|
+
background_color = options[:background_color]
|
82
|
+
color = options[:color]
|
83
|
+
|
84
|
+
if options[:random_color]
|
85
|
+
background_color = hex.shuffle[0...6].join
|
86
|
+
color = hex.shuffle[0...6].join
|
87
|
+
end
|
88
|
+
|
89
|
+
src << "/#{background_color.sub(/^#/, '')}" if background_color
|
90
|
+
src << "/ccc" if background_color.nil? && color
|
91
|
+
src << "/#{color.sub(/^#/, '')}" if color
|
92
|
+
src << "&text=#{Rack::Utils::escape(options[:text])}" if options[:text]
|
93
|
+
|
94
|
+
src
|
95
|
+
end
|
96
|
+
|
97
|
+
private
|
98
|
+
|
99
|
+
def randm(range)
|
100
|
+
a = range.to_a
|
101
|
+
a[rand(a.length)]
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
data/lib/middleman/server.rb
CHANGED
data/lib/middleman/version.rb
CHANGED
data/middleman.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.add_runtime_dependency("rack", ["~> 1.0"])
|
22
22
|
s.add_runtime_dependency("thin", ["~> 1.2.0"])
|
23
23
|
s.add_runtime_dependency("shotgun", ["~> 0.8.0"])
|
24
|
-
s.add_runtime_dependency("
|
24
|
+
s.add_runtime_dependency("thor", ["~> 0.14.0"])
|
25
25
|
s.add_runtime_dependency("tilt", ["~> 1.1"])
|
26
26
|
s.add_runtime_dependency("sinatra", ["~> 1.0"])
|
27
27
|
s.add_runtime_dependency("padrino-core", ["~> 0.9.0"])
|
@@ -29,8 +29,9 @@ Gem::Specification.new do |s|
|
|
29
29
|
s.add_runtime_dependency("rack-test", ["~> 0.5.0"])
|
30
30
|
s.add_runtime_dependency("yui-compressor", ["~> 0.9.0"])
|
31
31
|
s.add_runtime_dependency("haml", ["~> 3.0"])
|
32
|
-
s.add_runtime_dependency("sass", ["3.1.0.alpha.
|
33
|
-
s.add_runtime_dependency("compass", ["0.11.
|
32
|
+
s.add_runtime_dependency("sass", ["3.1.0.alpha.218"])
|
33
|
+
s.add_runtime_dependency("compass", ["0.11.beta.1"])
|
34
|
+
s.add_runtime_dependency("oily_png")
|
34
35
|
s.add_runtime_dependency("json_pure", ["~> 1.4.0"])
|
35
36
|
s.add_runtime_dependency("smusher", ["~> 0.4.5"])
|
36
37
|
s.add_runtime_dependency("compass-slickmap", ["~> 0.4.0"])
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 62196369
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
9
|
- 0
|
10
10
|
- beta
|
11
|
-
-
|
12
|
-
version: 1.1.0.beta.
|
11
|
+
- 1
|
12
|
+
version: 1.1.0.beta.1
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Thomas Reynolds
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2011-01-
|
20
|
+
date: 2011-01-30 00:00:00 -08:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
@@ -68,19 +68,19 @@ dependencies:
|
|
68
68
|
type: :runtime
|
69
69
|
version_requirements: *id003
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
|
-
name:
|
71
|
+
name: thor
|
72
72
|
prerelease: false
|
73
73
|
requirement: &id004 !ruby/object:Gem::Requirement
|
74
74
|
none: false
|
75
75
|
requirements:
|
76
76
|
- - ~>
|
77
77
|
- !ruby/object:Gem::Version
|
78
|
-
hash:
|
78
|
+
hash: 39
|
79
79
|
segments:
|
80
|
-
- 1
|
81
80
|
- 0
|
81
|
+
- 14
|
82
82
|
- 0
|
83
|
-
version:
|
83
|
+
version: 0.14.0
|
84
84
|
type: :runtime
|
85
85
|
version_requirements: *id004
|
86
86
|
- !ruby/object:Gem::Dependency
|
@@ -200,14 +200,14 @@ dependencies:
|
|
200
200
|
requirements:
|
201
201
|
- - "="
|
202
202
|
- !ruby/object:Gem::Version
|
203
|
-
hash: -
|
203
|
+
hash: -3702664552
|
204
204
|
segments:
|
205
205
|
- 3
|
206
206
|
- 1
|
207
207
|
- 0
|
208
208
|
- alpha
|
209
|
-
-
|
210
|
-
version: 3.1.0.alpha.
|
209
|
+
- 218
|
210
|
+
version: 3.1.0.alpha.218
|
211
211
|
type: :runtime
|
212
212
|
version_requirements: *id012
|
213
213
|
- !ruby/object:Gem::Dependency
|
@@ -218,20 +218,33 @@ dependencies:
|
|
218
218
|
requirements:
|
219
219
|
- - "="
|
220
220
|
- !ruby/object:Gem::Version
|
221
|
-
hash:
|
221
|
+
hash: 62196233
|
222
222
|
segments:
|
223
223
|
- 0
|
224
224
|
- 11
|
225
|
-
- 0
|
226
225
|
- beta
|
227
|
-
-
|
228
|
-
version: 0.11.
|
226
|
+
- 1
|
227
|
+
version: 0.11.beta.1
|
229
228
|
type: :runtime
|
230
229
|
version_requirements: *id013
|
231
230
|
- !ruby/object:Gem::Dependency
|
232
|
-
name:
|
231
|
+
name: oily_png
|
233
232
|
prerelease: false
|
234
233
|
requirement: &id014 !ruby/object:Gem::Requirement
|
234
|
+
none: false
|
235
|
+
requirements:
|
236
|
+
- - ">="
|
237
|
+
- !ruby/object:Gem::Version
|
238
|
+
hash: 3
|
239
|
+
segments:
|
240
|
+
- 0
|
241
|
+
version: "0"
|
242
|
+
type: :runtime
|
243
|
+
version_requirements: *id014
|
244
|
+
- !ruby/object:Gem::Dependency
|
245
|
+
name: json_pure
|
246
|
+
prerelease: false
|
247
|
+
requirement: &id015 !ruby/object:Gem::Requirement
|
235
248
|
none: false
|
236
249
|
requirements:
|
237
250
|
- - ~>
|
@@ -243,11 +256,11 @@ dependencies:
|
|
243
256
|
- 0
|
244
257
|
version: 1.4.0
|
245
258
|
type: :runtime
|
246
|
-
version_requirements: *
|
259
|
+
version_requirements: *id015
|
247
260
|
- !ruby/object:Gem::Dependency
|
248
261
|
name: smusher
|
249
262
|
prerelease: false
|
250
|
-
requirement: &
|
263
|
+
requirement: &id016 !ruby/object:Gem::Requirement
|
251
264
|
none: false
|
252
265
|
requirements:
|
253
266
|
- - ~>
|
@@ -259,11 +272,11 @@ dependencies:
|
|
259
272
|
- 5
|
260
273
|
version: 0.4.5
|
261
274
|
type: :runtime
|
262
|
-
version_requirements: *
|
275
|
+
version_requirements: *id016
|
263
276
|
- !ruby/object:Gem::Dependency
|
264
277
|
name: compass-slickmap
|
265
278
|
prerelease: false
|
266
|
-
requirement: &
|
279
|
+
requirement: &id017 !ruby/object:Gem::Requirement
|
267
280
|
none: false
|
268
281
|
requirements:
|
269
282
|
- - ~>
|
@@ -275,11 +288,11 @@ dependencies:
|
|
275
288
|
- 0
|
276
289
|
version: 0.4.0
|
277
290
|
type: :runtime
|
278
|
-
version_requirements: *
|
291
|
+
version_requirements: *id017
|
279
292
|
- !ruby/object:Gem::Dependency
|
280
293
|
name: coffee-script
|
281
294
|
prerelease: false
|
282
|
-
requirement: &
|
295
|
+
requirement: &id018 !ruby/object:Gem::Requirement
|
283
296
|
none: false
|
284
297
|
requirements:
|
285
298
|
- - ~>
|
@@ -291,11 +304,11 @@ dependencies:
|
|
291
304
|
- 0
|
292
305
|
version: 2.1.0
|
293
306
|
type: :runtime
|
294
|
-
version_requirements: *
|
307
|
+
version_requirements: *id018
|
295
308
|
- !ruby/object:Gem::Dependency
|
296
309
|
name: less
|
297
310
|
prerelease: false
|
298
|
-
requirement: &
|
311
|
+
requirement: &id019 !ruby/object:Gem::Requirement
|
299
312
|
none: false
|
300
313
|
requirements:
|
301
314
|
- - ~>
|
@@ -307,11 +320,11 @@ dependencies:
|
|
307
320
|
- 0
|
308
321
|
version: 1.2.0
|
309
322
|
type: :runtime
|
310
|
-
version_requirements: *
|
323
|
+
version_requirements: *id019
|
311
324
|
- !ruby/object:Gem::Dependency
|
312
325
|
name: cucumber
|
313
326
|
prerelease: false
|
314
|
-
requirement: &
|
327
|
+
requirement: &id020 !ruby/object:Gem::Requirement
|
315
328
|
none: false
|
316
329
|
requirements:
|
317
330
|
- - ">="
|
@@ -321,11 +334,11 @@ dependencies:
|
|
321
334
|
- 0
|
322
335
|
version: "0"
|
323
336
|
type: :development
|
324
|
-
version_requirements: *
|
337
|
+
version_requirements: *id020
|
325
338
|
- !ruby/object:Gem::Dependency
|
326
339
|
name: rspec
|
327
340
|
prerelease: false
|
328
|
-
requirement: &
|
341
|
+
requirement: &id021 !ruby/object:Gem::Requirement
|
329
342
|
none: false
|
330
343
|
requirements:
|
331
344
|
- - ">="
|
@@ -335,7 +348,7 @@ dependencies:
|
|
335
348
|
- 0
|
336
349
|
version: "0"
|
337
350
|
type: :development
|
338
|
-
version_requirements: *
|
351
|
+
version_requirements: *id021
|
339
352
|
description:
|
340
353
|
email:
|
341
354
|
- tdreyno@gmail.com
|
@@ -417,6 +430,7 @@ files:
|
|
417
430
|
- lib/middleman/features/code_ray.rb
|
418
431
|
- lib/middleman/features/default_helpers.rb
|
419
432
|
- lib/middleman/features/live_reload.rb
|
433
|
+
- lib/middleman/features/lorem.rb
|
420
434
|
- lib/middleman/features/minify_css.rb
|
421
435
|
- lib/middleman/features/minify_javascript.rb
|
422
436
|
- lib/middleman/features/minify_javascript/rack.rb
|
@@ -432,7 +446,6 @@ files:
|
|
432
446
|
- lib/middleman/template/views/index.html.haml
|
433
447
|
- lib/middleman/template/views/layout.haml
|
434
448
|
- lib/middleman/template/views/stylesheets/site.css.sass
|
435
|
-
- lib/middleman/templater+dynamic_renderer.rb
|
436
449
|
- lib/middleman/version.rb
|
437
450
|
- middleman.gemspec
|
438
451
|
has_rdoc: true
|
@@ -471,5 +484,52 @@ rubygems_version: 1.4.2
|
|
471
484
|
signing_key:
|
472
485
|
specification_version: 3
|
473
486
|
summary: A static site generator utilizing Haml, Sass and providing YUI compression and cache busting
|
474
|
-
test_files:
|
475
|
-
|
487
|
+
test_files:
|
488
|
+
- features/builder.feature
|
489
|
+
- features/coffee-script.feature
|
490
|
+
- features/generator.feature
|
491
|
+
- features/helpers_auto_stylesheet_link_tag.feature
|
492
|
+
- features/helpers_page_classes.feature
|
493
|
+
- features/less-css.feature
|
494
|
+
- features/minify_css.feature
|
495
|
+
- features/minify_javascript.feature
|
496
|
+
- features/padrino_helpers.feature
|
497
|
+
- features/page_alias_and_layouts.feature
|
498
|
+
- features/scss-support.feature
|
499
|
+
- features/step_definitions/asset_host_steps.rb
|
500
|
+
- features/step_definitions/builder_steps.rb
|
501
|
+
- features/step_definitions/env.rb
|
502
|
+
- features/step_definitions/generator_steps.rb
|
503
|
+
- features/step_definitions/middleman_steps.rb
|
504
|
+
- features/step_definitions/page_layout_steps.rb
|
505
|
+
- features/w_asset_host.feature
|
506
|
+
- features/x_automatic_image_sizes.feature
|
507
|
+
- features/y_cache_buster.feature
|
508
|
+
- features/z_relative_assets.feature
|
509
|
+
- fixtures/test-app/config.rb
|
510
|
+
- fixtures/test-app/public/images/blank.gif
|
511
|
+
- fixtures/test-app/public/static.html
|
512
|
+
- fixtures/test-app/public/stylesheets/auto-css.css
|
513
|
+
- fixtures/test-app/public/stylesheets/static.css
|
514
|
+
- fixtures/test-app/public/stylesheets/sub1/auto-css.css
|
515
|
+
- fixtures/test-app/public/stylesheets/sub1/sub2/auto-css.css
|
516
|
+
- fixtures/test-app/views/_partial.haml
|
517
|
+
- fixtures/test-app/views/asset_host.html.haml
|
518
|
+
- fixtures/test-app/views/auto-css.html.haml
|
519
|
+
- fixtures/test-app/views/auto-image-sizes.html.haml
|
520
|
+
- fixtures/test-app/views/cache-buster.html.haml
|
521
|
+
- fixtures/test-app/views/custom-layout.html.haml
|
522
|
+
- fixtures/test-app/views/index.html.haml
|
523
|
+
- fixtures/test-app/views/inline-css.html.haml
|
524
|
+
- fixtures/test-app/views/inline-js.html.haml
|
525
|
+
- fixtures/test-app/views/javascripts/coffee_test.js.coffee
|
526
|
+
- fixtures/test-app/views/layout.haml
|
527
|
+
- fixtures/test-app/views/layouts/custom.haml
|
528
|
+
- fixtures/test-app/views/padrino_test.html.haml
|
529
|
+
- fixtures/test-app/views/page-classes.html.haml
|
530
|
+
- fixtures/test-app/views/services/index.html.haml
|
531
|
+
- fixtures/test-app/views/stylesheets/asset_host.css.sass
|
532
|
+
- fixtures/test-app/views/stylesheets/relative_assets.css.sass
|
533
|
+
- fixtures/test-app/views/stylesheets/site.css.sass
|
534
|
+
- fixtures/test-app/views/stylesheets/site_scss.css.scss
|
535
|
+
- fixtures/test-app/views/stylesheets/test_less.css.less
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'rack/test' # Use Rack::Test to access Sinatra without starting up a full server
|
2
|
-
|
3
|
-
# Monkey-patch to use a dynamic renderer
|
4
|
-
class Templater::Actions::File
|
5
|
-
def identical?
|
6
|
-
if exists?
|
7
|
-
return true if File.mtime(source) < File.mtime(destination)
|
8
|
-
FileUtils.identical?(source, destination)
|
9
|
-
else
|
10
|
-
false
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
class Templater::Actions::Template
|
16
|
-
def render
|
17
|
-
@@rack_test ||= Rack::Test::Session.new(Rack::MockSession.new(Middleman::Server))
|
18
|
-
|
19
|
-
@render_cache ||= begin
|
20
|
-
# The default render just requests the page over Rack and writes the response
|
21
|
-
request_path = destination.gsub(File.join(Dir.pwd, Middleman::Server.build_dir), "")
|
22
|
-
@@rack_test.get(request_path)
|
23
|
-
@@rack_test.last_response.body
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|