middleman 2.0.0.beta4 → 2.0.0.beta5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +14 -2
- data/features/step_definitions/builder_steps.rb +1 -1
- data/features/support/env.rb +53 -0
- data/lib/middleman/builder.rb +19 -1
- data/lib/middleman/features.rb +1 -1
- data/lib/middleman/renderers/sass.rb +9 -7
- data/lib/middleman/version.rb +1 -1
- data/middleman.gemspec +2 -1
- metadata +24 -13
- data/features/step_definitions/env.rb +0 -9
data/Rakefile
CHANGED
@@ -4,7 +4,19 @@ Bundler::GemHelper.install_tasks
|
|
4
4
|
require 'cucumber/rake/task'
|
5
5
|
|
6
6
|
Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t|
|
7
|
-
t.cucumber_opts = "--color --tags ~@wip --strict --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'}"
|
7
|
+
t.cucumber_opts = "--drb --color --tags ~@wip --strict --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'}"
|
8
|
+
end
|
9
|
+
|
10
|
+
namespace :spork do
|
11
|
+
desc "start spork in background"
|
12
|
+
task :start do
|
13
|
+
sh %{spork &}
|
14
|
+
end
|
15
|
+
|
16
|
+
desc "stop spork"
|
17
|
+
task :stop do
|
18
|
+
Process.kill(:TERM, `ps -ef | grep spork | grep -v grep | awk '{ print $2 }'`.to_i)
|
19
|
+
end
|
8
20
|
end
|
9
21
|
|
10
22
|
#$LOAD_PATH.unshift 'lib'
|
@@ -12,7 +24,7 @@ end
|
|
12
24
|
require 'rake/testtask'
|
13
25
|
require 'rake/clean'
|
14
26
|
|
15
|
-
task :test => :cucumber
|
27
|
+
task :test => ["spork:start", "cucumber", "spork:stop"]
|
16
28
|
|
17
29
|
# rocco depends on rdiscount, which makes me sad.
|
18
30
|
unless defined?(JRUBY_VERSION)
|
@@ -14,7 +14,7 @@ end
|
|
14
14
|
|
15
15
|
Given /^cleanup built test app$/ do
|
16
16
|
target = File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "fixtures", "test-app", "build")
|
17
|
-
FileUtils.rm_rf(target)
|
17
|
+
# FileUtils.rm_rf(target)
|
18
18
|
end
|
19
19
|
|
20
20
|
Then /^"([^"]*)" should exist and include "([^"]*)"$/ do |target_file, expected|
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'spork'
|
3
|
+
|
4
|
+
root_path = File.dirname(File.dirname(File.dirname(__FILE__)))
|
5
|
+
|
6
|
+
Spork.prefork do
|
7
|
+
# Loading more in this block will cause your tests to run faster. However,
|
8
|
+
# if you change any configuration or code from libraries loaded here, you'll
|
9
|
+
# need to restart spork for it take effect.
|
10
|
+
|
11
|
+
ENV["MM_DIR"] = File.join(root_path, "fixtures", "test-app")
|
12
|
+
end
|
13
|
+
|
14
|
+
Spork.each_run do
|
15
|
+
# This code will be run each time you run your specs.
|
16
|
+
require File.join(root_path, 'lib', 'middleman')
|
17
|
+
require "rack/test"
|
18
|
+
|
19
|
+
# absolute views path
|
20
|
+
# otherwise resolve_template (padrino-core) can't find templates
|
21
|
+
Before do
|
22
|
+
Middleman::Server.views = File.join(Middleman::Server.root, "source")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# --- Instructions ---
|
27
|
+
# Sort the contents of this file into a Spork.prefork and a Spork.each_run
|
28
|
+
# block.
|
29
|
+
#
|
30
|
+
# The Spork.prefork block is run only once when the spork server is started.
|
31
|
+
# You typically want to place most of your (slow) initializer code in here, in
|
32
|
+
# particular, require'ing any 3rd-party gems that you don't normally modify
|
33
|
+
# during development.
|
34
|
+
#
|
35
|
+
# The Spork.each_run block is run each time you run your specs. In case you
|
36
|
+
# need to load files that tend to change during development, require them here.
|
37
|
+
# With Rails, your application modules are loaded automatically, so sometimes
|
38
|
+
# this block can remain empty.
|
39
|
+
#
|
40
|
+
# Note: You can modify files loaded *from* the Spork.each_run block without
|
41
|
+
# restarting the spork server. However, this file itself will not be reloaded,
|
42
|
+
# so if you change any of the code inside the each_run block, you still need to
|
43
|
+
# restart the server. In general, if you have non-trivial code in this file,
|
44
|
+
# it's advisable to move it into a separate file so you can easily edit it
|
45
|
+
# without restarting spork. (For example, with RSpec, you could move
|
46
|
+
# non-trivial code into a file spec/support/my_helper.rb, making sure that the
|
47
|
+
# spec/support/* files are require'd from inside the each_run block.)
|
48
|
+
#
|
49
|
+
# Any code that is left outside the two blocks will be run during preforking
|
50
|
+
# *and* during each_run -- that's probably not what you want.
|
51
|
+
#
|
52
|
+
# These instructions should self-destruct in 10 seconds. If they don't, feel
|
53
|
+
# free to delete them.
|
data/lib/middleman/builder.rb
CHANGED
@@ -84,7 +84,25 @@ module Middleman
|
|
84
84
|
def handle_directory(lookup)
|
85
85
|
lookup = File.join(lookup, '*')
|
86
86
|
|
87
|
-
Dir[lookup].sort
|
87
|
+
results = Dir[lookup].sort do |a, b|
|
88
|
+
simple_a = a.gsub(Middleman::Server.root + "/", '')
|
89
|
+
.gsub(Middleman::Server.views + "/", '')
|
90
|
+
simple_b = b.gsub(Middleman::Server.root + "/", '')
|
91
|
+
.gsub(Middleman::Server.views + "/", '')
|
92
|
+
|
93
|
+
a_dir = simple_a.split("/").first
|
94
|
+
b_dir = simple_b.split("/").first
|
95
|
+
|
96
|
+
if a_dir == Middleman::Server.images_dir
|
97
|
+
-1
|
98
|
+
elsif b_dir == Middleman::Server.images_dir
|
99
|
+
1
|
100
|
+
else
|
101
|
+
0
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
results.each do |file_source|
|
88
106
|
if File.directory?(file_source)
|
89
107
|
handle_directory(file_source)
|
90
108
|
next
|
data/lib/middleman/features.rb
CHANGED
@@ -78,7 +78,7 @@ module Middleman::Features
|
|
78
78
|
autoload :Blog, "middleman/features/blog"
|
79
79
|
|
80
80
|
# Proxy web services requests in dev mode only
|
81
|
-
|
81
|
+
autoload :Proxy, "middleman/features/proxy"
|
82
82
|
|
83
83
|
# Automatically resize images for mobile devises
|
84
84
|
# autoload :TinySrc, "middleman/features/tiny_src"
|
@@ -9,25 +9,27 @@ module Middleman
|
|
9
9
|
class << self
|
10
10
|
def registered(app)
|
11
11
|
app.after_feature_init do
|
12
|
+
views_root = File.basename(self.views)
|
12
13
|
::Compass.configuration do |config|
|
13
14
|
config.cache_path = File.join(self.root, ".sass-cache") # For sassc files
|
14
15
|
config.project_path = self.root
|
15
|
-
config.sass_dir = File.join(
|
16
|
+
config.sass_dir = File.join(views_root, self.css_dir)
|
16
17
|
config.output_style = :nested
|
17
|
-
config.fonts_dir = File.join(
|
18
|
-
config.css_dir = File.join(
|
19
|
-
config.images_dir = File.join(
|
18
|
+
config.fonts_dir = File.join(views_root, self.fonts_dir)
|
19
|
+
config.css_dir = File.join(views_root, self.css_dir)
|
20
|
+
config.images_dir = File.join(views_root, self.images_dir)
|
20
21
|
config.http_images_path = self.http_images_path rescue File.join(self.http_prefix || "/", self.images_dir)
|
21
22
|
config.http_stylesheets_path = self.http_css_path rescue File.join(self.http_prefix || "/", self.css_dir)
|
22
|
-
config.asset_cache_buster
|
23
|
+
config.asset_cache_buster :none
|
23
24
|
|
24
25
|
config.add_import_path(config.sass_dir)
|
25
26
|
end
|
26
27
|
|
27
28
|
configure :build do
|
29
|
+
build_root = File.basename(self.build_dir)
|
28
30
|
::Compass.configuration do |config|
|
29
|
-
config.css_dir
|
30
|
-
config.images_dir
|
31
|
+
config.css_dir = File.join(build_root, self.css_dir)
|
32
|
+
config.images_dir = File.join(build_root, self.images_dir)
|
31
33
|
end
|
32
34
|
end
|
33
35
|
end
|
data/lib/middleman/version.rb
CHANGED
data/middleman.gemspec
CHANGED
@@ -31,10 +31,11 @@ Gem::Specification.new do |s|
|
|
31
31
|
s.add_runtime_dependency("haml", ["~> 3.1.0"])
|
32
32
|
s.add_runtime_dependency("coffee-filter", ["~> 0.1.0"])
|
33
33
|
s.add_runtime_dependency("sass", ["~> 3.1.0"])
|
34
|
-
s.add_runtime_dependency("compass", ["0.11.
|
34
|
+
s.add_runtime_dependency("compass", ["~> 0.11.3"])
|
35
35
|
s.add_runtime_dependency("compass-susy-plugin", ["~> 0.9.0"])
|
36
36
|
s.add_runtime_dependency("coffee-script", ["~> 2.2.0"])
|
37
37
|
s.add_runtime_dependency("httparty", ["~> 0.7.0"])
|
38
|
+
s.add_development_dependency("spork", ["~> 0.9.0.rc8"])
|
38
39
|
s.add_development_dependency("cucumber", ["~> 0.10.0"])
|
39
40
|
s.add_development_dependency("rake", ["0.8.7"])
|
40
41
|
s.add_development_dependency("rspec", [">= 0"])
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: middleman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: 6
|
5
|
-
version: 2.0.0.
|
5
|
+
version: 2.0.0.beta5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Thomas Reynolds
|
@@ -162,9 +162,9 @@ dependencies:
|
|
162
162
|
requirement: &id014 !ruby/object:Gem::Requirement
|
163
163
|
none: false
|
164
164
|
requirements:
|
165
|
-
- -
|
165
|
+
- - ~>
|
166
166
|
- !ruby/object:Gem::Version
|
167
|
-
version: 0.11.
|
167
|
+
version: 0.11.3
|
168
168
|
type: :runtime
|
169
169
|
version_requirements: *id014
|
170
170
|
- !ruby/object:Gem::Dependency
|
@@ -201,49 +201,60 @@ dependencies:
|
|
201
201
|
type: :runtime
|
202
202
|
version_requirements: *id017
|
203
203
|
- !ruby/object:Gem::Dependency
|
204
|
-
name:
|
204
|
+
name: spork
|
205
205
|
prerelease: false
|
206
206
|
requirement: &id018 !ruby/object:Gem::Requirement
|
207
207
|
none: false
|
208
208
|
requirements:
|
209
209
|
- - ~>
|
210
210
|
- !ruby/object:Gem::Version
|
211
|
-
version: 0.
|
211
|
+
version: 0.9.0.rc8
|
212
212
|
type: :development
|
213
213
|
version_requirements: *id018
|
214
214
|
- !ruby/object:Gem::Dependency
|
215
|
-
name:
|
215
|
+
name: cucumber
|
216
216
|
prerelease: false
|
217
217
|
requirement: &id019 !ruby/object:Gem::Requirement
|
218
|
+
none: false
|
219
|
+
requirements:
|
220
|
+
- - ~>
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: 0.10.0
|
223
|
+
type: :development
|
224
|
+
version_requirements: *id019
|
225
|
+
- !ruby/object:Gem::Dependency
|
226
|
+
name: rake
|
227
|
+
prerelease: false
|
228
|
+
requirement: &id020 !ruby/object:Gem::Requirement
|
218
229
|
none: false
|
219
230
|
requirements:
|
220
231
|
- - "="
|
221
232
|
- !ruby/object:Gem::Version
|
222
233
|
version: 0.8.7
|
223
234
|
type: :development
|
224
|
-
version_requirements: *
|
235
|
+
version_requirements: *id020
|
225
236
|
- !ruby/object:Gem::Dependency
|
226
237
|
name: rspec
|
227
238
|
prerelease: false
|
228
|
-
requirement: &
|
239
|
+
requirement: &id021 !ruby/object:Gem::Requirement
|
229
240
|
none: false
|
230
241
|
requirements:
|
231
242
|
- - ">="
|
232
243
|
- !ruby/object:Gem::Version
|
233
244
|
version: "0"
|
234
245
|
type: :development
|
235
|
-
version_requirements: *
|
246
|
+
version_requirements: *id021
|
236
247
|
- !ruby/object:Gem::Dependency
|
237
248
|
name: rocco
|
238
249
|
prerelease: false
|
239
|
-
requirement: &
|
250
|
+
requirement: &id022 !ruby/object:Gem::Requirement
|
240
251
|
none: false
|
241
252
|
requirements:
|
242
253
|
- - ">="
|
243
254
|
- !ruby/object:Gem::Version
|
244
255
|
version: "0"
|
245
256
|
type: :development
|
246
|
-
version_requirements: *
|
257
|
+
version_requirements: *id022
|
247
258
|
description:
|
248
259
|
email:
|
249
260
|
- tdreyno@gmail.com
|
@@ -282,10 +293,10 @@ files:
|
|
282
293
|
- features/slim.feature
|
283
294
|
- features/step_definitions/asset_host_steps.rb
|
284
295
|
- features/step_definitions/builder_steps.rb
|
285
|
-
- features/step_definitions/env.rb
|
286
296
|
- features/step_definitions/generator_steps.rb
|
287
297
|
- features/step_definitions/middleman_steps.rb
|
288
298
|
- features/step_definitions/page_layout_steps.rb
|
299
|
+
- features/support/env.rb
|
289
300
|
- features/tiny_src.feature
|
290
301
|
- features/w_asset_host.feature
|
291
302
|
- features/x_automatic_image_sizes.feature
|
@@ -436,10 +447,10 @@ test_files:
|
|
436
447
|
- features/slim.feature
|
437
448
|
- features/step_definitions/asset_host_steps.rb
|
438
449
|
- features/step_definitions/builder_steps.rb
|
439
|
-
- features/step_definitions/env.rb
|
440
450
|
- features/step_definitions/generator_steps.rb
|
441
451
|
- features/step_definitions/middleman_steps.rb
|
442
452
|
- features/step_definitions/page_layout_steps.rb
|
453
|
+
- features/support/env.rb
|
443
454
|
- features/tiny_src.feature
|
444
455
|
- features/w_asset_host.feature
|
445
456
|
- features/x_automatic_image_sizes.feature
|
@@ -1,9 +0,0 @@
|
|
1
|
-
ENV["MM_DIR"] = File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "fixtures", "test-app")
|
2
|
-
require File.join(File.dirname(File.dirname(File.dirname(__FILE__))), 'lib', 'middleman')
|
3
|
-
require "rack/test"
|
4
|
-
|
5
|
-
# absolute views path
|
6
|
-
# otherwise resolve_template (padrino-core) can't find templates
|
7
|
-
Before do
|
8
|
-
Middleman::Server.views = File.join(Middleman::Server.root, "source")
|
9
|
-
end
|