update more files to non-hashrocket syntax

remove_hooks
Thomas Reynolds 2014-05-26 17:58:35 -07:00
parent 7108c29035
commit c2512e9093
48 changed files with 180 additions and 185 deletions

View File

@ -1,7 +1,7 @@
# CLI Module
module Middleman::Cli
# Alias "c" to "console"
Base.map('c' => 'console')
Base.map(c: 'console')
# The CLI Console class
class Console < Thor

View File

@ -15,13 +15,10 @@ module Middleman::Cli
default: 'default',
desc: "Use a project template: #{available_templates}"
method_option 'css_dir',
# :default => "stylesheets",
desc: 'The path to the css files'
method_option 'js_dir',
# :default => "javascripts",
desc: 'The path to the javascript files'
method_option 'images_dir',
# :default => "images",
desc: 'The path to the image files'
method_option 'rack',
type: :boolean,
@ -55,8 +52,8 @@ module Middleman::Cli
# Map "i", "new" and "n" to "init"
Base.map(
'i' => 'init',
'new' => 'init',
'n' => 'init'
'i' => 'init',
'new' => 'init',
'n' => 'init'
)
end

View File

@ -109,7 +109,7 @@ Feature: Assets get a file hash appended to their and references to them are upd
Given a fixture app "asset-hash-app"
And a file named "config.rb" with:
"""
activate :asset_hash, :ignore => [%r(javascripts/*), 'images/*']
activate :asset_hash, ignore: [%r(javascripts/*), 'images/*']
activate :relative_assets
activate :directory_indexes
"""

View File

@ -33,7 +33,7 @@ Feature: Alternate between multiple asset hosts
Given a fixture app "asset-host-app"
And a file named "config.rb" with:
"""
activate :asset_host, :host => "http://assets1.example.com"
activate :asset_host, host: "http://assets1.example.com"
"""
And the Server is running
When I go to "/asset_host.html"
@ -45,7 +45,7 @@ Feature: Alternate between multiple asset hosts
Given a fixture app "asset-host-app"
And a file named "config.rb" with:
"""
activate :asset_host, :host => Proc.new { |asset|
activate :asset_host, host: Proc.new { |asset|
"http://assets%d.example.com" % (asset.hash % 4)
}
"""

View File

@ -17,8 +17,8 @@ Feature: Setting the right content type for files
Given a fixture app "content-type-app"
And a file named "config.rb" with:
"""
page "README", :content_type => 'text/awesome'
proxy "bar", "index.html", :content_type => 'text/custom'
page "README", content_type: 'text/awesome'
proxy "bar", "index.html", content_type: 'text/custom'
proxy "foo", "README" # auto-delegate to target content type
"""
And the Server is running at "content-type-app"

View File

@ -5,8 +5,8 @@ Feature: content_tag helper
And an empty file named "config.rb"
And a file named "source/index.html.erb" with:
"""
<%= content_tag :div, "<hello>world</hello>", :class => 'one' %>
<% content_tag :where, :class => 'the hell is' do %>
<%= content_tag :div, "<hello>world</hello>", class: 'one' %>
<% content_tag :where, class: 'the hell is' do %>
<my>damn croissant</my>
<% end %>
"""

View File

@ -5,16 +5,16 @@ Feature: form_tag helper
And an empty file named "config.rb"
And a file named "source/form_tag.html.erb" with:
"""
absolute: <% form_tag "/needs_index.html#absolute", :relative => true do %>
absolute: <% form_tag "/needs_index.html#absolute", relative: true do %>
<% end %>
relative: <% form_tag "needs_index.html#relative", :relative => true do %>
relative: <% form_tag "needs_index.html#relative", relative: true do %>
<% end %>
"""
And a file named "source/form_tag/sub.html.erb" with:
"""
absolute: <% form_tag "/needs_index.html#absolute", :relative => true do %>
absolute: <% form_tag "/needs_index.html#absolute", relative: true do %>
<% end %>
relative: <% form_tag "../needs_index.html#relative", :relative => true do %>
relative: <% form_tag "../needs_index.html#relative", relative: true do %>
<% end %>
"""
And the Server is running at "indexable-app"

View File

