middleman 1.1.0.beta.3 → 1.1.0.beta.4
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/mm-server +4 -3
- data/lib/middleman/builder.rb +22 -24
- data/lib/middleman/features/minify_javascript.rb +3 -0
- data/lib/middleman/server.rb +2 -1
- data/lib/middleman/version.rb +1 -1
- metadata +4 -4
data/bin/mm-server
CHANGED
@@ -48,9 +48,10 @@ class Middleman::Server
|
|
48
48
|
set :root, Dir.pwd
|
49
49
|
end
|
50
50
|
|
51
|
-
require 'shotgun'
|
52
|
-
config = File.join(File.dirname(__FILE__), '..', 'lib', 'middleman', 'config.ru')
|
53
|
-
app = Shotgun.new(config, &lambda { |inner_app| Middleman::Server })
|
51
|
+
# require 'shotgun'
|
52
|
+
# config = File.join(File.dirname(__FILE__), '..', 'lib', 'middleman', 'config.ru')
|
53
|
+
# app = Shotgun.new(config, &lambda { |inner_app| Middleman::Server })
|
54
|
+
app = Middleman::Server.new
|
54
55
|
|
55
56
|
require 'rubygems'
|
56
57
|
require 'thin'
|
data/lib/middleman/builder.rb
CHANGED
@@ -29,7 +29,6 @@ module Middleman
|
|
29
29
|
|
30
30
|
def initialize(*args)
|
31
31
|
Middleman::Server.new
|
32
|
-
::Tilt.mappings.keys << "js"
|
33
32
|
super
|
34
33
|
end
|
35
34
|
|
@@ -41,11 +40,11 @@ module Middleman
|
|
41
40
|
end
|
42
41
|
|
43
42
|
def build_static_files
|
44
|
-
action Directory.new(self, Middleman::Server.public, Middleman::Server.build_dir)
|
43
|
+
action Directory.new(self, Middleman::Server.public, Middleman::Server.build_dir, { :force => true })
|
45
44
|
end
|
46
45
|
|
47
46
|
def build_dynamic_files
|
48
|
-
action Directory.new(self, Middleman::Server.views, Middleman::Server.build_dir)
|
47
|
+
action Directory.new(self, Middleman::Server.views, Middleman::Server.build_dir, { :force => true })
|
49
48
|
end
|
50
49
|
|
51
50
|
@@hooks = {}
|
@@ -78,30 +77,29 @@ module Middleman
|
|
78
77
|
execute!
|
79
78
|
end
|
80
79
|
|
81
|
-
|
80
|
+
protected
|
82
81
|
|
83
|
-
|
84
|
-
|
85
|
-
|
82
|
+
def execute!
|
83
|
+
lookup = config[:recursive] ? File.join(source, '**') : source
|
84
|
+
lookup = File.join(lookup, '{*,.[a-z]*}')
|
85
|
+
|
86
|
+
Dir[lookup].sort.each do |file_source|
|
87
|
+
next if File.directory?(file_source)
|
88
|
+
next if file_source.include?('layout')
|
89
|
+
next unless file_source.split('/').select { |p| p[0,1] == '_' }.empty?
|
86
90
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
file_destination
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
if handled_by_tilt
|
98
|
-
file_destination.gsub!(file_extension, "")
|
99
|
-
destination = base.tilt_template(file_source, file_destination, config, &@block)
|
100
|
-
else
|
101
|
-
destination = base.copy_file(file_source, file_destination, config, &@block)
|
102
|
-
end
|
91
|
+
file_extension = File.extname(file_source)
|
92
|
+
file_destination = File.join(given_destination, file_source.gsub(source, '.'))
|
93
|
+
file_destination.gsub!('/./', '/')
|
94
|
+
|
95
|
+
handled_by_tilt = ::Tilt.mappings.keys.include?(file_extension.gsub(/^\./, ""))
|
96
|
+
if handled_by_tilt || (file_extension == ".js")
|
97
|
+
file_destination.gsub!(file_extension, "") unless file_extension == ".js"
|
98
|
+
destination = base.tilt_template(file_source, file_destination, config, &@block)
|
99
|
+
else
|
100
|
+
destination = base.copy_file(file_source, file_destination, config, &@block)
|
103
101
|
end
|
104
102
|
end
|
105
|
-
|
103
|
+
end
|
106
104
|
end
|
107
105
|
end
|
@@ -1,6 +1,9 @@
|
|
1
1
|
module Middleman::Features::MinifyJavascript
|
2
2
|
class << self
|
3
3
|
def registered(app)
|
4
|
+
# Only do minification on build or prod mode
|
5
|
+
return unless [:build, :production].include? app.environment
|
6
|
+
|
4
7
|
Middleman::Features::MinifyJavascript::Haml::Javascript.send :include, ::Haml::Filters::Base
|
5
8
|
|
6
9
|
require "middleman/features/minify_javascript/rack"
|
data/lib/middleman/server.rb
CHANGED
@@ -161,7 +161,8 @@ class Middleman::Server
|
|
161
161
|
set :app_file, File.expand_path(local_config)
|
162
162
|
end
|
163
163
|
|
164
|
-
use ::Rack::ConditionalGet
|
164
|
+
use ::Rack::ConditionalGet
|
165
|
+
use ::Rack::Static, :urls => ["/#{self.images_dir}"], :root => "public"
|
165
166
|
|
166
167
|
@@run_after_features.each { |block| class_eval(&block) }
|
167
168
|
|
data/lib/middleman/version.rb
CHANGED
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: 62196379
|
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
|
+
- 4
|
12
|
+
version: 1.1.0.beta.4
|
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-02-
|
20
|
+
date: 2011-02-06 00:00:00 -08:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|