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.
Files changed (157) hide show
  1. data/bin/middleman +32 -30
  2. data/features/clean_build.feature +0 -13
  3. data/features/extensionless_text_files.feature +2 -34
  4. data/features/front-matter.feature +27 -6
  5. data/features/frontmatter_page_settings.feature +6 -15
  6. data/features/ignore.feature +1 -78
  7. data/features/sitemap_traversal.feature +5 -5
  8. data/features/support/env.rb +3 -0
  9. data/features/wildcard_page_helper.feature +0 -9
  10. data/fixtures/frontmatter-app/source/front-matter-encoding.html.erb +7 -0
  11. data/fixtures/frontmatter-app/source/{front-matter.html.erb → front-matter-line-2.html.erb} +0 -1
  12. data/fixtures/frontmatter-app/source/json-front-matter-2.php.erb +2 -2
  13. data/fixtures/frontmatter-app/source/json-front-matter-auto.erb +2 -2
  14. data/fixtures/frontmatter-app/source/json-front-matter-encoding.html.erb +7 -0
  15. data/fixtures/frontmatter-app/source/json-front-matter-line-2.html.erb +7 -0
  16. data/fixtures/frontmatter-app/source/json-front-matter.html.erb +2 -2
  17. data/fixtures/frontmatter-settings-app/config.rb +1 -3
  18. data/fixtures/indexable-app/config.rb +0 -4
  19. data/fixtures/traversal-app/config.rb +0 -2
  20. data/lib/middleman-core/application.rb +7 -48
  21. data/lib/middleman-core/cli.rb +49 -46
  22. data/lib/middleman-core/cli/build.rb +62 -30
  23. data/lib/middleman-core/cli/extension.rb +1 -1
  24. data/lib/middleman-core/cli/server.rb +4 -3
  25. data/lib/middleman-core/core_extensions.rb +1 -10
  26. data/lib/middleman-core/core_extensions/extensions.rb +14 -9
  27. data/lib/middleman-core/core_extensions/file_watcher.rb +44 -46
  28. data/lib/middleman-core/core_extensions/front_matter.rb +27 -11
  29. data/lib/middleman-core/core_extensions/rendering.rb +74 -7
  30. data/lib/middleman-core/core_extensions/request.rb +32 -33
  31. data/lib/middleman-core/core_extensions/routing.rb +5 -3
  32. data/lib/middleman-core/extensions.rb +11 -21
  33. data/lib/middleman-core/preview_server.rb +3 -3
  34. data/lib/middleman-core/renderers/coffee_script.rb +41 -0
  35. data/lib/middleman-core/renderers/haml.rb +30 -0
  36. data/lib/middleman-core/renderers/less.rb +46 -0
  37. data/lib/middleman-core/renderers/liquid.rb +35 -0
  38. data/lib/middleman-core/renderers/markdown.rb +57 -0
  39. data/lib/middleman-core/renderers/redcarpet.rb +38 -0
  40. data/lib/middleman-core/renderers/sass.rb +85 -0
  41. data/lib/middleman-core/renderers/slim.rb +30 -0
  42. data/lib/middleman-core/sitemap/resource.rb +6 -2
  43. data/lib/middleman-core/step_definitions/middleman_steps.rb +2 -2
  44. data/lib/middleman-core/templates/extension/gemspec +1 -1
  45. data/lib/middleman-core/templates/extension/lib/lib.rb +1 -1
  46. data/lib/middleman-core/util.rb +4 -0
  47. data/lib/middleman-core/version.rb +1 -9
  48. data/middleman-core.gemspec +3 -7
  49. metadata +146 -312
  50. data/features/asset_host.feature +0 -7
  51. data/features/automatic_image_sizes.feature +0 -16
  52. data/features/content_for.feature +0 -6
  53. data/features/directory_index.feature +0 -66
  54. data/features/former_padrino_helpers.feature +0 -12
  55. data/features/helpers_auto_javascript_include_tag.feature +0 -27
  56. data/features/helpers_auto_stylesheet_link_tag.feature +0 -27
  57. data/features/helpers_lorem.feature +0 -6
  58. data/features/helpers_page_classes.feature +0 -17
  59. data/features/helpers_relative_link_to.feature +0 -68
  60. data/features/i18n_builder.feature +0 -121
  61. data/features/i18n_preview.feature +0 -113
  62. data/features/instance_vars.feature +0 -18
  63. data/features/nested_layouts.feature +0 -24
  64. data/features/partials.feature +0 -46
  65. data/fixtures/asset-host-app/config.rb +0 -6
  66. data/fixtures/asset-host-app/source/.htaccess +0 -1
  67. data/fixtures/asset-host-app/source/asset_host.html.erb +0 -1
  68. data/fixtures/asset-host-app/source/images/blank.gif +0 -0
  69. data/fixtures/auto-css-app/config.rb +0 -11
  70. data/fixtures/auto-css-app/source/auto-css.html.erb +0 -1
  71. data/fixtures/auto-css-app/source/auto-css/auto-css.html.erb +0 -1
  72. data/fixtures/auto-css-app/source/auto-css/index.html.erb +0 -1
  73. data/fixtures/auto-css-app/source/auto-css/sub/auto-css.html.erb +0 -1
  74. data/fixtures/auto-css-app/source/stylesheets/auto-css.css +0 -3
  75. data/fixtures/auto-css-app/source/stylesheets/auto-css/auto-css.css +0 -3
  76. data/fixtures/auto-css-app/source/stylesheets/auto-css/index.css +0 -0
  77. data/fixtures/auto-css-app/source/stylesheets/auto-css/sub/auto-css.css +0 -3
  78. data/fixtures/auto-js-app/config.rb +0 -11
  79. data/fixtures/auto-js-app/source/auto-js.html.erb +0 -1
  80. data/fixtures/auto-js-app/source/auto-js/auto-js.html.erb +0 -1
  81. data/fixtures/auto-js-app/source/auto-js/index.html.erb +0 -1
  82. data/fixtures/auto-js-app/source/auto-js/sub/auto-js.html.erb +0 -1
  83. data/fixtures/auto-js-app/source/javascripts/auto-js.js +0 -1
  84. data/fixtures/auto-js-app/source/javascripts/auto-js/auto-js.js +0 -1
  85. data/fixtures/auto-js-app/source/javascripts/auto-js/index.js +0 -1
  86. data/fixtures/auto-js-app/source/javascripts/auto-js/sub/auto-js.js +0 -1
  87. data/fixtures/automatic-image-size-app/config.rb +0 -0
  88. data/fixtures/automatic-image-size-app/source/auto-image-sizes.html.erb +0 -1
  89. data/fixtures/automatic-image-size-app/source/images/blank.gif +0 -0
  90. data/fixtures/clean-dir-app/config.rb +0 -2
  91. data/fixtures/clean-dir-app/source/about.html +0 -1
  92. data/fixtures/content-for-app/config.rb +0 -3
  93. data/fixtures/content-for-app/source/content_for_erb.html.erb +0 -5
  94. data/fixtures/content-for-app/source/layouts/content_for.erb +0 -4
  95. data/fixtures/different-engine-partial/config.rb +0 -0
  96. data/fixtures/different-engine-partial/source/index.html.erb +0 -1
  97. data/fixtures/different-engine-partial/source/layouts/layout.erb +0 -7
  98. data/fixtures/different-engine-partial/source/shared/_footer.str +0 -1
  99. data/fixtures/different-engine-partial/source/shared/_header.erb +0 -1
  100. data/fixtures/frontmatter-settings-app/source/no_index.html.erb +0 -5
  101. data/fixtures/i18n-alt-root-app/locales/en.yml +0 -4
  102. data/fixtures/i18n-alt-root-app/locales/es.yml +0 -7
  103. data/fixtures/i18n-alt-root-app/source/lang_data/hello.html.erb +0 -1
  104. data/fixtures/i18n-alt-root-app/source/lang_data/index.html.erb +0 -1
  105. data/fixtures/i18n-alt-root-app/source/layout.erb +0 -1
  106. data/fixtures/i18n-test-app/locales/en.yml +0 -4
  107. data/fixtures/i18n-test-app/locales/es.yml +0 -7
  108. data/fixtures/i18n-test-app/source/layout.erb +0 -1
  109. data/fixtures/i18n-test-app/source/localizable/hello.html.erb +0 -1
  110. data/fixtures/i18n-test-app/source/localizable/index.html.erb +0 -1
  111. data/fixtures/instance-vars-app/config.rb +0 -0
  112. data/fixtures/instance-vars-app/source/_vartial.erb +0 -5
  113. data/fixtures/instance-vars-app/source/instance-var-set.html.erb +0 -2
  114. data/fixtures/instance-vars-app/source/layout.erb +0 -3
  115. data/fixtures/instance-vars-app/source/no-instance-var.html.erb +0 -1
  116. data/fixtures/lorem-app/config.rb +0 -1
  117. data/fixtures/lorem-app/source/lorem.html.erb +0 -13
  118. data/fixtures/nested-layout-app/config.rb +0 -1
  119. data/fixtures/nested-layout-app/source/data-one.html.erb +0 -5
  120. data/fixtures/nested-layout-app/source/data-two.html.erb +0 -5
  121. data/fixtures/nested-layout-app/source/index.html.erb +0 -1
  122. data/fixtures/nested-layout-app/source/layouts/inner.erb +0 -4
  123. data/fixtures/nested-layout-app/source/layouts/master.erb +0 -3
  124. data/fixtures/nested-layout-app/source/layouts/outer.erb +0 -4
  125. data/fixtures/padrino-helpers-app/config.rb +0 -0
  126. data/fixtures/padrino-helpers-app/source/former_padrino_test.html.erb +0 -5
  127. data/fixtures/page-classes-app/config.rb +0 -4
  128. data/fixtures/page-classes-app/source/page-classes.html.erb +0 -1
  129. data/fixtures/page-classes-app/source/sub1/page-classes.html.erb +0 -1
  130. data/fixtures/page-classes-app/source/sub1/sub2/page-classes.html.erb +0 -1
  131. data/fixtures/partials-app/config.rb +0 -0
  132. data/fixtures/partials-app/source/_locals.erb +0 -1
  133. data/fixtures/partials-app/source/_main.erb +0 -1
  134. data/fixtures/partials-app/source/_main.str +0 -1
  135. data/fixtures/partials-app/source/index.html.erb +0 -3
  136. data/fixtures/partials-app/source/locals.html.erb +0 -1
  137. data/fixtures/partials-app/source/second.html.str +0 -3
  138. data/fixtures/partials-app/source/shared/_footer.erb +0 -1
  139. data/fixtures/partials-app/source/shared/_header.erb +0 -1
  140. data/fixtures/partials-app/source/shared/snippet.erb +0 -1
  141. data/fixtures/partials-app/source/sub/_local.erb +0 -1
  142. data/fixtures/partials-app/source/sub/index.html.erb +0 -3
  143. data/fixtures/partials-app/source/using_snippet.html.erb +0 -1
  144. data/fixtures/wildcard-directory-index-app/config.rb +0 -2
  145. data/fixtures/wildcard-directory-index-app/source/admin/index.html.erb +0 -1
  146. data/fixtures/wildcard-directory-index-app/source/admin/page.html.erb +0 -1
  147. data/fixtures/wildcard-directory-index-app/source/index.html.erb +0 -1
  148. data/fixtures/wildcard-directory-index-app/source/layouts/admin.erb +0 -2
  149. data/fixtures/wildcard-directory-index-app/source/layouts/layout.erb +0 -2
  150. data/lib/middleman-core/core_extensions/assets.rb +0 -43
  151. data/lib/middleman-core/core_extensions/default_helpers.rb +0 -172
  152. data/lib/middleman-core/core_extensions/i18n.rb +0 -146
  153. data/lib/middleman-core/extensions/asset_host.rb +0 -47
  154. data/lib/middleman-core/extensions/automatic_image_sizes.rb +0 -57
  155. data/lib/middleman-core/extensions/automatic_image_sizes/fastimage.rb +0 -287
  156. data/lib/middleman-core/extensions/directory_indexes.rb +0 -54
  157. data/lib/middleman-core/extensions/lorem.rb +0 -195