@ -20,13 +20,13 @@ Feature: link_to helper
And an empty file named "config.rb"
And a file named "source/link_to.html.erb" with:
"""
absolute: <%= link_to "Needs Index", "/needs_index.html", :relative => true %>
relative: <%= link_to "Relative", "needs_index.html", :relative => true %>
absolute: <%= link_to "Needs Index", "/needs_index.html", relative: true %>
relative: <%= link_to "Relative", "needs_index.html", relative: true %>
"""
And a file named "source/link_to/sub.html.erb" with:
"""
absolute: <%= link_to "Needs Index", "/needs_index.html", :relative => true %>
relative: <%= link_to "Relative", "../needs_index.html", :relative => true %>
absolute: <%= link_to "Needs Index", "/needs_index.html", relative: true %>
relative: <%= link_to "Relative", "../needs_index.html", relative: true %>
"""
And the Server is running at "indexable-app"
When I go to "/link_to.html"
@ -79,7 +79,7 @@ Feature: link_to helper
And a file named "source/link_to.html.erb" with:
"""
absolute: <%= link_to "Needs Index", "/needs_index.html" %>
relative: <%= link_to "Relative", "needs_index.html", :relative => false %>
relative: <%= link_to "Relative", "needs_index.html", relative: false %>
unknown: <%= link_to "Unknown", "foo.html" %>
"""
And a file named "source/link_to/sub.html.erb" with:
@ -100,13 +100,13 @@ Feature: link_to helper
Given a fixture app "indexable-app"
And a file named "source/link_to.html.erb" with:
"""
absolute: <%= link_to "Needs Index", "/needs_index.html", :relative => true %>
relative: <%= link_to "Relative", "needs_index.html", :relative => true %>
absolute: <%= link_to "Needs Index", "/needs_index.html", relative: true %>
relative: <%= link_to "Relative", "needs_index.html", relative: true %>
"""
And a file named "source/link_to/sub.html.erb" with:
"""
absolute: <%= link_to "Needs Index", "/needs_index.html", :relative => true %>
relative: <%= link_to "Relative", "../needs_index.html", :relative => true %>
absolute: <%= link_to "Needs Index", "/needs_index.html", relative: true %>
relative: <%= link_to "Relative", "../needs_index.html", relative: true %>
"""
And the Server is running at "indexable-app"
When I go to "/link_to/"
@ -158,8 +158,8 @@ Feature: link_to helper
Given a fixture app "indexable-app"
And a file named "source/link_to.html.erb" with:
"""
<%= link_to "Needs Index String", "/needs_index.html", :query => "foo" %>
<%= link_to "Needs Index Hash", "/needs_index.html", :query => { :foo => :bar } %>
<%= link_to "Needs Index String", "/needs_index.html", query: "foo" %>
<%= link_to "Needs Index Hash", "/needs_index.html", query: { foo: :bar } %>
"""
And the Server is running at "indexable-app"
When I go to "/link_to/"

View File

@ -5,13 +5,13 @@ Feature: url_for helper
And an empty file named "config.rb"
And a file named "source/url_for.html.erb" with:
"""
absolute: <%= url_for "/needs_index.html", :relative => true %>
relative: <%= url_for "needs_index.html", :relative => true %>
absolute: <%= url_for "/needs_index.html", relative: true %>
relative: <%= url_for "needs_index.html", relative: true %>
"""
And a file named "source/url_for/sub.html.erb" with:
"""
absolute: <%= url_for "/needs_index.html", :relative => true %>
relative: <%= url_for "../needs_index.html", :relative => true %>
absolute: <%= url_for "/needs_index.html", relative: true %>
relative: <%= url_for "../needs_index.html", relative: true %>
"""
And the Server is running at "indexable-app"
When I go to "/url_for.html"
@ -64,7 +64,7 @@ Feature: url_for helper
And a file named "source/url_for.html.erb" with:
"""
absolute: <%= url_for "/needs_index.html" %>
relative: <%= url_for "needs_index.html", :relative => false %>
relative: <%= url_for "needs_index.html", relative: false %>
unknown: <%= url_for "foo.html" %>
"""
And a file named "source/url_for/sub.html.erb" with:
@ -85,13 +85,13 @@ Feature: url_for helper
Given a fixture app "indexable-app"
And a file named "source/url_for.html.erb" with:
"""
absolute: <%= url_for "/needs_index.html", :relative => true %>
relative: <%= url_for "needs_index.html", :relative => true %>
absolute: <%= url_for "/needs_index.html", relative: true %>
relative: <%= url_for "needs_index.html", relative: true %>
"""
And a file named "source/url_for/sub.html.erb" with:
"""
absolute: <%= url_for "/needs_index.html", :relative => true %>
relative: <%= url_for "../needs_index.html", :relative => true %>
absolute: <%= url_for "/needs_index.html", relative: true %>
relative: <%= url_for "../needs_index.html", relative: true %>
"""
And the Server is running at "indexable-app"
When I go to "/url_for/"
@ -143,8 +143,8 @@ Feature: url_for helper
Given a fixture app "indexable-app"
And a file named "source/url_for.html.erb" with:
"""
Needs Index String <%= url_for "/needs_index.html", :query => "foo" %>
Needs Index Hash <%= url_for "/needs_index.html", :query => { :foo => :bar } %>
Needs Index String <%= url_for "/needs_index.html", query: "foo" %>
Needs Index Hash <%= url_for "/needs_index.html", query: { foo: :bar } %>
"""
And the Server is running at "indexable-app"
When I go to "/url_for/"

