middleman-core 3.0.5 → 3.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,94 @@
1
+ Feature: Proxy Pages (using proxy rather than page)
2
+ In order to use a single view to generate multiple output files
3
+
4
+ Scenario: Checking built folder for content
5
+ Given a successfully built app at "proxy-pages-app"
6
+ When I cd to "build"
7
+ Then the following files should exist:
8
+ | fake.html |
9
+ | fake2.html |
10
+ | fake3.html |
11
+ | fake4.html |
12
+ | fake/one.html |
13
+ | fake/two.html |
14
+ | fake2/one.html |
15
+ | fake2/two.html |
16
+ | fake3/one.html |
17
+ | fake3/two.html |
18
+ | fake4/one.html |
19
+ | fake4/two.html |
20
+ | target_ignore.html |
21
+ | target_ignore2.html |
22
+ | target_ignore3.html |
23
+ | target_ignore4.html |
24
+ | 明日がある.html |
25
+ Then the following files should not exist:
26
+ | should_be_ignored6.html |
27
+ | should_be_ignored7.html |
28
+ | should_be_ignored8.html |
29
+
30
+ Scenario: Preview basic proxy
31
+ Given the Server is running at "proxy-pages-app"
32
+ When I go to "/fake.html"
33
+ Then I should see "I am real"
34
+ When I go to "/fake2.html"
35
+ Then I should see "I am real"
36
+ When I go to "/fake3.html"
37
+ Then I should see "I am real"
38
+ When I go to "/fake4.html"
39
+ Then I should see "I am real"
40
+
41
+ Scenario: Preview proxy with variable one
42
+ Given the Server is running at "proxy-pages-app"
43
+ When I go to "/fake/one.html"
44
+ Then I should see "I am real: one"
45
+
46
+ When I go to "/fake2/one.html"
47
+ Then I should see "I am real: one"
48
+
49
+ When I go to "/fake3/one.html"
50
+ Then I should see "I am real: one"
51
+
52
+ When I go to "/fake4/one.html"
53
+ Then I should see "I am real: one"
54
+
55
+ Scenario: Preview proxy with variable two
56
+ Given the Server is running at "proxy-pages-app"
57
+ When I go to "/fake/two.html"
58
+ Then I should see "I am real: two"
59
+
60
+ When I go to "/fake2/two.html"
61
+ Then I should see "I am real: two"
62
+
63
+ When I go to "/fake3/two.html"
64
+ Then I should see "I am real: two"
65
+
66
+ When I go to "/fake4/two.html"
67
+ Then I should see "I am real: two"
68
+
69
+ Scenario: Build proxy with variable one
70
+ Given a successfully built app at "proxy-pages-app"
71
+ When I cd to "build"
72
+ Then the file "fake/one.html" should contain "I am real: one"
73
+ Then the file "fake2/one.html" should contain "I am real: one"
74
+ Then the file "fake3/one.html" should contain "I am real: one"
75
+
76
+ Scenario: Target ignore
77
+ Given the Server is running at "proxy-pages-app"
78
+ When I go to "/target_ignore.html"
79
+ Then I should see "Ignore me! 3"
80
+ When I go to "/target_ignore2.html"
81
+ Then I should see "Ignore me! 6"
82
+ When I go to "/target_ignore3.html"
83
+ Then I should see "Ignore me! 7"
84
+ When I go to "/target_ignore4.html"
85
+ Then I should see "Ignore me! 8"
86
+
87
+ Scenario: Preview ignored paths
88
+ Given the Server is running at "proxy-pages-app"
89
+ When I go to "/should_be_ignored6.html"
90
+ Then I should see "File Not Found"
91
+ When I go to "/should_be_ignored7.html"
92
+ Then I should see "File Not Found"
93
+ When I go to "/should_be_ignored8.html"
94
+ Then I should see "File Not Found"
@@ -0,0 +1,14 @@
1
+ @encoding
2
+
3
+ Feature: Tilde directories
4
+ In order to support ~ characters in directories
5
+
6
+ Scenario: Build directories with containing ~ characters in their name
7
+ Given a fixture app "empty-app"
8
+ And a file named "source/~notexistinguser/index.html" with:
9
+ """
10
+ It works!
11
+ """
12
+ And the Server is running
13
+ When I go to "/~notexistinguser/index.html"
14
+ Then I should see "It works!"
@@ -0,0 +1,21 @@
1
+ # -*- coding: utf-8 -*-
2
+ proxy "/fake.html", "/real.html", :layout => false
3
+ proxy "fake2.html", "/real.html", :layout => false
4
+ proxy "fake3.html", "real.html", :layout => false
5
+ proxy "/fake4.html", "real.html", :layout => false
6
+
7
+ proxy "/target_ignore.html", "/should_be_ignored3.html", :ignore => true
8
+ proxy "target_ignore2.html", "/should_be_ignored6.html", :ignore => true
9
+ proxy "target_ignore3.html", "should_be_ignored7.html", :ignore => true
10
+ proxy "/target_ignore4.html", "should_be_ignored8.html", :ignore => true
11
+
12
+ %w(one two).each do |num|
13
+ proxy "/fake/#{num}.html", "/real/index.html", :ignore => true, :locals => { :num => num }
14
+ proxy "fake2/#{num}.html", "/real/index.html", :ignore => true, :locals => { :num => num }
15
+ proxy "fake3/#{num}.html", "real/index.html", :ignore => true, :locals => { :num => num }
16
+ proxy "/fake4/#{num}.html", "real/index-ivars.html", :ignore => true do
17
+ @num = num
18
+ end
19
+ end
20
+
21
+ proxy "明日がある.html", "/real.html", :layout => false
@@ -0,0 +1 @@
1
+ I am real
@@ -0,0 +1,6 @@
1
+ ---
2
+ layout: false
3
+ ---
4
+
5
+ I am real: <%= @num %>
6
+
@@ -0,0 +1,5 @@
1
+ ---
2
+ layout: false
3
+ ---
4
+
5
+ I am real: <%= num %>
@@ -0,0 +1 @@
1
+ <h1>Ignore me! 3</h1>
@@ -0,0 +1 @@
1
+ <h1>Ignore me! 6</h1>
@@ -0,0 +1 @@
1
+ <h1>Ignore me! 7</h1>
@@ -0,0 +1 @@
1
+ <h1>Ignore me! 8</h1>
@@ -142,7 +142,7 @@ module Middleman
142
142
  include Middleman::CoreExtensions::RubyEncoding
