middleman-core 3.0.0.beta.3 → 3.0.0.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/middleman +32 -30
- data/features/clean_build.feature +0 -13
- data/features/extensionless_text_files.feature +2 -34
- data/features/front-matter.feature +27 -6
- data/features/frontmatter_page_settings.feature +6 -15
- data/features/ignore.feature +1 -78
- data/features/sitemap_traversal.feature +5 -5
- data/features/support/env.rb +3 -0
- data/features/wildcard_page_helper.feature +0 -9
- data/fixtures/frontmatter-app/source/front-matter-encoding.html.erb +7 -0
- data/fixtures/frontmatter-app/source/{front-matter.html.erb → front-matter-line-2.html.erb} +0 -1
- data/fixtures/frontmatter-app/source/json-front-matter-2.php.erb +2 -2
- data/fixtures/frontmatter-app/source/json-front-matter-auto.erb +2 -2
- data/fixtures/frontmatter-app/source/json-front-matter-encoding.html.erb +7 -0
- data/fixtures/frontmatter-app/source/json-front-matter-line-2.html.erb +7 -0
- data/fixtures/frontmatter-app/source/json-front-matter.html.erb +2 -2
- data/fixtures/frontmatter-settings-app/config.rb +1 -3
- data/fixtures/indexable-app/config.rb +0 -4
- data/fixtures/traversal-app/config.rb +0 -2
- data/lib/middleman-core/application.rb +7 -48
- data/lib/middleman-core/cli.rb +49 -46
- data/lib/middleman-core/cli/build.rb +62 -30
- data/lib/middleman-core/cli/extension.rb +1 -1
- data/lib/middleman-core/cli/server.rb +4 -3
- data/lib/middleman-core/core_extensions.rb +1 -10
- data/lib/middleman-core/core_extensions/extensions.rb +14 -9
- data/lib/middleman-core/core_extensions/file_watcher.rb +44 -46
- data/lib/middleman-core/core_extensions/front_matter.rb +27 -11
- data/lib/middleman-core/core_extensions/rendering.rb +74 -7
- data/lib/middleman-core/core_extensions/request.rb +32 -33
- data/lib/middleman-core/core_extensions/routing.rb +5 -3
- data/lib/middleman-core/extensions.rb +11 -21
- data/lib/middleman-core/preview_server.rb +3 -3
- data/lib/middleman-core/renderers/coffee_script.rb +41 -0
- data/lib/middleman-core/renderers/haml.rb +30 -0
- data/lib/middleman-core/renderers/less.rb +46 -0
- data/lib/middleman-core/renderers/liquid.rb +35 -0
- data/lib/middleman-core/renderers/markdown.rb +57 -0
- data/lib/middleman-core/renderers/redcarpet.rb +38 -0
- data/lib/middleman-core/renderers/sass.rb +85 -0
- data/lib/middleman-core/renderers/slim.rb +30 -0
- data/lib/middleman-core/sitemap/resource.rb +6 -2
- data/lib/middleman-core/step_definitions/middleman_steps.rb +2 -2
- data/lib/middleman-core/templates/extension/gemspec +1 -1
- data/lib/middleman-core/templates/extension/lib/lib.rb +1 -1
- data/lib/middleman-core/util.rb +4 -0
- data/lib/middleman-core/version.rb +1 -9
- data/middleman-core.gemspec +3 -7
- metadata +146 -312
- data/features/asset_host.feature +0 -7
- data/features/automatic_image_sizes.feature +0 -16
- data/features/content_for.feature +0 -6
- data/features/directory_index.feature +0 -66
- data/features/former_padrino_helpers.feature +0 -12
- data/features/helpers_auto_javascript_include_tag.feature +0 -27
- data/features/helpers_auto_stylesheet_link_tag.feature +0 -27
- data/features/helpers_lorem.feature +0 -6
- data/features/helpers_page_classes.feature +0 -17
- data/features/helpers_relative_link_to.feature +0 -68
- data/features/i18n_builder.feature +0 -121
- data/features/i18n_preview.feature +0 -113
- data/features/instance_vars.feature +0 -18
- data/features/nested_layouts.feature +0 -24
- data/features/partials.feature +0 -46
- data/fixtures/asset-host-app/config.rb +0 -6
- data/fixtures/asset-host-app/source/.htaccess +0 -1
- data/fixtures/asset-host-app/source/asset_host.html.erb +0 -1
- data/fixtures/asset-host-app/source/images/blank.gif +0 -0
- data/fixtures/auto-css-app/config.rb +0 -11
- data/fixtures/auto-css-app/source/auto-css.html.erb +0 -1
- data/fixtures/auto-css-app/source/auto-css/auto-css.html.erb +0 -1
- data/fixtures/auto-css-app/source/auto-css/index.html.erb +0 -1
- data/fixtures/auto-css-app/source/auto-css/sub/auto-css.html.erb +0 -1
- data/fixtures/auto-css-app/source/stylesheets/auto-css.css +0 -3
- data/fixtures/auto-css-app/source/stylesheets/auto-css/auto-css.css +0 -3
- data/fixtures/auto-css-app/source/stylesheets/auto-css/index.css +0 -0
- data/fixtures/auto-css-app/source/stylesheets/auto-css/sub/auto-css.css +0 -3
- data/fixtures/auto-js-app/config.rb +0 -11
- data/fixtures/auto-js-app/source/auto-js.html.erb +0 -1
- data/fixtures/auto-js-app/source/auto-js/auto-js.html.erb +0 -1
- data/fixtures/auto-js-app/source/auto-js/index.html.erb +0 -1
- data/fixtures/auto-js-app/source/auto-js/sub/auto-js.html.erb +0 -1
- data/fixtures/auto-js-app/source/javascripts/auto-js.js +0 -1
- data/fixtures/auto-js-app/source/javascripts/auto-js/auto-js.js +0 -1
- data/fixtures/auto-js-app/source/javascripts/auto-js/index.js +0 -1
- data/fixtures/auto-js-app/source/javascripts/auto-js/sub/auto-js.js +0 -1
- data/fixtures/automatic-image-size-app/config.rb +0 -0
- data/fixtures/automatic-image-size-app/source/auto-image-sizes.html.erb +0 -1
- data/fixtures/automatic-image-size-app/source/images/blank.gif +0 -0
- data/fixtures/clean-dir-app/config.rb +0 -2
- data/fixtures/clean-dir-app/source/about.html +0 -1
- data/fixtures/content-for-app/config.rb +0 -3
- data/fixtures/content-for-app/source/content_for_erb.html.erb +0 -5
- data/fixtures/content-for-app/source/layouts/content_for.erb +0 -4
- data/fixtures/different-engine-partial/config.rb +0 -0
- data/fixtures/different-engine-partial/source/index.html.erb +0 -1
- data/fixtures/different-engine-partial/source/layouts/layout.erb +0 -7
- data/fixtures/different-engine-partial/source/shared/_footer.str +0 -1
- data/fixtures/different-engine-partial/source/shared/_header.erb +0 -1
- data/fixtures/frontmatter-settings-app/source/no_index.html.erb +0 -5
- data/fixtures/i18n-alt-root-app/locales/en.yml +0 -4
- data/fixtures/i18n-alt-root-app/locales/es.yml +0 -7
- data/fixtures/i18n-alt-root-app/source/lang_data/hello.html.erb +0 -1
- data/fixtures/i18n-alt-root-app/source/lang_data/index.html.erb +0 -1
- data/fixtures/i18n-alt-root-app/source/layout.erb +0 -1
- data/fixtures/i18n-test-app/locales/en.yml +0 -4
- data/fixtures/i18n-test-app/locales/es.yml +0 -7
- data/fixtures/i18n-test-app/source/layout.erb +0 -1
- data/fixtures/i18n-test-app/source/localizable/hello.html.erb +0 -1
- data/fixtures/i18n-test-app/source/localizable/index.html.erb +0 -1
- data/fixtures/instance-vars-app/config.rb +0 -0
- data/fixtures/instance-vars-app/source/_vartial.erb +0 -5
- data/fixtures/instance-vars-app/source/instance-var-set.html.erb +0 -2
- data/fixtures/instance-vars-app/source/layout.erb +0 -3
- data/fixtures/instance-vars-app/source/no-instance-var.html.erb +0 -1
- data/fixtures/lorem-app/config.rb +0 -1
- data/fixtures/lorem-app/source/lorem.html.erb +0 -13
- data/fixtures/nested-layout-app/config.rb +0 -1
- data/fixtures/nested-layout-app/source/data-one.html.erb +0 -5
- data/fixtures/nested-layout-app/source/data-two.html.erb +0 -5
- data/fixtures/nested-layout-app/source/index.html.erb +0 -1
- data/fixtures/nested-layout-app/source/layouts/inner.erb +0 -4
- data/fixtures/nested-layout-app/source/layouts/master.erb +0 -3
- data/fixtures/nested-layout-app/source/layouts/outer.erb +0 -4
- data/fixtures/padrino-helpers-app/config.rb +0 -0
- data/fixtures/padrino-helpers-app/source/former_padrino_test.html.erb +0 -5
- data/fixtures/page-classes-app/config.rb +0 -4
- data/fixtures/page-classes-app/source/page-classes.html.erb +0 -1
- data/fixtures/page-classes-app/source/sub1/page-classes.html.erb +0 -1
- data/fixtures/page-classes-app/source/sub1/sub2/page-classes.html.erb +0 -1
- data/fixtures/partials-app/config.rb +0 -0
- data/fixtures/partials-app/source/_locals.erb +0 -1
- data/fixtures/partials-app/source/_main.erb +0 -1
- data/fixtures/partials-app/source/_main.str +0 -1
- data/fixtures/partials-app/source/index.html.erb +0 -3
- data/fixtures/partials-app/source/locals.html.erb +0 -1
- data/fixtures/partials-app/source/second.html.str +0 -3
- data/fixtures/partials-app/source/shared/_footer.erb +0 -1
- data/fixtures/partials-app/source/shared/_header.erb +0 -1
- data/fixtures/partials-app/source/shared/snippet.erb +0 -1
- data/fixtures/partials-app/source/sub/_local.erb +0 -1
- data/fixtures/partials-app/source/sub/index.html.erb +0 -3
- data/fixtures/partials-app/source/using_snippet.html.erb +0 -1
- data/fixtures/wildcard-directory-index-app/config.rb +0 -2
- data/fixtures/wildcard-directory-index-app/source/admin/index.html.erb +0 -1
- data/fixtures/wildcard-directory-index-app/source/admin/page.html.erb +0 -1
- data/fixtures/wildcard-directory-index-app/source/index.html.erb +0 -1
- data/fixtures/wildcard-directory-index-app/source/layouts/admin.erb +0 -2
- data/fixtures/wildcard-directory-index-app/source/layouts/layout.erb +0 -2
- data/lib/middleman-core/core_extensions/assets.rb +0 -43
- data/lib/middleman-core/core_extensions/default_helpers.rb +0 -172
- data/lib/middleman-core/core_extensions/i18n.rb +0 -146
- data/lib/middleman-core/extensions/asset_host.rb +0 -47
- data/lib/middleman-core/extensions/automatic_image_sizes.rb +0 -57
- data/lib/middleman-core/extensions/automatic_image_sizes/fastimage.rb +0 -287
- data/lib/middleman-core/extensions/directory_indexes.rb +0 -54
- data/lib/middleman-core/extensions/lorem.rb +0 -195
@@ -3,6 +3,7 @@ require "tilt"
|
|
3
3
|
|
4
4
|
# Use ActiveSupport JSON
|
5
5
|
require "active_support/json"
|
6
|
+
require "active_support/core_ext/integer/inflections"
|
6
7
|
|
7
8
|
# Simple callback library
|
8
9
|
require "middleman-core/vendor/hooks-0.2.0/lib/hooks"
|
@@ -71,6 +72,11 @@ module Middleman
|
|
71
72
|
# @return [String]
|
72
73
|
set :root, ENV["MM_ROOT"] || Dir.pwd
|
73
74
|
|
75
|
+
# Pathname-addressed root
|
76
|
+
def root_path
|
77
|
+
@_root_path ||= Pathname.new(root)
|
78
|
+
end
|
79
|
+
|
74
80
|
# Name of the source directory
|
75
81
|
# @return [String]
|
76
82
|
set :source, "source"
|
@@ -87,7 +93,7 @@ module Middleman
|
|
87
93
|
# @return [String]
|
88
94
|
set :index_file, "index.html"
|
89
95
|
|
90
|
-
# Location of javascripts within source.
|
96
|
+
# Location of javascripts within source.
|
91
97
|
# @return [String]
|
92
98
|
set :js_dir, "javascripts"
|
93
99
|
|
@@ -111,10 +117,6 @@ module Middleman
|
|
111
117
|
# @return [Boolean]
|
112
118
|
set :show_exceptions, true
|
113
119
|
|
114
|
-
# Automatically loaded extensions
|
115
|
-
# @return [Array<Symbol>]
|
116
|
-
set :default_extensions, [ :lorem ]
|
117
|
-
|
118
120
|
# Default layout name
|
119
121
|
# @return [String, Symbold]
|
120
122
|
set :layout, :_auto_layout
|
@@ -150,54 +152,11 @@ module Middleman
|
|
150
152
|
# Setup external helpers
|
151
153
|
register Middleman::CoreExtensions::ExternalHelpers
|
152
154
|
|
153
|
-
# Setup default helpers
|
154
|
-
register Middleman::CoreExtensions::DefaultHelpers
|
155
|
-
|
156
|
-
# Setup asset path pipeline
|
157
|
-
register Middleman::CoreExtensions::Assets
|
158
|
-
|
159
155
|
# with_layout and page routing
|
160
156
|
register Middleman::CoreExtensions::Routing
|
161
157
|
|
162
|
-
# i18n
|
163
|
-
register Middleman::CoreExtensions::I18n
|
164
|
-
|
165
|
-
# Built-in Extensions
|
166
|
-
|
167
|
-
# Provide Apache-style index.html files for directories
|
168
|
-
Middleman::Extensions.register(:directory_indexes) do
|
169
|
-
require "middleman-core/extensions/directory_indexes"
|
170
|
-
Middleman::Extensions::DirectoryIndexes
|
171
|
-
end
|
172
|
-
|
173
|
-
# Lorem provides a handful of helpful prototyping methods to generate
|
174
|
-
# words, paragraphs, fake images, names and email addresses.
|
175
|
-
Middleman::Extensions.register(:lorem) do
|
176
|
-
require "middleman-core/extensions/lorem"
|
177
|
-
Middleman::Extensions::Lorem
|
178
|
-
end
|
179
|
-
|
180
|
-
# AutomaticImageSizes inspects the images used in your dynamic templates
|
181
|
-
# and automatically adds width and height attributes to their HTML
|
182
|
-
# elements.
|
183
|
-
Middleman::Extensions.register(:automatic_image_sizes) do
|
184
|
-
require "middleman-core/extensions/automatic_image_sizes"
|
185
|
-
Middleman::Extensions::AutomaticImageSizes
|
186
|
-
end
|
187
|
-
|
188
|
-
# AssetHost allows you to setup multiple domains to host your static
|
189
|
-
# assets. Calls to asset paths in dynamic templates will then rotate
|
190
|
-
# through each of the asset servers to better spread the load.
|
191
|
-
Middleman::Extensions.register(:asset_host) do
|
192
|
-
require "middleman-core/extensions/asset_host"
|
193
|
-
Middleman::Extensions::AssetHost
|
194
|
-
end
|
195
|
-
|
196
158
|
# Initialize the Middleman project
|
197
159
|
def initialize(&block)
|
198
|
-
# Current path defaults to nil, used in views.
|
199
|
-
self.current_path = nil
|
200
|
-
|
201
160
|
# Clear the static class cache
|
202
161
|
cache.clear
|
203
162
|
|
data/lib/middleman-core/cli.rb
CHANGED
@@ -3,63 +3,66 @@ require 'thor'
|
|
3
3
|
require "thor/group"
|
4
4
|
|
5
5
|
# CLI Module
|
6
|
-
module Middleman
|
7
|
-
|
8
|
-
|
9
|
-
class Base < Thor
|
6
|
+
module Middleman
|
7
|
+
|
8
|
+
module Cli
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
require 'middleman-core/version'
|
14
|
-
say "Middleman #{Middleman::VERSION}"
|
15
|
-
end
|
10
|
+
# The base task from which everything else etends
|
11
|
+
class Base < Thor
|
16
12
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
13
|
+
desc "version", "Show version"
|
14
|
+
def version
|
15
|
+
require 'middleman-core/version'
|
16
|
+
say "Middleman #{Middleman::VERSION}"
|
17
|
+
end
|
18
|
+
|
19
|
+
# Override the Thor help method to find help for subtasks
|
20
|
+
# @param [Symbol, String, nil] meth
|
21
|
+
# @param [Boolean] subcommand
|
22
|
+
# @return [void]
|
23
|
+
def help(meth = nil, subcommand = false)
|
24
|
+
if meth && !self.respond_to?(meth)
|
25
|
+
klass, task = Thor::Util.find_class_and_task_by_namespace("#{meth}:#{meth}")
|
26
|
+
klass.start(["-h", task].compact, :shell => self.shell)
|
27
|
+
else
|
28
|
+
list = []
|
29
|
+
Thor::Util.thor_classes_in(Middleman::Cli).each do |klass|
|
30
|
+
list += klass.printable_tasks(false)
|
31
|
+
end
|
32
|
+
list.sort!{ |a,b| a[0] <=> b[0] }
|
31
33
|
|
32
|
-
|
33
|
-
|
34
|
-
|
34
|
+
shell.say "Tasks:"
|
35
|
+
shell.print_table(list, :ident => 2, :truncate => true)
|
36
|
+
shell.say
|
37
|
+
end
|
35
38
|
end
|
36
|
-
end
|
37
39
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
40
|
+
# Intercept missing methods and search subtasks for them
|
41
|
+
# @param [Symbol] meth
|
42
|
+
def method_missing(meth, *args)
|
43
|
+
meth = meth.to_s
|
42
44
|
|
43
|
-
|
44
|
-
|
45
|
-
|
45
|
+
if self.class.map.has_key?(meth)
|
46
|
+
meth = self.class.map[meth]
|
47
|
+
end
|
46
48
|
|
47
|
-
|
49
|
+
klass, task = Thor::Util.find_class_and_task_by_namespace("#{meth}:#{meth}")
|
48
50
|
|
49
|
-
|
50
|
-
|
51
|
+
if klass.nil?
|
52
|
+
tasks_dir = File.join(Dir.pwd, "tasks")
|
51
53
|
|
52
|
-
|
53
|
-
|
54
|
-
|
54
|
+
if File.exists?(tasks_dir)
|
55
|
+
Dir[File.join(tasks_dir, "**/*_task.rb")].each { |f| require f }
|
56
|
+
klass, task = Thor::Util.find_class_and_task_by_namespace("#{meth}:#{meth}")
|
57
|
+
end
|
55
58
|
end
|
56
|
-
end
|
57
59
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
60
|
+
if klass.nil?
|
61
|
+
super
|
62
|
+
else
|
63
|
+
args.unshift(task) if task
|
64
|
+
klass.start(args, :shell => self.shell)
|
65
|
+
end
|
63
66
|
end
|
64
67
|
end
|
65
68
|
end
|
@@ -1,8 +1,4 @@
|
|
1
|
-
|
2
|
-
require "rack"
|
3
|
-
require "rack/test"
|
4
|
-
|
5
|
-
require 'find'
|
1
|
+
require "middleman-core"
|
6
2
|
|
7
3
|
# CLI Module
|
8
4
|
module Middleman::Cli
|
@@ -11,6 +7,8 @@ module Middleman::Cli
|
|
11
7
|
class Build < Thor
|
12
8
|
include Thor::Actions
|
13
9
|
|
10
|
+
attr_reader :debugging
|
11
|
+
|
14
12
|
check_unknown_options!
|
15
13
|
|
16
14
|
namespace :build
|
@@ -38,7 +36,16 @@ module Middleman::Cli
|
|
38
36
|
raise Thor::Error, "Error: Could not find a Middleman project config, perhaps you are in the wrong folder?"
|
39
37
|
end
|
40
38
|
|
41
|
-
|
39
|
+
# Use Rack::Test for inspecting a running server for output
|
40
|
+
require "rack"
|
41
|
+
require "rack/test"
|
42
|
+
|
43
|
+
require 'find'
|
44
|
+
|
45
|
+
@debugging = Middleman::Cli::Base.debugging
|
46
|
+
@had_errors = false
|
47
|
+
|
48
|
+
self.class.shared_instance(options["verbose"])
|
42
49
|
|
43
50
|
self.class.shared_rack
|
44
51
|
|
@@ -48,6 +55,12 @@ module Middleman::Cli
|
|
48
55
|
|
49
56
|
action GlobAction.new(self, opts)
|
50
57
|
|
58
|
+
if @had_errors && !@debugging
|
59
|
+
self.shell.say "There were errors during this build, re-run with --debug to see the full exception."
|
60
|
+
end
|
61
|
+
|
62
|
+
exit(1) if @had_errors
|
63
|
+
|
51
64
|
self.class.shared_instance.run_hook :after_build, self
|
52
65
|
end
|
53
66
|
|
@@ -92,32 +105,42 @@ module Middleman::Cli
|
|
92
105
|
end
|
93
106
|
end
|
94
107
|
|
95
|
-
|
96
|
-
|
108
|
+
no_tasks {
|
109
|
+
# Render a resource to a file.
|
110
|
+
#
|
111
|
+
# @param [Middleman::Sitemap::Resource] resource
|
112
|
+
# @return [String] The full path of the file that was written
|
113
|
+
def render_to_file(resource)
|
114
|
+
build_dir = self.class.shared_instance.build_dir
|
115
|
+
output_file = File.join(build_dir, resource.destination_path)
|
116
|
+
|
117
|
+
begin
|
118
|
+
response = self.class.shared_rack.get(URI.escape(resource.destination_path))
|
119
|
+
|
120
|
+
if response.status == 200
|
121
|
+
create_file(output_file, response.body)
|
122
|
+
else
|
123
|
+
handle_error(output_file, response.body)
|
124
|
+
end
|
125
|
+
rescue => e
|
126
|
+
handle_error(output_file, "#{e}\n#{e.backtrace.join("\n")}", e)
|
127
|
+
end
|
128
|
+
|
129
|
+
output_file
|
130
|
+
end
|
97
131
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
response = self.class.shared_rack.get(URI.escape(resource.destination_path))
|
108
|
-
|
109
|
-
if response.status == 200
|
110
|
-
create_file(output_file, response.body, { :force => true })
|
111
|
-
else
|
112
|
-
raise Thor::Error.new response.body
|
132
|
+
def handle_error(file_name, response, e=Thor::Error.new(response))
|
133
|
+
@had_errors = true
|
134
|
+
|
135
|
+
say_status :error, file_name, :red
|
136
|
+
if self.debugging
|
137
|
+
raise e
|
138
|
+
exit(1)
|
139
|
+
elsif options["verbose"]
|
140
|
+
self.shell.error(response)
|
113
141
|
end
|
114
|
-
rescue => e
|
115
|
-
say_status :error, output_file, :red
|
116
|
-
raise Thor::Error.new "#{e}\n#{e.backtrace.join("\n")}"
|
117
142
|
end
|
118
|
-
|
119
|
-
output_file
|
120
|
-
end
|
143
|
+
}
|
121
144
|
end
|
122
145
|
|
123
146
|
# A Thor Action, modular code, which does the majority of the work.
|
@@ -147,6 +170,7 @@ module Middleman::Cli
|
|
147
170
|
end
|
148
171
|
|
149
172
|
protected
|
173
|
+
|
150
174
|
# Remove files which were not built in this cycle
|
151
175
|
# @return [void]
|
152
176
|
def clean!
|
@@ -208,7 +232,7 @@ module Middleman::Cli
|
|
208
232
|
puts "== Checking for Compass sprites" if @app.logging?
|
209
233
|
|
210
234
|
# Double-check for compass sprites
|
211
|
-
@app.files.find_new_files(
|
235
|
+
@app.files.find_new_files(Pathname.new(@app.source_dir) + @app.images_dir)
|
212
236
|
|
213
237
|
# Sort paths to be built by the above order. This is primarily so Compass can
|
214
238
|
# find files in the build folder when it needs to generate sprites for the
|
@@ -237,3 +261,11 @@ module Middleman::Cli
|
|
237
261
|
# Alias "b" to "build"
|
238
262
|
Base.map({ "b" => "build" })
|
239
263
|
end
|
264
|
+
|
265
|
+
# Quiet down create file
|
266
|
+
class ::Thor::Actions::CreateFile
|
267
|
+
def on_conflict_behavior(&block)
|
268
|
+
say_status :create, :green
|
269
|
+
block.call unless pretend?
|
270
|
+
end
|
271
|
+
end
|
@@ -12,7 +12,7 @@ module Middleman::Cli
|
|
12
12
|
# Required path for the new project to be generated
|
13
13
|
argument :name, :type => :string
|
14
14
|
|
15
|
-
desc "extension
|
15
|
+
desc "extension [options]", "Create Middleman extension scaffold NAME"
|
16
16
|
|
17
17
|
# The extension task
|
18
18
|
# @param [String] name
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require "middleman-core/preview_server"
|
2
|
-
|
3
1
|
# CLI Module
|
4
2
|
module Middleman::Cli
|
5
3
|
|
@@ -34,6 +32,9 @@ module Middleman::Cli
|
|
34
32
|
|
35
33
|
# Start the server
|
36
34
|
def server
|
35
|
+
require "middleman-core"
|
36
|
+
require "middleman-core/preview_server"
|
37
|
+
|
37
38
|
if !ENV["MM_ROOT"]
|
38
39
|
puts "== Could not find a Middleman project config.rb"
|
39
40
|
puts "== Treating directory as a static site to be served"
|
@@ -50,7 +51,7 @@ module Middleman::Cli
|
|
50
51
|
}
|
51
52
|
|
52
53
|
puts "== The Middleman is loading"
|
53
|
-
Middleman::PreviewServer.start(params)
|
54
|
+
::Middleman::PreviewServer.start(params)
|
54
55
|
end
|
55
56
|
end
|
56
57
|
|
@@ -10,9 +10,6 @@ require "middleman-core/core_extensions/builder"
|
|
10
10
|
# Custom Feature API
|
11
11
|
require "middleman-core/core_extensions/extensions"
|
12
12
|
|
13
|
-
# Asset Path Pipeline
|
14
|
-
require "middleman-core/core_extensions/assets"
|
15
|
-
|
16
13
|
# Data looks at the data/ folder for YAML files and makes them available
|
17
14
|
# to dynamic requests.
|
18
15
|
require "middleman-core/core_extensions/data"
|
@@ -23,9 +20,6 @@ require "middleman-core/core_extensions/front_matter"
|
|
23
20
|
# External helpers looks in the helpers/ folder for helper modules
|
24
21
|
require "middleman-core/core_extensions/external_helpers"
|
25
22
|
|
26
|
-
# DefaultHelpers are the built-in dynamic template helpers.
|
27
|
-
require "middleman-core/core_extensions/default_helpers"
|
28
|
-
|
29
23
|
# Extended version of Padrino's rendering
|
30
24
|
require "middleman-core/core_extensions/rendering"
|
31
25
|
|
@@ -33,7 +27,4 @@ require "middleman-core/core_extensions/rendering"
|
|
33
27
|
require "middleman-core/core_extensions/routing"
|
34
28
|
|
35
29
|
# Catch and show exceptions at the Rack level
|
36
|
-
require "middleman-core/core_extensions/show_exceptions"
|
37
|
-
|
38
|
-
# i18n
|
39
|
-
require "middleman-core/core_extensions/i18n"
|
30
|
+
require "middleman-core/core_extensions/show_exceptions"
|