View File

@ -49,7 +49,7 @@ Feature: i18n Builder
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, :path => "/lang_:locale/"
activate :i18n, path: "/lang_:locale/"
"""
Given a successfully built app at "i18n-test-app"
When I cd to "build"
@ -69,7 +69,7 @@ Feature: i18n Builder
Given a fixture app "i18n-alt-root-app"
And a file named "config.rb" with:
"""
activate :i18n, :templates_dir => "lang_data"
activate :i18n, templates_dir: "lang_data"
"""
Given a successfully built app at "i18n-alt-root-app"
When I cd to "build"
@ -89,7 +89,7 @@ Feature: i18n Builder
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, :lang_map => { :en => :english, :es => :spanish }
activate :i18n, lang_map: { en: :english, es: :spanish }
"""
Given a successfully built app at "i18n-test-app"
When I cd to "build"
@ -109,7 +109,7 @@ Feature: i18n Builder
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, :mount_at_root => false
activate :i18n, mount_at_root: false
"""
Given a successfully built app at "i18n-test-app"
When I cd to "build"
@ -130,7 +130,7 @@ Feature: i18n Builder
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, :langs => [:en]
activate :i18n, langs: [:en]
"""
Given a successfully built app at "i18n-test-app"
When I cd to "build"

View File

@ -67,7 +67,7 @@ Feature: i18n Preview
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, :path => "/lang_:locale/"
activate :i18n, path: "/lang_:locale/"
"""
Given the Server is running at "i18n-test-app"
When I go to "/"
@ -86,7 +86,7 @@ Feature: i18n Preview
Given a fixture app "i18n-alt-root-app"
And a file named "config.rb" with:
"""
activate :i18n, :templates_dir => "lang_data"
activate :i18n, templates_dir: "lang_data"
"""
Given the Server is running at "i18n-alt-root-app"
When I go to "/"
@ -104,7 +104,7 @@ Feature: i18n Preview
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, :lang_map => { :en => :english, :es => :spanish }
activate :i18n, lang_map: { en: :english, es: :spanish }
"""
Given the Server is running at "i18n-test-app"
When I go to "/"
@ -122,7 +122,7 @@ Feature: i18n Preview
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, :mount_at_root => :es
activate :i18n, mount_at_root: :es
"""
Given the Server is running at "i18n-test-app"
When I go to "/en/index.html"
@ -150,7 +150,7 @@ Feature: i18n Preview
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, :langs => :es
activate :i18n, langs: :es
"""
Given the Server is running at "i18n-test-app"
When I go to "/en/index.html"
@ -173,7 +173,7 @@ Feature: i18n Preview
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, :mount_at_root => false
activate :i18n, mount_at_root: false
"""
Given the Server is running at "i18n-test-app"
When I go to "/en/index.html"
@ -193,7 +193,7 @@ Feature: i18n Preview
Given a fixture app "i18n-test-app"
And a file named "config.rb" with:
"""
activate :i18n, :langs => [:en]
activate :i18n, langs: [:en]
"""
Given the Server is running at "i18n-test-app"
When I go to "/"
@ -228,7 +228,7 @@ Feature: i18n Preview
Given a fixture app "i18n-default-app"
And a file named "config.rb" with:
"""
activate :i18n, :mount_at_root => :es
activate :i18n, mount_at_root: :es
"""
Given the Server is running at "i18n-default-app"
When I go to "/en/"

View File

@ -6,7 +6,7 @@ Feature: Markdown (Kramdown) support
And a file named "config.rb" with:
"""
set :markdown_engine, :kramdown
set :markdown, :smartypants => true
set :markdown, smartypants: true
"""
Given the Server is running at "markdown-app"
When I go to "/smarty_pants.html"

View File

@ -7,14 +7,14 @@ Feature: Markdown (Redcarpet) support
And a file named "config.rb" with:
"""
set :markdown_engine, :redcarpet
set :markdown, :no_intra_emphasis => true,
:tables => true,
:fenced_code_blocks => true,
:autolink => true,
:strikethrough => true,
:space_after_headers => true,
:superscript => true,
:lax_spacing => true
set :markdown, no_intra_emphasis: true,
tables: true,
fenced_code_blocks: true,
autolink: true,
strikethrough: true,
space_after_headers: true,
superscript: true,
lax_spacing: true
"""
Given the Server is running at "markdown-app"
@ -42,9 +42,9 @@ Feature: Markdown (Redcarpet) support
And a file named "config.rb" with:
"""
set :markdown_engine, :redcarpet
set :markdown, :underline => true,
:highlight => true,
:disable_indented_code_blocks => true
set :markdown, underline: true,
highlight: true,
disable_indented_code_blocks: true
"""
Given the Server is running at "markdown-app"
When I go to "/underline.html"
@ -59,7 +59,7 @@ Feature: Markdown (Redcarpet) support
And a file named "config.rb" with:
"""
set :markdown_engine, :redcarpet
set :markdown, :smartypants => true
set :markdown, smartypants: true
"""
Given the Server is running at "markdown-app"
When I go to "/smarty_pants.html"
@ -70,13 +70,13 @@ Feature: Markdown (Redcarpet) support
And a file named "config.rb" with:
"""
set :markdown_engine, :redcarpet
set :markdown, :filter_html => true,
:no_images => true,
:no_links => true,
:with_toc_data => true,
:hard_wrap => true,
:safe_links_only => true,
:prettify => true
set :markdown, filter_html: true,
no_images: true,
no_links: true,
with_toc_data: true,
hard_wrap: true,
safe_links_only: true,
prettify: true
"""
Given the Server is running at "markdown-app"
@ -103,7 +103,7 @@ Feature: Markdown (Redcarpet) support
And a file named "config.rb" with:
"""
set :markdown_engine, :redcarpet
set :markdown, :link_attributes => { :target => "_blank" }
set :markdown, link_attributes: { target: "_blank" }
"""
And a file named "source/link.html.markdown" with:
"""
@ -118,8 +118,8 @@ Feature: Markdown (Redcarpet) support
And a file named "config.rb" with:
"""
set :markdown_engine, :redcarpet
set :markdown, :xhtml => true,
:hard_wrap => true
set :markdown, xhtml: true,
hard_wrap: true
"""
Given the Server is running at "markdown-app"
When I go to "/hard_wrap.html"
@ -130,7 +130,7 @@ Feature: Markdown (Redcarpet) support
And a file named "config.rb" with:
"""
set :markdown_engine, :redcarpet
set :markdown, :smartypants => true
set :markdown, smartypants: true
"""
Given the Server is running at "markdown-frontmatter-options-app"
When I go to "/smarty_pants-default.html"