143
143
 
144
144
  # Basic Rack Request Handling
145
- include Middleman::CoreExtensions::Request
145
+ register Middleman::CoreExtensions::Request
146
146
 
147
147
  # Handle exceptions
148
148
  register Middleman::CoreExtensions::ShowExceptions
@@ -71,7 +71,7 @@ module Middleman
71
71
  end
72
72
 
73
73
  if klass.nil?
74
- super
74
+ raise Thor::Error.new "There's no '#{meth}' command for Middleman. Try 'middleman help' for a list of commands."
75
75
  else
76
76
  args.unshift(task) if task
77
77
  klass.start(args, :shell => self.shell)
@@ -127,8 +127,7 @@ module Middleman::CoreExtensions
127
127
  # @param [String] path
128
128
  # @return [Array<Thor::CoreExt::HashWithIndifferentAccess, String>]
129
129
  def frontmatter_and_content(path)
130
- full_path = File.expand_path(path, @app.source_dir)
131
-
130
+ full_path = File.expand_path(File.join(@app.source_dir, path))
132
131
  content = File.read(full_path)
133
132
  data = {}
134
133
 
@@ -45,9 +45,7 @@ module Middleman
45
45
  # @param [Hash] opts
46
46
  # @return [void]
47
47
  def page(url, opts={}, &block)
48
-
49
- blocks = []
50
- blocks << block if block_given?
48
+ blocks = Array(block)
51
49
 
52
50
  # Default layout
53
51
  opts[:layout] = layout if opts[:layout].nil?
@@ -70,20 +68,12 @@ module Middleman
70
68
  end
71
69
 
72
70
  # Setup proxy
73
- if opts.has_key?(:proxy)
74
- proxy(url, opts[:proxy])
75
-
76
- if opts.has_key?(:ignore) && opts[:ignore]
77
- ignore(opts[:proxy])
78
- opts.delete(:ignore)
79
- end
80
-
81
- opts.delete(:proxy)
82
- else
83
- if opts.has_key?(:ignore) && opts[:ignore]
84
- ignore(url)
85
- opts.delete(:ignore)
86
- end
71
+ if target = opts.delete(:proxy)
72
+ # TODO: deprecate proxy through page?
73
+ proxy(url, target, opts, &block) and return
74
+ elsif opts.delete(:ignore)
75
+ # TODO: deprecate ignore through page?
76
+ ignore(url)
87
77
  end
88
78
 
89
79
  # Setup a metadata matcher for rendering those options
@@ -9,6 +9,7 @@ module Middleman::CoreExtensions::RubyEncoding
9
9
  app.send :include, InstanceMethods
10
10
  end
11
11
 
12
+ alias :included :registered
12
13
  end
13
14
 
14
15
  module InstanceMethods
@@ -1,9 +1,6 @@
1
1
  require "webrick"
2
2
 
3
3
  module Middleman
4
-
5
- WINDOWS = !!(RUBY_PLATFORM =~ /(mingw|bccwin|wince|mswin32)/i) unless const_defined?(:WINDOWS)
6
-
7
4
  module PreviewServer
8
5
 
9
6
  DEFAULT_PORT = 4567
@@ -25,7 +22,7 @@ module Middleman
25
22
  unless @initialized
26
23
  @initialized = true
27
24
 
28
- register_signal_handlers unless ::Middleman::WINDOWS
25
+ register_signal_handlers
29
26
 
30
27
  # Save the last-used @options so it may be re-used when
31
28
  # reloading later on.
@@ -38,7 +35,12 @@ module Middleman
38
35
  # Detach the current Middleman::Application instance
39
36
  # @return [void]
40
37
  def stop
41
- logger.info "== The Middleman is shutting down"
38
+ begin
39
+ logger.info "== The Middleman is shutting down"
40
+ rescue
41
+ # if the user closed their terminal STDOUT/STDERR won't exist
42
+ end
43
+
42
44
  if @listener
43
45
  @listener.stop
44
46
  @listener = nil
@@ -108,12 +110,17 @@ module Middleman
108
110
  @listener.start(false) if first_run
109
111
  end
110
112
 