@@ -0,0 +1,7 @@
1
+ <h2> Test</h2>
2
+ ;;;
3
+ layout: false,
4
+ title: "This is the title"
5
+ ;;;
6
+
7
+ <h1><%= data.page.title %></h1>
@@ -1,6 +1,6 @@
1
- {{{
1
+ ;;;
2
2
  "layout": false,
3
3
  "title": "This is the title"
4
- }}}
4
+ ;;;
5
5
 
6
6
  <h1><%= data.page.title %></h1>
@@ -1,4 +1,2 @@
1
- activate :directory_indexes
2
-
3
1
  # Proxy ignored.html, which should ignore itself through a frontmatter
4
- page 'proxied.html', :proxy => 'ignored.html'
2
+ page 'proxied.html', :proxy => 'ignored.html'
@@ -1,4 +0,0 @@
1
- activate :directory_indexes
2
- page "/leave_me_alone.html", :directory_index => false
3
-
4
- page "/wildcard*", :directory_index => false
@@ -1,5 +1,3 @@
1
- activate :directory_indexes
2
-
3
1
  page "/sub/fake.html", :proxy => "/proxied.html", :ignore => true
4
2
  page "/sub/fake2.html", :proxy => "/proxied.html", :ignore => true
5
3
 
@@ -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. Used by Sprockets.
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
 
