middleman 0.10.0 → 0.10.1
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 +1 -1
- data/lib/middleman/features/cache_buster.rb +19 -0
- data/lib/middleman/sass.rb +11 -26
- data/middleman.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.10.
|
1
|
+
0.10.1
|
data/lib/middleman/base.rb
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
class Middleman::Base
|
2
|
+
include Middleman::Sass
|
3
|
+
|
4
|
+
after_feature_init do
|
5
|
+
::Compass.configuration do |config|
|
6
|
+
config.asset_cache_buster do |path, real_path|
|
7
|
+
# real_path = real_path.gsub(self.build_dir, self.public)
|
8
|
+
if File.readable?(real_path)
|
9
|
+
File.mtime(real_path).strftime("%s")
|
10
|
+
else
|
11
|
+
$stderr.puts "WARNING: '#{File.basename(path)}' was not found (or cannot be read) in #{File.dirname(real_path)}"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
::Compass.configure_sass_plugin!
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
1
20
|
class << Middleman::Base
|
2
21
|
alias_method :pre_cache_buster_asset_url, :asset_url
|
3
22
|
def asset_url(path, prefix="", request=nil)
|
data/lib/middleman/sass.rb
CHANGED
@@ -68,39 +68,24 @@ end
|
|
68
68
|
class Middleman::Base
|
69
69
|
include Middleman::Sass
|
70
70
|
|
71
|
-
|
71
|
+
after_feature_init do
|
72
72
|
::Compass.configuration do |config|
|
73
|
-
config.project_path
|
74
|
-
config.sass_dir
|
75
|
-
config.output_style
|
76
|
-
config.css_dir
|
77
|
-
config.images_dir
|
78
|
-
|
79
|
-
config.add_import_path(config.sass_dir)
|
80
|
-
|
73
|
+
config.project_path = self.root
|
74
|
+
config.sass_dir = File.join(File.basename(self.views), self.css_dir)
|
75
|
+
config.output_style = :nested
|
76
|
+
config.css_dir = File.join(File.basename(self.public), self.css_dir)
|
77
|
+
config.images_dir = File.join(File.basename(self.public), self.images_dir)
|
81
78
|
config.http_images_path = self.http_images_path rescue File.join(self.http_prefix, self.images_dir)
|
82
79
|
config.http_stylesheets_path = self.http_css_path rescue File.join(self.http_prefix, self.css_dir)
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
# real_path = real_path.gsub(self.build_dir, self.public)
|
87
|
-
if File.readable?(real_path)
|
88
|
-
File.mtime(real_path).strftime("%s")
|
89
|
-
else
|
90
|
-
$stderr.puts "WARNING: '#{File.basename(path)}' was not found (or cannot be read) in #{File.dirname(real_path)}"
|
91
|
-
end
|
92
|
-
end
|
93
|
-
else
|
94
|
-
config.asset_cache_buster do
|
95
|
-
false
|
96
|
-
end
|
97
|
-
end
|
80
|
+
config.asset_cache_buster { false }
|
81
|
+
|
82
|
+
config.add_import_path(config.sass_dir)
|
98
83
|
end
|
99
84
|
|
100
85
|
configure :build do
|
101
86
|
::Compass.configuration do |config|
|
102
|
-
config.css_dir
|
103
|
-
config.images_dir
|
87
|
+
config.css_dir = File.join(File.basename(self.build_dir), self.css_dir)
|
88
|
+
config.images_dir = File.join(File.basename(self.build_dir), self.images_dir)
|
104
89
|
end
|
105
90
|
end
|
106
91
|
|
data/middleman.gemspec
CHANGED