111
- # Trap the interupt signal and shut down smoothly
113
+ # Trap some interupt signals and shut down smoothly
112
114
  # @return [void]
113
115
  def register_signal_handlers
114
- trap("INT") { shutdown }
115
- trap("TERM") { shutdown }
116
- trap("QUIT") { shutdown }
116
+ %w(INT HUP TERM QUIT).each do |sig|
117
+ if Signal.list[sig]
118
+ Signal.trap(sig) do
119
+ shutdown
120
+ exit
121
+ end
122
+ end
123
+ end
117
124
  end
118
125
 
119
126
  # Initialize webrick
@@ -145,12 +152,13 @@ module Middleman
145
152
  # @param [Middleman::Application] app
146
153
  # @return [void]
147
154
  def mount_instance
155
+ @app = new_app
156
+
148
157
  @webrick ||= setup_webrick(
149
158
  @options[:host] || "0.0.0.0",
150
159
  @options[:debug] || false
151
160
  )
152
161
 
153
- @app = new_app
154
162
  start_file_watcher
155
163
 
156
164
  @webrick.mount "/", ::Rack::Handler::WEBrick, app.class.to_rack_app
@@ -60,8 +60,6 @@ module Middleman
60
60
  # @param [String, Regexp] path Path glob expression, or path regex
61
61
  # @return [void]
62
62
  def ignore(path=nil, &block)
63
- original_callback_size = @ignored_callbacks.size
64
-
65
63
  if path.is_a? Regexp
66
64
  @ignored_callbacks << Proc.new {|p| p =~ path }
67
65
  elsif path.is_a? String
@@ -74,40 +74,87 @@ module Middleman
74
74
  @_proxy_manager ||= ProxyManager.new(self)
75
75
  end
76
76
 
77
- def proxy(*args)
78
- proxy_manager.proxy(*args)
77
+ def proxy(*args, &block)
78
+ proxy_manager.proxy(*args, &block)
79
79
  end
80
80
  end
81
81
 
82
+ # Manages the list of proxy configurations and manipulates the sitemap
83
+ # to include new resources based on those configurations
82
84
  class ProxyManager
83
85
  def initialize(app)
84
86
  @app = app
85
-
86
- @proxy_paths = {}
87
+ @proxy_configs = Set.new
87
88
  end
88
89
 
89
90
  # Setup a proxy from a path to a target
90
91
  # @param [String] path
91
92
  # @param [String] target
93
+ # @param [Hash] opts options to apply to the proxy, including things like
94
+ # :locals, :ignore to hide the proxy target, :layout, and :directory_indexes.
92
95
  # @return [void]
93
- def proxy(path, target)
94
- @proxy_paths[::Middleman::Util.normalize_path(path)] = ::Middleman::Util.normalize_path(target)
96
+ def proxy(path, target, opts={}, &block)
97
+ metadata = { :options => {}, :locals => {}, :blocks => [] }
98
+ metadata[:blocks] << block if block_given?
99
+ metadata[:locals] = opts.delete(:locals) || {}
100
+
101
+ @app.ignore(target) if opts.delete(:ignore)
102
+ metadata[:options] = opts
103
+
104
+ @proxy_configs << ProxyConfiguration.new(:path => path, :target => target, :metadata => metadata)
105
+
95
106
  @app.sitemap.rebuild_resource_list!(:added_proxy)
96
107
  end
97
108
 
98
109
  # Update the main sitemap resource list
99
110
  # @return [void]
100
111
  def manipulate_resource_list(resources)
101
- resources + @proxy_paths.map do |key, value|
112
+ resources + @proxy_configs.map do |config|
102
113
  p = ::Middleman::Sitemap::Resource.new(
103
114
  @app.sitemap,
104
- key
115
+ config.path
105
116
  )
106
- p.proxy_to(value)
117
+ p.proxy_to(config.target)
118
+ p.add_metadata(config.metadata)
107
119
  p
108
120
  end
109
121
  end
110
122
  end
123
+
124
+ # Configuration for a proxy instance
125
+ class ProxyConfiguration
126
+ # The path that this proxy will appear at in the sitemap
127
+ attr_reader :path
128
+ def path=(p)
129
+ @path = ::Middleman::Util.normalize_path(p)
130
+ end
131
+
132
+ # The existing sitemap path that this will proxy to
133
+ attr_reader :target
134
+ def target=(t)
135
+ @target = ::Middleman::Util.normalize_path(t)
136
+ end
137
+
138
+ # Additional metadata like blocks and locals to apply to the proxy
139
+ attr_accessor :metadata
140
+
141
+ # Create a new proxy configuration from hash options
142
+ def initialize(options={})
143
+ options.each do |key, value|
144
+ send "#{key}=", value
145
+ end
146
+ end
147
+
148
+ # Two configurations are equal if they reference the same path
149
+ def eql?(other)
150
+ other.path == path
151
+ end
152
+
153
+ # Two configurations are equal if they reference the same path
154
+ def hash
155
+ path.hash
156
+ end
157
+ end
111
158
  end
112
159
  end
113
160
  end
@@ -1,5 +1,6 @@
1
1
  # Used for merging results of metadata callbacks
2
2
  require "active_support/core_ext/hash/deep_merge"
3
+ require 'monitor'
3
4
 
4
5
  module Middleman
5
6
 
