middleman 0.9.18 → 0.9.20
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/middleman/base.rb +7 -0
- data/lib/middleman/features/cache_buster.rb +7 -2
- data/lib/middleman/features/compass.rb +1 -9
- data/lib/middleman/features/minify_css.rb +8 -1
- data/lib/middleman/features/relative_assets.rb +5 -0
- data/lib/middleman/helpers.rb +2 -1
- data/middleman.gemspec +1 -1
- data/spec/builder_spec.rb +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.20
|
data/lib/middleman/base.rb
CHANGED
@@ -93,6 +93,8 @@ class Middleman::Base
|
|
93
93
|
use Middleman::Rack::Sprockets
|
94
94
|
|
95
95
|
enable :compass
|
96
|
+
require "middleman/features/compass"
|
97
|
+
@@features -= [:compass]
|
96
98
|
|
97
99
|
# Features disabled by default
|
98
100
|
disable :slickmap
|
@@ -125,6 +127,11 @@ class Middleman::Base
|
|
125
127
|
require "middleman/features/#{feature_name}"
|
126
128
|
end
|
127
129
|
|
130
|
+
::Compass.configuration do |config|
|
131
|
+
config.http_images_path = self.http_images_path rescue File.join(self.http_prefix, self.images_dir)
|
132
|
+
config.http_stylesheets_path = self.http_css_path rescue File.join(self.http_prefix, self.css_dir)
|
133
|
+
end
|
134
|
+
|
128
135
|
super
|
129
136
|
end
|
130
137
|
end
|
@@ -5,8 +5,13 @@ class << Middleman::Base
|
|
5
5
|
if http_path.include?("://") || !%w(.css .png .jpg .js .gif).include?(File.extname(http_path))
|
6
6
|
http_path
|
7
7
|
else
|
8
|
-
|
9
|
-
|
8
|
+
begin
|
9
|
+
prefix = self.images_dir if prefix == self.http_images_path
|
10
|
+
rescue
|
11
|
+
end
|
12
|
+
|
13
|
+
real_path = File.join(self.environment == "build" ? self.build_dir : self.public, prefix, path)
|
14
|
+
http_path << "?" + File.mtime(real_path).strftime("%s") if File.readable?(real_path)
|
10
15
|
http_path
|
11
16
|
end
|
12
17
|
end
|
@@ -5,19 +5,11 @@ class Middleman::Base
|
|
5
5
|
|
6
6
|
config.project_path = Dir.pwd
|
7
7
|
config.sass_dir = File.join(File.basename(self.views), self.css_dir)
|
8
|
-
config.output_style =
|
8
|
+
config.output_style = :nested
|
9
9
|
config.css_dir = File.join(File.basename(images_location), self.css_dir)
|
10
10
|
config.images_dir = File.join(File.basename(images_location), self.images_dir)
|
11
11
|
# File.expand_path(self.images_dir, self.public)
|
12
12
|
|
13
|
-
if !cache_buster?
|
14
|
-
config.asset_cache_buster do
|
15
|
-
false
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
config.http_images_path = File.join(self.http_prefix, self.images_dir)
|
20
|
-
config.http_stylesheets_path = File.join(self.http_prefix, self.css_dir)
|
21
13
|
config.add_import_path(config.sass_dir)
|
22
14
|
end
|
23
15
|
|
@@ -5,6 +5,11 @@ end
|
|
5
5
|
class << Middleman::Base
|
6
6
|
alias_method :pre_relative_asset_url, :asset_url
|
7
7
|
def asset_url(path, prefix="", request=nil)
|
8
|
+
begin
|
9
|
+
prefix = self.images_dir if prefix == self.http_images_path
|
10
|
+
rescue
|
11
|
+
end
|
12
|
+
|
8
13
|
path = pre_relative_asset_url(path, prefix, request)
|
9
14
|
if path.include?("://")
|
10
15
|
path
|
data/lib/middleman/helpers.rb
CHANGED
@@ -33,7 +33,8 @@ module Middleman
|
|
33
33
|
|
34
34
|
def image_tag(path, params={})
|
35
35
|
params[:alt] ||= ""
|
36
|
-
|
36
|
+
prefix = options.http_images_path rescue options.images_dir
|
37
|
+
params = params.merge(:src => asset_url(path, prefix))
|
37
38
|
params = params.map { |k,v| %Q{#{k}="#{v}"}}.join(' ')
|
38
39
|
"<img #{params} />"
|
39
40
|
end
|
data/middleman.gemspec
CHANGED
data/spec/builder_spec.rb
CHANGED
@@ -23,7 +23,7 @@ describe "Builder" do
|
|
23
23
|
File.read("#{@root_dir}/build/index.html").should include("<h1>Welcome</h1>")
|
24
24
|
end
|
25
25
|
|
26
|
-
|
26
|
+
xit "should build maruku files" do
|
27
27
|
File.exists?("#{@root_dir}/build/maruku.html").should be_true
|
28
28
|
File.read("#{@root_dir}/build/maruku.html").should include("<h1 class='header' id='hello_maruku'>Hello Maruku</h1>")
|
29
29
|
end
|