View File

@ -36,7 +36,7 @@ Feature: Minify CSS
end
end
activate :minify_css, :compressor => ::PassThrough
activate :minify_css, compressor: ::PassThrough
"""
And the Server is running at "passthrough-app"
When I go to "/stylesheets/site.css"
@ -69,9 +69,9 @@ Feature: Minify CSS
end
end
activate :minify_css, :inline => true, :compressor => ::PassThrough
activate :minify_css, inline: true, compressor: ::PassThrough
page "/inline-css.html", :layout => false
page "/inline-css.html", layout: false
"""
And the Server is running at "passthrough-app"
When I go to "/inline-css.html"
@ -94,9 +94,9 @@ Feature: Minify CSS
end
end
activate :minify_css, :inline => true, :compressor => ::HelloCompressor
activate :minify_css, inline: true, compressor: ::HelloCompressor
page "/inline-css.html", :layout => false
page "/inline-css.html", layout: false
"""
And the Server is running at "passthrough-app"
When I go to "/inline-css.html"
@ -111,7 +111,7 @@ Feature: Minify CSS
Given a fixture app "minify-css-app"
And a file named "config.rb" with:
"""
activate :minify_css, :inline => true
activate :minify_css, inline: true
"""
And the Server is running at "minify-css-app"
When I go to "/inline-css.html"

View File

@ -49,9 +49,9 @@ Feature: Minify Javascript
end
end
activate :minify_javascript, :inline => true, :compressor => ::PassThrough
activate :minify_javascript, inline: true, compressor: ::PassThrough
page "/inline-js.html", :layout => false
page "/inline-js.html", layout: false
"""
And the Server is running at "passthrough-app"
When I go to "/inline-js.html"
@ -96,9 +96,9 @@ Feature: Minify Javascript
end
end
activate :minify_javascript, :inline => true, :compressor => ::HelloCompressor
activate :minify_javascript, inline: true, compressor: ::HelloCompressor
page "/inline-js.html", :layout => false
page "/inline-js.html", layout: false
"""
And the Server is running at "passthrough-app"
When I go to "/inline-js.html"
@ -124,7 +124,7 @@ Feature: Minify Javascript
Given a fixture app "minify-js-app"
And a file named "config.rb" with:
"""
activate :minify_javascript, :inline => true
activate :minify_javascript, inline: true
"""
And the Server is running at "minify-js-app"
When I go to "/inline-js.html"
@ -167,7 +167,7 @@ Feature: Minify Javascript
Given a fixture app "minify-js-app"
And a file named "config.rb" with:
"""
activate :minify_javascript, :inline => true
activate :minify_javascript, inline: true
"""
And the Server is running at "minify-js-app"
When I go to "/inline-coffeescript.html"
@ -193,9 +193,9 @@ Feature: Minify Javascript
end
end
activate :minify_javascript, :inline => true, :compressor => ::PassThrough
activate :minify_javascript, inline: true, compressor: ::PassThrough
page "/inline-coffeescript.html", :layout => false
page "/inline-coffeescript.html", layout: false
"""
And the Server is running at "passthrough-app"
When I go to "/inline-coffeescript.html"
@ -211,7 +211,7 @@ Feature: Minify Javascript
end
end
activate :minify_javascript, :compressor => ::PassThrough
activate :minify_javascript, compressor: ::PassThrough
"""
And the Server is running at "passthrough-app"
When I go to "/javascripts/coffee_test.js"

View File

@ -48,10 +48,10 @@ Feature: Support Rack apps mounted using map
end
configure :build do
endpoint "sinatra/index2.html", :path => "/sinatra/"
endpoint "sinatra/index2.html", path: "/sinatra/"
end
endpoint "dedoo.html", :path => "/sinatra/derp.html"
endpoint "dedoo.html", path: "/sinatra/derp.html"
endpoint "hello.html" do
"world"

View File

@ -4,7 +4,7 @@ Feature: Meta redirects
Given a fixture app "large-build-app"
And a file named "config.rb" with:
"""
redirect "hello.html", :to => "world.html"
redirect "hello.html", to: "world.html"
"""
And the Server is running at "large-build-app"
When I go to "/hello.html"
@ -14,7 +14,7 @@ Feature: Meta redirects
Given a fixture app "large-build-app"
And a file named "config.rb" with:
"""
redirect "hello.html", :to => "http://example.com"
redirect "hello.html", to: "http://example.com"
"""
And the Server is running at "large-build-app"
When I go to "/hello.html"
@ -26,7 +26,7 @@ Feature: Meta redirects
"""
ready do
r = sitemap.find_resource_by_path("static.html")
redirect "hello.html", :to => r
redirect "hello.html", to: r
end
"""
And the Server is running at "large-build-app"
@ -38,8 +38,8 @@ Feature: Meta redirects
And a file named "config.rb" with:
"""
activate :directory_indexes
redirect "hello.html", :to => "link_test.html"
redirect "hello2.html", :to => "services/index.html"
redirect "hello.html", to: "link_test.html"
redirect "hello2.html", to: "services/index.html"
"""
And the Server is running at "large-build-app"
When I go to "/hello/index.html"
@ -51,7 +51,7 @@ Feature: Meta redirects
Given a fixture app "large-build-app"
And a file named "config.rb" with:
"""
redirect "hello.html", :to => "world.html" do |from, to|
redirect "hello.html", to: "world.html" do |from, to|
"#{from} to #{to}"
end
"""

View File

@ -1,6 +1,6 @@
Given /^page "([^\"]*)" has layout "([^\"]*)"$/ do |url, layout|
@initialize_commands ||= []
@initialize_commands << lambda {
page(url, :layout => layout.to_sym)
page(url, layout: layout.to_sym)
}
end

View File

@ -4,5 +4,3 @@ activate :asset_hash
activate :relative_assets
activate :directory_indexes
#page '/foo.html', :directory_index => false

View File

@ -1,11 +1,11 @@
page "/fake.html", :proxy => "/real.html", :layout => false
page "/fake.html", proxy: "/real.html", layout: false
ignore "/should_be_ignored.html"
page "/should_be_ignored2.html", :ignore => true
page "/target_ignore.html", :proxy => "/should_be_ignored3.html", :ignore => true
page "/should_be_ignored2.html", ignore: true
page "/target_ignore.html", proxy: "/should_be_ignored3.html", ignore: true
%w(one two).each do |num|
page "/fake/#{num}.html", :proxy => "/real/index.html" do
page "/fake/#{num}.html", proxy: "/real/index.html" do
@num = num
end
end

View File

@ -1,11 +1,11 @@
page "/fake.html", :proxy => "/real.html", :layout => false
page "/fake.html", proxy: "/real.html", layout: false
ignore "/should_be_ignored.html"
page "/should_be_ignored2.html", :ignore => true
page "/target_ignore.html", :proxy => "/should_be_ignored3.html", :ignore => true
page "/should_be_ignored2.html", ignore: true
page "/target_ignore.html", proxy: "/should_be_ignored3.html", ignore: true
%w(one two).each do |num|
page "/fake/#{num}.html", :proxy => "/real/index.html" do
page "/fake/#{num}.html", proxy: "/real/index.html" do
@num = num
end
end

View File

@ -1 +1 @@
set :erb, :layout_engine => :str
set :erb, layout_engine: :str

View File

@ -1,3 +1,3 @@
data.pages.each do |p|
page p.from, :proxy => p.to
page p.from, proxy: p.to
end

View File

@ -1,30 +1,30 @@
# -*- coding: utf-8 -*-
page "/fake.html", :proxy => "/real.html", :layout => false
page "fake2.html", :proxy => "/real.html", :layout => false
page "fake3.html", :proxy => "real.html", :layout => false
page "/fake4.html", :proxy => "real.html", :layout => false
page "/fake.html", proxy: "/real.html", layout: false
page "fake2.html", proxy: "/real.html", layout: false
page "fake3.html", proxy: "real.html", layout: false
page "/fake4.html", proxy: "real.html", layout: false
ignore "/should_be_ignored.html"
page "/should_be_ignored2.html", :ignore => true
page "/target_ignore.html", :proxy => "/should_be_ignored3.html", :ignore => true
page "/should_be_ignored2.html", ignore: true
page "/target_ignore.html", proxy: "/should_be_ignored3.html", ignore: true
ignore "should_be_ignored4.html"
page "should_be_ignored5.html", :ignore => true
page "target_ignore2.html", :proxy => "/should_be_ignored6.html", :ignore => true
page "target_ignore3.html", :proxy => "should_be_ignored7.html", :ignore => true
page "/target_ignore4.html", :proxy => "should_be_ignored8.html", :ignore => true
page "should_be_ignored5.html", ignore: true
page "target_ignore2.html", proxy: "/should_be_ignored6.html", ignore: true
page "target_ignore3.html", proxy: "should_be_ignored7.html", ignore: true
page "/target_ignore4.html", proxy: "should_be_ignored8.html", ignore: true
%w(one two).each do |num|
page "/fake/#{num}.html", :proxy => "/real/index.html", :ignore => true, :locals => { :num => num }
page "fake2/#{num}.html", :proxy => "/real/index.html", :ignore => true, :locals => { :num => num }
page "fake3/#{num}.html", :proxy => "real/index.html", :ignore => true, :locals => { :num => num }
page "/fake4/#{num}.html", :proxy => "real/index.html", :ignore => true, :locals => { :num => num }
page "/fake/#{num}.html", proxy: "/real/index.html", ignore: true, locals: { num: num }
page "fake2/#{num}.html", proxy: "/real/index.html", ignore: true, locals: { num: num }
page "fake3/#{num}.html", proxy: "real/index.html", ignore: true, locals: { num: num }
page "/fake4/#{num}.html", proxy: "real/index.html", ignore: true, locals: { num: num }
end
page "明日がある.html", :proxy => "/real.html", :layout => false
page "明日がある.html", proxy: "/real.html", layout: false
page "f*/*", :locals => { :all_glob => "I am all glob" }
page "fake/*", :locals => { :glob_var => "I am one glob" }
page "fake2/*", :locals => { :glob_var => "I am two glob" }
page "fake3/*", :locals => { :glob_var => "I am three glob" }
page "fake4/*", :locals => { :glob_var => "I am four glob" }
page "f*/*", locals: { all_glob: "I am all glob" }
page "fake/*", locals: { glob_var: "I am one glob" }
page "fake2/*", locals: { glob_var: "I am two glob" }
page "fake3/*", locals: { glob_var: "I am three glob" }
page "fake4/*", locals: { glob_var: "I am four glob" }

View File

@ -1,4 +1,4 @@
require "lib/hello_helper"
helpers HelloHelper
page "/", :layout => false
page "/", layout: false

View File

@ -13,4 +13,4 @@ end
Middleman::Extensions.register :extension_a, ExtensionA
activate :extension_a, :hello => "world", :hola => "mundo"
activate :extension_a, hello: "world", hola: "mundo"

View File

@ -1,4 +1,4 @@
# Proxy ignored.html, which should ignore itself through a frontmatter
page 'proxied.html', :proxy => 'ignored.html'
page 'override_layout.html', :layout => :alternate
page 'proxied.html', proxy: 'ignored.html'
page 'override_layout.html', layout: :alternate
page 'page_mentioned.html'

View File

@ -1,4 +1,4 @@
# Proxy ignored.html, which should ignore itself through a frontmatter
page 'proxied.html', :proxy => 'ignored.html'
page 'override_layout.html', :layout => :alternate
page 'proxied.html', proxy: 'ignored.html'
page 'override_layout.html', layout: :alternate
page 'page_mentioned.html'

View File

@ -18,13 +18,13 @@
# Per-page layout changes:
#
# With no layout
# page "/path/to/file.html", :layout => false
# page "/path/to/file.html", layout: false
#
# With alternative layout
# page "/path/to/file.html", :layout => :otherlayout
# page "/path/to/file.html", layout: :otherlayout
# Proxy (fake) files
# page "/this-page-has-no-template.html", :proxy => "/template-file.html" do
# page "/this-page-has-no-template.html", proxy: "/template-file.html" do
# @which_fake_page = "Rendering a fake page with a variable"
# end

View File

@ -1 +1 @@
page "/index.html", :layout => false
page "/index.html", layout: false

View File

@ -1,8 +1,8 @@
[:en, :es].each do |locale|
proxy "/#{locale}/index.html", "index.html", :ignore => true, :lang => locale
proxy "/#{locale}/index.html", "index.html", ignore: true, lang: locale
end
proxy "/fr/index.html", "index.html", :lang => :fr
proxy "/fr/index.html", "index.html", lang: :fr
activate :i18n

View File

@ -1,4 +1,4 @@
activate :directory_indexes
page "/leave_me_alone.html", :directory_index => false
page "/leave_me_alone.html", directory_index: false
page "/wildcard*", :directory_index => false
page "/wildcard*", directory_index: false

View File

@ -1,3 +1,3 @@
set :layout, :custom
page "/", :layout => :another
page "/", layout: :another

View File

@ -1 +1 @@
set :markdown, :smartypants => true
set :markdown, smartypants: true

View File

@ -1 +1 @@
set :markdown, :smartypants => true
set :markdown, smartypants: true

View File

@ -1,4 +1,4 @@
activate :directory_indexes
# Proxy ignored.html, which should ignore itself through a frontmatter
page 'proxied.html', :proxy => 'ignored.html'
page 'proxied.html', proxy: 'ignored.html'

View File

@ -1,7 +1,7 @@
activate :directory_indexes
page "/sub/fake.html", :proxy => "/proxied.html", :ignore => true
page "/sub/fake2.html", :proxy => "/proxied.html", :ignore => true
page "/sub/fake.html", proxy: "/proxied.html", ignore: true
page "/sub/fake2.html", proxy: "/proxied.html", ignore: true
page "/directory-indexed/fake.html", :proxy => "/proxied.html", :ignore => true
page "/directory-indexed/fake2.html", :proxy => "/proxied.html", :ignore => true
page "/directory-indexed/fake.html", proxy: "/proxied.html", ignore: true
page "/directory-indexed/fake2.html", proxy: "/proxied.html", ignore: true

View File

@ -1,6 +1,6 @@
<%= stylesheet_link_tag "test1" %>
<%= javascript_include_tag "test1" %>
<%= image_tag "test2.png", :alt => "alt" %>
<%= image_tag "100px.png", :alt => "alt" %>
<%= link_to "Has param", "test2.com", :class => "test" %>
<%= image_tag "test2.png", alt: "alt" %>
<%= image_tag "100px.png", alt: "alt" %>
<%= link_to "Has param", "test2.com", class: "test" %>
<%= number_to_human_size(1024) %>

View File

@ -1 +1 @@
<%= page_classes :numeric_prefix => "haaaaay" %>
<%= page_classes numeric_prefix: "haaaaay" %>

View File

@ -1,4 +1,4 @@
page "/path/*", :layout => "alt"
page "/path/*", layout: "alt"
# Doesn't work, and shouldn't
# page "/path/*" do

View File

@ -1 +1 @@
<%= partial 'locals', :locals => { :foo => 'bar' } %>
<%= partial 'locals', locals: { :foo => 'bar' } %>

View File

@ -1,18 +1,18 @@
# -*- coding: utf-8 -*-
proxy "/fake.html", "/real.html", :layout => false
proxy "fake2.html", "/real.html", :layout => false
proxy "fake3.html", "real.html", :layout => false
proxy "/fake4.html", "real.html", :layout => false
proxy "/fake.html", "/real.html", layout: false
proxy "fake2.html", "/real.html", layout: false
proxy "fake3.html", "real.html", layout: false
proxy "/fake4.html", "real.html", layout: false
proxy "/target_ignore.html", "/should_be_ignored3.html", :ignore => true
proxy "target_ignore2.html", "/should_be_ignored6.html", :ignore => true
proxy "target_ignore3.html", "should_be_ignored7.html", :ignore => true
proxy "/target_ignore4.html", "should_be_ignored8.html", :ignore => true
proxy "/target_ignore.html", "/should_be_ignored3.html", ignore: true
proxy "target_ignore2.html", "/should_be_ignored6.html", ignore: true
proxy "target_ignore3.html", "should_be_ignored7.html", ignore: true
proxy "/target_ignore4.html", "should_be_ignored8.html", ignore: true
%w(one two).each do |num|
proxy "/fake/#{num}.html", "/real/index.html", :ignore => true, :locals => { :num => num }
proxy "fake2/#{num}.html", "/real/index.html", :ignore => true, :locals => { :num => num }
proxy "fake3/#{num}.html", "real/index.html", :ignore => true, :locals => { :num => num }
proxy "/fake/#{num}.html", "/real/index.html", ignore: true, locals: { num: num }
proxy "fake2/#{num}.html", "/real/index.html", ignore: true, locals: { num: num }
proxy "fake3/#{num}.html", "real/index.html", ignore: true, locals: { num: num }
end
proxy "明日がある.html", "/real.html", :layout => false
proxy "明日がある.html", "/real.html", layout: false

View File

@ -1,5 +1,5 @@
page "/sub/fake.html", :proxy => "/proxied.html", :ignore => true
page "/sub/fake2.html", :proxy => "/proxied.html", :ignore => true
page "/sub/fake.html", proxy: "/proxied.html", ignore: true
page "/sub/fake2.html", proxy: "/proxied.html", ignore: true
page "/directory-indexed/fake.html", :proxy => "/proxied.html", :ignore => true
page "/directory-indexed/fake2.html", :proxy => "/proxied.html", :ignore => true
page "/directory-indexed/fake.html", proxy: "/proxied.html", ignore: true
page "/directory-indexed/fake2.html", proxy: "/proxied.html", ignore: true

View File

@ -1 +1 @@
page "/admin/*", :layout => :admin
page "/admin/*", layout: :admin

View File

@ -1,2 +1,2 @@
activate :directory_indexes
page "/admin/*", :layout => :admin
page "/admin/*", layout: :admin

View File

@ -4,8 +4,8 @@ module Middleman
module Routing
# The page method allows the layout to be set on a specific path
#
# page "/about.html", :layout => false
# page "/", :layout => :homepage_layout
# page "/about.html", layout: false
# page "/", layout: :homepage_layout
#
# @param [String] url
# @param [Hash] opts

View File

@ -8,7 +8,7 @@ gem "middleman", "~><%= Middleman::VERSION %>"
gem "middleman-livereload", "~> 3.1.0"
# For faster file watcher updates on Windows:
gem "wdm", "~> 0.1.0", :platforms => [:mswin, :mingw]
gem "wdm", "~> 0.1.0", platforms: [:mswin, :mingw]
# Windows does not come with time zone data
gem "tzinfo-data", platforms: [:mswin, :mingw]

View File

@ -19,11 +19,11 @@ page '/*.json', layout: false
page '/*.txt', layout: false
#
# With alternative layout
# page "/path/to/file.html", :layout => :otherlayout
# page "/path/to/file.html", layout: :otherlayout
# Proxy pages (http://middlemanapp.com/basics/dynamic-pages/)
# proxy "/this-page-has-no-template.html", "/template-file.html", :locals => {
# :which_fake_page => "Rendering a fake page with a local variable" }
# proxy "/this-page-has-no-template.html", "/template-file.html", locals: {
# which_fake_page: "Rendering a fake page with a local variable" }
###
# Helpers