@@ -25,6 +26,8 @@ module Middleman
25
26
  @_cached_metadata = {}
26
27
  @resource_list_manipulators = []
27
28
  @needs_sitemap_rebuild = true
29
+ @lock = Monitor.new
30
+
28
31
  reset_lookup_cache!
29
32
 
30
33
  # Register classes which can manipulate the main site map list
@@ -48,36 +51,44 @@ module Middleman
48
51
  # Rebuild the list of resources from scratch, using registed manipulators
49
52
  # @return [void]
50
53
  def rebuild_resource_list!(reason=nil)
51
- @needs_sitemap_rebuild = true
54
+ @lock.synchronize do
55
+ @needs_sitemap_rebuild = true
56
+ end
52
57
  end
53
58
 
54
59
  # Find a resource given its original path
55
60
  # @param [String] request_path The original path of a resource.
56
61
  # @return [Middleman::Sitemap::Resource]
57
62
  def find_resource_by_path(request_path)
58
- request_path = ::Middleman::Util.normalize_path(request_path)
59
- ensure_resource_list_updated!
60
- @_lookup_by_path[request_path]
63
+ @lock.synchronize do
64
+ request_path = ::Middleman::Util.normalize_path(request_path)
65
+ ensure_resource_list_updated!
66
+ @_lookup_by_path[request_path]
67
+ end
61
68
  end
62
69
 
63
70
  # Find a resource given its destination path
64
71
  # @param [String] request_path The destination (output) path of a resource.
65
72
  # @return [Middleman::Sitemap::Resource]
66
73
  def find_resource_by_destination_path(request_path)
67
- request_path = ::Middleman::Util.normalize_path(request_path)
68
- ensure_resource_list_updated!
69
- @_lookup_by_destination_path[request_path]
74
+ @lock.synchronize do
75
+ request_path = ::Middleman::Util.normalize_path(request_path)
76
+ ensure_resource_list_updated!
77
+ @_lookup_by_destination_path[request_path]
78
+ end
70
79
  end
71
80
 
72
81
  # Get the array of all resources
73
82
  # @param [Boolean] include_ignored Whether to include ignored resources
74
83
  # @return [Array<Middleman::Sitemap::Resource>]
75
84
  def resources(include_ignored=false)
76
- ensure_resource_list_updated!
77
- if include_ignored
78
- @resources
79
- else
80
- @resources.reject(&:ignored?)
85
+ @lock.synchronize do
86
+ ensure_resource_list_updated!
87
+ if include_ignored
88
+ @resources
89
+ else
90
+ @resources.reject(&:ignored?)
91
+ end
81
92
  end
82
93
  end
83
94
 
@@ -115,19 +126,10 @@ module Middleman
115
126
  # @param [Symbol] origin an indicator of where this metadata came from - only one
116
127
  # block per [matcher, origin] pair may exist.
117
128
  # @return [Array<Array<Proc, Regexp>>]
118
- def provides_metadata_for_path(matcher=nil, origin=nil, &block)
129
+ def provides_metadata_for_path(matcher=nil, &block)
119
130
  @_provides_metadata_for_path ||= []
120
131
  if block_given?
121
- if origin
122
- existing_provider = @_provides_metadata_for_path.find {|b,m,o| o == origin && m == matcher}
123
- end
124
-
125
- if existing_provider
126
- existing_provider[0] = block
127
- else
128
- @_provides_metadata_for_path << [block, matcher, origin]
129
- end
130
-
132
+ @_provides_metadata_for_path << [block, matcher]
131
133
  @_cached_metadata = {}
132
134
  end
133
135
  @_provides_metadata_for_path
@@ -151,10 +153,7 @@ module Middleman
151
153
 
152
154
  metadata = callback.call(request_path)
153
155
 
154
- if metadata.has_key?(:blocks)
155
- result[:blocks] << metadata[:blocks]
156
- metadata.delete(:blocks)
157
- end
156
+ result[:blocks] += Array(metadata.delete(:blocks))
158
157
 
159
158
  result.deep_merge(metadata)
160
159
  end
@@ -213,30 +212,34 @@ module Middleman
213
212
  # rebuild_resource_list! since the last time it was run. This is
214
213
  # very expensive!
215
214
  def ensure_resource_list_updated!
216
- return unless @needs_sitemap_rebuild
217
- @needs_sitemap_rebuild = false
215
+ @lock.synchronize do
216
+ return unless @needs_sitemap_rebuild
217
+ @needs_sitemap_rebuild = false
218
218
 
219
- @app.logger.debug "== Rebuilding resource list"
219
+ @app.logger.debug "== Rebuilding resource list"
220
220
 
221
- @resources = @resource_list_manipulators.inject([]) do |result, (_, inst)|
222
- newres = inst.manipulate_resource_list(result)
221
+ @resources = @resource_list_manipulators.inject([]) do |result, (_, inst)|
222
+ newres = inst.manipulate_resource_list(result)
223
223
 
224
- # Reset lookup cache
225
- reset_lookup_cache!
226
- newres.each do |resource|
227
- @_lookup_by_path[resource.path] = resource
228
- @_lookup_by_destination_path[resource.destination_path] = resource
229
- end
224
+ # Reset lookup cache
225
+ reset_lookup_cache!
226
+ newres.each do |resource|
227
+ @_lookup_by_path[resource.path] = resource
228
+ @_lookup_by_destination_path[resource.destination_path] = resource
229
+ end
230
230
 