@@ -3,63 +3,66 @@ require 'thor'
3
3
  require "thor/group"
4
4
 
5
5
  # CLI Module
6
- module Middleman::Cli
7
-
8
- # The base task from which everything else etends
9
- class Base < Thor
6
+ module Middleman
7
+
8
+ module Cli
10
9
 
11
- desc "version", "Show version"
12
- def version
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
- # Override the Thor help method to find help for subtasks
18
- # @param [Symbol, String, nil] meth
19
- # @param [Boolean] subcommand
20
- # @return [void]
21
- def help(meth = nil, subcommand = false)
22
- if meth && !self.respond_to?(meth)
23
- klass, task = Thor::Util.find_class_and_task_by_namespace("#{meth}:#{meth}")
24
- klass.start(["-h", task].compact, :shell => self.shell)
25
- else
26
- list = []
27
- Thor::Util.thor_classes_in(Middleman::Cli).each do |klass|
28
- list += klass.printable_tasks(false)
29
- end
30
- list.sort!{ |a,b| a[0] <=> b[0] }
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
- shell.say "Tasks:"
33
- shell.print_table(list, :ident => 2, :truncate => true)
34
- shell.say
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
- # Intercept missing methods and search subtasks for them
39
- # @param [Symbol] meth
40
- def method_missing(meth, *args)
41
- meth = meth.to_s
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
- if self.class.map.has_key?(meth)
44
- meth = self.class.map[meth]
45
- end
45
+ if self.class.map.has_key?(meth)
46
+ meth = self.class.map[meth]
47
+ end
46
48
 