231
- newres
231
+ newres
232
+ end
232
233
  end
233
234
  end
234
235
 
235
236
  private
236
237
 
237
238
  def reset_lookup_cache!
238
- @_lookup_by_path = {}
239
- @_lookup_by_destination_path = {}
239
+ @lock.synchronize {
240
+ @_lookup_by_path = {}
241
+ @_lookup_by_destination_path = {}
242
+ }
240
243
  end
241
244
  end
242
245
  end
@@ -1,11 +1,11 @@
1
- /*! normalize.css 2011-11-04T15:38 UTC - http://github.com/necolas/normalize.css */
1
+ /*! normalize.css v2.0.1 | MIT License | git.io/normalize */
2
2
 
3
- /* =============================================================================
3
+ /* ==========================================================================
4
4
  HTML5 display definitions
5
5
  ========================================================================== */
6
6
 
7
7
  /*
8
- * Corrects block display not defined in IE6/7/8/9 & FF3
8
+ * Corrects `block` display not defined in IE 8/9.
9
9
  */
10
10
 
11
11
  article,
@@ -17,86 +17,69 @@ footer,
17
17
  header,
18
18
  hgroup,
19
19
  nav,
20
- section {
20
+ section,
21
+ summary {
21
22
  display: block;
22
23
  }
23
24
 
24
25
  /*
25
- * Corrects inline-block display not defined in IE6/7/8/9 & FF3
26
+ * Corrects `inline-block` display not defined in IE 8/9.
26
27
  */
27
28
 
28
29
  audio,
29
30
  canvas,
30
31
  video {
31
32
  display: inline-block;
32
- *display: inline;
33
- *zoom: 1;
34
33
  }
35
34
 
36
35
  /*
37
- * Prevents modern browsers from displaying 'audio' without controls
36
+ * Prevents modern browsers from displaying `audio` without controls.
37
+ * Remove excess height in iOS 5 devices.
38
38
  */
39
39
 
40
40
  audio:not([controls]) {
41
41
  display: none;
42
+ height: 0;
42
43
  }
43
44
 
44
45
  /*
45
- * Addresses styling for 'hidden' attribute not present in IE7/8/9, FF3, S4
46
- * Known issue: no IE6 support
46
+ * Addresses styling for `hidden` attribute not present in IE 8/9.
47
47
  */
48
48
 
49
49
  [hidden] {
50
50
  display: none;
51
51
  }
52
52
 
53
-
54
- /* =============================================================================
53
+ /* ==========================================================================
55
54
  Base
56
55
  ========================================================================== */
57
56
 
58
57
  /*
59
- * 1. Corrects text resizing oddly in IE6/7 when body font-size is set using em units
60
- * http://clagnut.com/blog/348/#c790
61
- * 2. Keeps page centred in all browsers regardless of content height
62
- * 3. Prevents iOS text size adjust after orientation change, without disabling user zoom
63
- * www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/
58
+ * 1. Sets default font family to sans-serif.
59
+ * 2. Prevents iOS text size adjust after orientation change, without disabling
60
+ * user zoom.
64
61
  */
65
62
 
66
63
  html {
67
- font-size: 100%; /* 1 */
68
- overflow-y: scroll; /* 2 */
69
- -webkit-text-size-adjust: 100%; /* 3 */
70
- -ms-text-size-adjust: 100%; /* 3 */
64
+ font-family: sans-serif; /* 1 */
65
+ -webkit-text-size-adjust: 100%; /* 2 */
66
+ -ms-text-size-adjust: 100%; /* 2 */
71
67
  }
72
68
 
73
69
  /*
74
- * Addresses margins handled incorrectly in IE6/7
70
+ * Removes default margin.
75
71
  */
76
72
 
77
73
  body {
78
74
  margin: 0;
79
75
  }
80
76
 
81
- /*
82
- * Addresses font-family inconsistency between 'textarea' and other form elements.
83
- */
84
-
85
- body,
86
- button,
87
- input,
88
- select,
89
- textarea {
90
- font-family: sans-serif;
91
- }
92
-
93
-
94
- /* =============================================================================
77
+ /* ==========================================================================
95
78
  Links
96
79
  ========================================================================== */
97
80
 
98
81
  /*
99
- * Addresses outline displayed oddly in Chrome
82
+ * Addresses `outline` inconsistency between Chrome and other browsers.
100
83
  */
101
84
 
102
85
  a:focus {
@@ -104,22 +87,21 @@ a:focus {
104
87
  }
105
88
 
106
89
  /*
107
- * Improves readability when focused and also mouse hovered in all browsers
108
- * people.opera.com/patrickl/experiments/keyboard/test
90
+ * Improves readability when focused and also mouse hovered in all browsers.
109
91
  */
110
92
 
111
- a:hover,
112
- a:active {
93
+ a:active,
94
+ a:hover {
113
95
  outline: 0;
114
96
  }
115
97
 
116
-
117
- /* =============================================================================
98
+ /* ==========================================================================
118
99
  Typography
119
100
  ========================================================================== */
120
101
 
121
102
  /*
122
- * Neutralise smaller font-size in 'section' and 'article' in FF4+, Chrome, S5
103
+ * Addresses `h1` font sizes within `section` and `article` in Firefox 4+,
104
+ * Safari 5, and Chrome.
123
105
  */
124
106
 
125
107
  h1 {
@@ -127,7 +109,7 @@ h1 {
127
109
  }
128
110
 
129
111
  /*
130
- * Addresses styling not present in IE7/8/9, S5, Chrome
112
+ * Addresses styling not present in IE 8/9, Safari 5, and Chrome.
131
113
  */
132
114
 
133
115
  abbr[title] {
@@ -135,20 +117,16 @@ abbr[title] {
135
117
  }
136
118
 
137
119
  /*
138
- * Addresses style set to 'bolder' in FF3+, S4/5, Chrome
139
- */
140
-
141
- b,
142
- strong {
143
- font-weight: bold;
144
- }
120
+ * Addresses style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
121
+ */
145
122
 
146
- blockquote {
147
- margin: 1em 40px;
123
+ b,
124
+ strong {
125
+ font-weight: bold;
148
126
  }
149
127
 
150
128
  /*
151
- * Addresses styling not present in S5, Chrome
129
+ * Addresses styling not present in Safari 5 and Chrome.
152
130
  */
153
131
 
154
132
  dfn {
@@ -156,7 +134,7 @@ dfn {
156
134
  }
157
135
 
158
136
  /*
159
- * Addresses styling not present in IE6/7/8/9
137
+ * Addresses styling not present in IE 8/9.
160
138
  */
161
139
 
162
140
  mark {
@@ -164,22 +142,21 @@ mark {
164
142
  color: #000;
165
143
  }
166
144
 
145
+
167
146
  /*
168
- * Corrects font family set oddly in IE6, S4/5, Chrome
169
- * en.wikipedia.org/wiki/User:Davidgothberg/Test59
147
+ * Corrects font family set oddly in Safari 5 and Chrome.
170
148
  */
171
149
 
172
- pre,
173
150
  code,
174
151
  kbd,
152
+ pre,
175
153
  samp {
176
154
  font-family: monospace, serif;
177
- _font-family: 'courier new', monospace;
178
155
  font-size: 1em;
179
156
  }
180
157
 
181
158
  /*
182
- * Improves readability of pre-formatted text in all browsers
159
+ * Improves readability of pre-formatted text in all browsers.
183
160
  */
184
161
 
185
162
  pre {
@@ -189,31 +166,23 @@ pre {
189
166
  }
190
167
 
191
168
  /*
192
- * 1. Addresses CSS quotes not supported in IE6/7
193
- * 2. Addresses quote property not supported in S4
169
+ * Sets consistent quote types.
194
170
  */
195
171
 
196
- /* 1 */
197
-
198
172
  q {
199
- quotes: none;
173
+ quotes: "\201C" "\201D" "\2018" "\2019";
200
174
  }
201
175
 
202
- /* 2 */
203
-
204
- q:before,
205
- q:after {
206
- content: '';
207
- content: none;
208
- }
176
+ /*
177
+ * Addresses inconsistent and variable font size in all browsers.
178
+ */
209
179
 
210
180
  small {
211
- font-size: 75%;
181
+ font-size: 80%;
212
182
  }
213
183
 
214
184
  /*
215
- * Prevents sub and sup affecting line-height in all browsers
216
- * gist.github.com/413930
185
+ * Prevents `sub` and `sup` affecting `line-height` in all browsers.
217
186
  */
218
187
 
219
188
  sub,
@@ -232,79 +201,44 @@ sub {
232
201
  bottom: -0.25em;
233
202
  }
234
203
 
235
-
236
- /* =============================================================================
237
- Lists
238
- ========================================================================== */
239
-
240
- ul,
241
- ol {
242
- margin-left: 0;
243
- padding: 0 0 0 40px;
244
- }
245
-
246
- dd {
247
- margin: 0 0 0 40px;
248
- }
249
-
250
- nav ul,
251
- nav ol {
252
- list-style: none;
253
- list-style-image: none;
254
- }
255
-
256
-
257
- /* =============================================================================
204
+ /* ==========================================================================
258
205
  Embedded content
259
206
  ========================================================================== */
260
207
 
261
208
  /*
262
- * 1. Removes border when inside 'a' element in IE6/7/8/9, FF3
263
- * 2. Improves image quality when scaled in IE7
264
- * code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/
209
+ * Removes border when inside `a` element in IE 8/9.
265
210
  */
266
211
 
267
212
  img {
268
- border: 0; /* 1 */
269
- -ms-interpolation-mode: bicubic; /* 2 */
213
+ border: 0;
270
214
  }
271
215
 
272
216
  /*
273
- * Corrects overflow displayed oddly in IE9
217
+ * Corrects overflow displayed oddly in IE 9.
274
218
  */
275
219
 
276
220
  svg:not(:root) {
277
221
  overflow: hidden;
278
222
  }
279
223
 
280
-
281
- /* =============================================================================
224
+ /* ==========================================================================
282
225
  Figures
283
226
  ========================================================================== */
284
227
 
285
228
  /*
286
- * Addresses margin not present in IE6/7/8/9, S5, O11
229
+ * Addresses margin not present in IE 8/9 and Safari 5.
287
230
  */
288
231
 
289
232
  figure {
290
233
  margin: 0;
291
234
  }
292
235
 
293
-
294
- /* =============================================================================
236
+ /* ==========================================================================
295
237
  Forms
296
238
  ========================================================================== */
297
239
 
298
240
  /*
299
- * Corrects margin displayed oddly in IE6/7
300
- */
301
-
302
- form {
303
- margin: 0;
304
- }
305
-
306
- /*
307
- * Define consistent border, margin, and padding
241
+ * Define consistent border, margin, and padding.
308
242
  */
309
243
 
310
244
  fieldset {
@@ -314,59 +248,68 @@ fieldset {
314
248
  }
315
249
 
316
250
  /*
317
- * 1. Corrects color not being inherited in IE6/7/8/9
318
- * 2. Corrects alignment displayed oddly in IE6/7
251
+ * 1. Corrects color not being inherited in IE 8/9.
252
+ * 2. Remove padding so people aren't caught out if they zero out fieldsets.
319
253
  */
320
254
 
321
255
  legend {
322
256
  border: 0; /* 1 */
323
- *margin-left: -7px; /* 2 */
257
+ padding: 0; /* 2 */
324
258
  }
325
259
 
326
260
  /*
327
- * 1. Corrects font size not being inherited in all browsers
328
- * 2. Addresses margins set differently in IE6/7, FF3+, S5, Chrome
329
- * 3. Improves appearance and consistency in all browsers
261
+ * 1. Corrects font family not being inherited in all browsers.
262
+ * 2. Corrects font size not being inherited in all browsers.
263
+ * 3. Addresses margins set differently in Firefox 4+, Safari 5, and Chrome
330
264
  */
331
265
 
332
266
  button,
333
267
  input,
334
268
  select,
335
269
  textarea {
336
- font-size: 100%; /* 1 */
337
- margin: 0; /* 2 */
338
- vertical-align: baseline; /* 3 */
339
- *vertical-align: middle; /* 3 */
270
+ font-family: inherit; /* 1 */
271
+ font-size: 100%; /* 2 */
272
+ margin: 0; /* 3 */
340
273
  }
341
274
 
342
275
  /*
343
- * Addresses FF3/4 setting line-height on 'input' using !important in the UA stylesheet
276
+ * Addresses Firefox 4+ setting `line-height` on `input` using `!important` in
277
+ * the UA stylesheet.
344
278
  */
345
279
 
346
280
  button,
347
281
  input {
348
- line-height: normal; /* 1 */
282
+ line-height: normal;
349
283
  }
350
284
 
351
285
  /*
352
- * 1. Improves usability and consistency of cursor style between image-type 'input' and others
353
- * 2. Corrects inability to style clickable 'input' types in iOS
354
- * 3. Removes inner spacing in IE7 without affecting normal text inputs
355
- * Known issue: inner spacing remains in IE6
286
+ * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
287
+ * and `video` controls.
288
+ * 2. Corrects inability to style clickable `input` types in iOS.
289
+ * 3. Improves usability and consistency of cursor style between image-type
290
+ * `input` and others.
356
291
  */
357
292
 
358
293
  button,
359
- input[type="button"],
360
- input[type="reset"],
294
+ html input[type="button"], /* 1 */
295
+ input[type="reset"],
361
296
  input[type="submit"] {
362
- cursor: pointer; /* 1 */
363
297
  -webkit-appearance: button; /* 2 */
364
- *overflow: visible; /* 3 */
298
+ cursor: pointer; /* 3 */
365
299
  }
366
300
 
367
301
  /*
368
- * 1. Addresses box sizing set to content-box in IE8/9
369
- * 2. Removes excess padding in IE8/9
302
+ * Re-set default cursor for disabled elements.
303
+ */
304
+
305
+ button[disabled],
306
+ input[disabled] {
307
+ cursor: default;
308
+ }
309
+
310
+ /*
311
+ * 1. Addresses box sizing set to `content-box` in IE 8/9.
312
+ * 2. Removes excess padding in IE 8/9.
370
313
  */
371
314
 
372
315
  input[type="checkbox"],
@@ -376,8 +319,9 @@ input[type="radio"] {
376
319
  }
377
320
 
378
321
  /*
379
- * 1. Addresses appearance set to searchfield in S5, Chrome
380
- * 2. Addresses box-sizing set to border-box in S5, Chrome (include -moz to future-proof)
322
+ * 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome.
323
+ * 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome
324
+ * (include `-moz` to future-proof).
381
325
  */
382
326
 
383
327
  input[type="search"] {
@@ -388,16 +332,17 @@ input[type="search"] {
388
332
  }
389
333
 
390
334
  /*
391
- * Removes inner padding that is displayed in S5, Chrome on OS X
335
+ * Removes inner padding and search cancel button in Safari 5 and Chrome
336
+ * on OS X.
392
337
  */
393
338
 
339
+ input[type="search"]::-webkit-search-cancel-button,
394
340
  input[type="search"]::-webkit-search-decoration {
395
341
  -webkit-appearance: none;
396
342
  }
397
343
 
398
344
  /*
399
- * Removes inner padding and border in FF3+
400
- * www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/
345
+ * Removes inner padding and border in Firefox 4+.
401
346
  */
402
347
 
403
348
  button::-moz-focus-inner,
@@ -407,8 +352,8 @@ input::-moz-focus-inner {
407
352
  }
408
353
 
409
354
  /*
410
- * 1. Removes default vertical scrollbar in IE6/7/8/9
411
- * 2. Improves readability and alignment in all browsers
355
+ * 1. Removes default vertical scrollbar in IE 8/9.
356
+ * 2. Improves readability and alignment in all browsers.
412
357
  */
413
358
 
414
359
  textarea {
@@ -416,16 +361,15 @@ textarea {
416
361
  vertical-align: top; /* 2 */
417
362
  }
418
363
 
419
-
420
- /* =============================================================================
364
+ /* ==========================================================================
421
365
  Tables
422
366
  ========================================================================== */
423
367
 
424
- /*
425
- * Remove most spacing between table cells
368
+ /*
369
+ * Remove most spacing between table cells.
426
370
  */
427
371
 
428
372
  table {
429
373
  border-collapse: collapse;
430
374
  border-spacing: 0;
431
- }
375
+ }
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  # Current Version
3
3
  # @return [String]
4
- VERSION = '3.0.5' unless const_defined?(:VERSION)
4
+ VERSION = '3.0.6' unless const_defined?(:VERSION)
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.5
4
+ version: 3.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-09-24 00:00:00.000000000 Z
13
+ date: 2012-10-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -195,12 +195,14 @@ files:
195
195
  - features/instance_vars.feature
196
196
  - features/mount_rack.feature
197
197
  - features/preview_changes.feature
198
+ - features/proxy_pages.feature
198
199
  - features/request_params.feature
199
200
  - features/sitemap_traversal.feature
200
201
  - features/static_server.feature
201
202
  - features/step_definitions/page_layout_steps.rb
202
203
  - features/strip_url.feature
203
204
  - features/support/env.rb
205
+ - features/tilde_directories.feature
204
206
  - features/unicode_filenames.feature
205
207
  - features/wildcard_page_helper.feature
206
208
  - fixtures/automatic-directory-matcher-app/config.rb
@@ -366,6 +368,14 @@ files:
366
368
  - fixtures/preview-app/config.rb
367
369
  - fixtures/preview-app/source/content.html.erb
368
370
  - fixtures/preview-app/source/layout.erb
371
+ - fixtures/proxy-pages-app/config.rb
372
+ - fixtures/proxy-pages-app/source/real.html
373
+ - fixtures/proxy-pages-app/source/real/index-ivars.html.erb
374
+ - fixtures/proxy-pages-app/source/real/index.html.erb
375
+ - fixtures/proxy-pages-app/source/should_be_ignored3.html
376
+ - fixtures/proxy-pages-app/source/should_be_ignored6.html
377
+ - fixtures/proxy-pages-app/source/should_be_ignored7.html
378
+ - fixtures/proxy-pages-app/source/should_be_ignored8.html
369
379
  - fixtures/request-app/config.rb
370
380
  - fixtures/request-app/source/index.html.erb
371
381
  - fixtures/sinatra-app/config.rb
@@ -585,7 +595,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
585
595
  version: '0'
586
596
  segments:
587
597
  - 0
588
- hash: -2720475402935195824
598
+ hash: -3834291849307720462
589
599
  required_rubygems_version: !ruby/object:Gem::Requirement
590
600
  none: false
591
601
  requirements:
@@ -594,10 +604,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
594
604
  version: '0'
595
605
  segments:
596
606
  - 0
597
- hash: -2720475402935195824
607
+ hash: -3834291849307720462
598
608
  requirements: []
599
609
  rubyforge_project:
600
- rubygems_version: 1.8.24
610
+ rubygems_version: 1.8.23
601
611
  signing_key:
602
612
  specification_version: 3
603
613
  summary: Hand-crafted frontend development
@@ -625,12 +635,14 @@ test_files:
625
635
  - features/instance_vars.feature
626
636
  - features/mount_rack.feature
627
637
  - features/preview_changes.feature
638
+ - features/proxy_pages.feature
628
639
  - features/request_params.feature
629
640
  - features/sitemap_traversal.feature
630
641
  - features/static_server.feature
631
642
  - features/step_definitions/page_layout_steps.rb
632
643
  - features/strip_url.feature
633
644
  - features/support/env.rb
645
+ - features/tilde_directories.feature
634
646
  - features/unicode_filenames.feature
635
647
  - features/wildcard_page_helper.feature
636
648
  - fixtures/automatic-directory-matcher-app/config.rb
@@ -796,6 +808,14 @@ test_files:
796
808
  - fixtures/preview-app/config.rb
797
809
  - fixtures/preview-app/source/content.html.erb
798
810
  - fixtures/preview-app/source/layout.erb
811
+ - fixtures/proxy-pages-app/config.rb
812
+ - fixtures/proxy-pages-app/source/real.html
813
+ - fixtures/proxy-pages-app/source/real/index-ivars.html.erb
814
+ - fixtures/proxy-pages-app/source/real/index.html.erb
815
+ - fixtures/proxy-pages-app/source/should_be_ignored3.html
816
+ - fixtures/proxy-pages-app/source/should_be_ignored6.html
817
+ - fixtures/proxy-pages-app/source/should_be_ignored7.html
818
+ - fixtures/proxy-pages-app/source/should_be_ignored8.html
799
819
  - fixtures/request-app/config.rb
800
820
  - fixtures/request-app/source/index.html.erb
801
821
  - fixtures/sinatra-app/config.rb