47
- klass, task = Thor::Util.find_class_and_task_by_namespace("#{meth}:#{meth}")
49
+ klass, task = Thor::Util.find_class_and_task_by_namespace("#{meth}:#{meth}")
48
50
 
49
- if klass.nil?
50
- tasks_dir = File.join(Dir.pwd, "tasks")
51
+ if klass.nil?
52
+ tasks_dir = File.join(Dir.pwd, "tasks")
51
53
 
52
- if File.exists?(tasks_dir)
53
- Dir[File.join(tasks_dir, "**/*_task.rb")].each { |f| require f }
54
- klass, task = Thor::Util.find_class_and_task_by_namespace("#{meth}:#{meth}")
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
- if klass.nil?
59
- super
60
- else
61
- args.unshift(task) if task
62
- klass.start(args, :shell => self.shell)
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
- # Use Rack::Test for inspecting a running server for output
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
- self.class.shared_instance(options["verbose"] || false)
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
- # Ignore following method
96
- desc "", "", :hide => true
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
- # Render a resource to a file.
99
- #
100
- # @param [Middleman::Sitemap::Resource] resource
101
- # @return [String] The full path of the file that was written
102
- def render_to_file(resource)
103
- build_dir = self.class.shared_instance.build_dir
104
- output_file = File.join(build_dir, resource.destination_path)
105
-
106
- begin
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(File.join(@app.source_dir, @app.images_dir))
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 NAME [options]", "Create Middleman extension scaffold NAME"
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"