mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
Update rubocop + use enable-frozen-string-literal (#2354)
This commit is contained in:
parent
a03aed2d6d
commit
61915cdaab
232 changed files with 597 additions and 124 deletions
21
.rubocop.yml
21
.rubocop.yml
|
@ -1,6 +1,8 @@
|
||||||
require: rubocop-performance
|
require:
|
||||||
|
- rubocop-performance
|
||||||
|
|
||||||
AllCops:
|
AllCops:
|
||||||
|
NewCops: disable
|
||||||
TargetRubyVersion: 2.5
|
TargetRubyVersion: 2.5
|
||||||
Include:
|
Include:
|
||||||
- "**/*.rb"
|
- "**/*.rb"
|
||||||
|
@ -11,11 +13,16 @@ AllCops:
|
||||||
- "vendor/**/*"
|
- "vendor/**/*"
|
||||||
- "**/tmp/**/*"
|
- "**/tmp/**/*"
|
||||||
- "middleman-cli/lib/middleman-cli/templates/**/*"
|
- "middleman-cli/lib/middleman-cli/templates/**/*"
|
||||||
|
|
||||||
|
Style/FrozenStringLiteralComment:
|
||||||
|
Enabled: true
|
||||||
|
EnforcedStyle: always
|
||||||
|
|
||||||
Security/YAMLLoad:
|
Security/YAMLLoad:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Style/GuardClause:
|
Style/GuardClause:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Metrics/LineLength:
|
Layout/LineLength:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Metrics/MethodLength:
|
Metrics/MethodLength:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
@ -39,13 +46,13 @@ Lint/AmbiguousBlockAssociation:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Lint/UriEscapeUnescape:
|
Lint/UriEscapeUnescape:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Lint/HandleExceptions:
|
Lint/SuppressedException:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Lint/ShadowedException:
|
Lint/ShadowedException:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Naming/FileName:
|
Naming/FileName:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Naming/UncommunicativeMethodParamName:
|
Naming/MethodParameterName:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Naming/MemoizedInstanceVariableName:
|
Naming/MemoizedInstanceVariableName:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
@ -57,9 +64,7 @@ Style/ClassAndModuleChildren:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Style/MissingRespondToMissing:
|
Style/MissingRespondToMissing:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Style/MethodMissingSuper:
|
Lint/MissingSuper:
|
||||||
Enabled: false
|
|
||||||
Style/FrozenStringLiteralComment:
|
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Style/EvalWithLocation:
|
Style/EvalWithLocation:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
@ -67,3 +72,5 @@ Style/ClassVars:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Style/GlobalVars:
|
Style/GlobalVars:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
Style/Proc:
|
||||||
|
Enabled: false
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
language: ruby
|
language: ruby
|
||||||
|
dist: xenial
|
||||||
cache: bundler
|
cache: bundler
|
||||||
rvm:
|
rvm:
|
||||||
- ruby-head
|
- ruby-head
|
||||||
|
@ -7,11 +8,10 @@ rvm:
|
||||||
- 2.5
|
- 2.5
|
||||||
os:
|
os:
|
||||||
- linux
|
- linux
|
||||||
matrix:
|
jobs:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- rvm: ruby-head
|
- rvm: ruby-head
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- TEST=true
|
- TEST=true
|
||||||
script: bundle exec rake test
|
|
||||||
|
|
4
Gemfile
4
Gemfile
|
@ -38,8 +38,8 @@ gem 'mini_racer', '~> 0.2.4', platforms: :ruby
|
||||||
gem 'therubyrhino', '>= 2.0', platforms: :jruby
|
gem 'therubyrhino', '>= 2.0', platforms: :jruby
|
||||||
|
|
||||||
# Code Quality
|
# Code Quality
|
||||||
gem 'rubocop', '~> 0.70.0', require: false
|
gem 'rubocop', '~> 0.89', require: false
|
||||||
gem 'rubocop-performance', require: false
|
gem 'rubocop-performance', '~> 1.7', require: false
|
||||||
gem 'simplecov', '~> 0.10', require: false
|
gem 'simplecov', '~> 0.10', require: false
|
||||||
|
|
||||||
# Middleman itself
|
# Middleman itself
|
||||||
|
|
32
Gemfile.lock
32
Gemfile.lock
|
@ -49,7 +49,7 @@ GEM
|
||||||
ffi (~> 1.9)
|
ffi (~> 1.9)
|
||||||
rspec-expectations (>= 2.99)
|
rspec-expectations (>= 2.99)
|
||||||
thor (>= 0.19, < 2.0)
|
thor (>= 0.19, < 2.0)
|
||||||
ast (2.4.0)
|
ast (2.4.1)
|
||||||
backports (3.17.1)
|
backports (3.17.1)
|
||||||
binding_of_caller (0.8.0)
|
binding_of_caller (0.8.0)
|
||||||
debug_inspector (>= 0.0.1)
|
debug_inspector (>= 0.0.1)
|
||||||
|
@ -109,7 +109,6 @@ GEM
|
||||||
i18n (0.9.5)
|
i18n (0.9.5)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
interception (0.5)
|
interception (0.5)
|
||||||
jaro_winkler (1.5.4)
|
|
||||||
kramdown (2.3.0)
|
kramdown (2.3.0)
|
||||||
rexml
|
rexml
|
||||||
lazy_priority_queue (0.1.1)
|
lazy_priority_queue (0.1.1)
|
||||||
|
@ -140,9 +139,9 @@ GEM
|
||||||
padrino-support (= 0.14.4)
|
padrino-support (= 0.14.4)
|
||||||
tilt (>= 1.4.1, < 3)
|
tilt (>= 1.4.1, < 3)
|
||||||
padrino-support (0.14.4)
|
padrino-support (0.14.4)
|
||||||
parallel (1.19.1)
|
parallel (1.19.2)
|
||||||
parser (2.7.1.2)
|
parser (2.7.1.4)
|
||||||
ast (~> 2.4.0)
|
ast (~> 2.4.1)
|
||||||
pry (0.13.1)
|
pry (0.13.1)
|
||||||
coderay (~> 1.1)
|
coderay (~> 1.1)
|
||||||
method_source (~> 1.0)
|
method_source (~> 1.0)
|
||||||
|
@ -164,6 +163,7 @@ GEM
|
||||||
rb-inotify (0.10.1)
|
rb-inotify (0.10.1)
|
||||||
ffi (~> 1.0)
|
ffi (~> 1.0)
|
||||||
redcarpet (3.5.0)
|
redcarpet (3.5.0)
|
||||||
|
regexp_parser (1.7.1)
|
||||||
rexml (3.2.4)
|
rexml (3.2.4)
|
||||||
rgl (0.5.6)
|
rgl (0.5.6)
|
||||||
lazy_priority_queue (~> 0.1.0)
|
lazy_priority_queue (~> 0.1.0)
|
||||||
|
@ -181,15 +181,19 @@ GEM
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.9.0)
|
rspec-support (~> 3.9.0)
|
||||||
rspec-support (3.9.3)
|
rspec-support (3.9.3)
|
||||||
rubocop (0.70.0)
|
rubocop (0.89.1)
|
||||||
jaro_winkler (~> 1.5.1)
|
|
||||||
parallel (~> 1.10)
|
parallel (~> 1.10)
|
||||||
parser (>= 2.6)
|
parser (>= 2.7.1.1)
|
||||||
rainbow (>= 2.2.2, < 4.0)
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
|
regexp_parser (>= 1.7)
|
||||||
|
rexml
|
||||||
|
rubocop-ast (>= 0.3.0, < 1.0)
|
||||||
ruby-progressbar (~> 1.7)
|
ruby-progressbar (~> 1.7)
|
||||||
unicode-display_width (>= 1.4.0, < 1.7)
|
unicode-display_width (>= 1.4.0, < 2.0)
|
||||||
rubocop-performance (1.3.0)
|
rubocop-ast (0.3.0)
|
||||||
rubocop (>= 0.68.0)
|
parser (>= 2.7.1.4)
|
||||||
|
rubocop-performance (1.7.1)
|
||||||
|
rubocop (>= 0.82.0)
|
||||||
ruby-progressbar (1.10.1)
|
ruby-progressbar (1.10.1)
|
||||||
ruby2_keywords (0.0.2)
|
ruby2_keywords (0.0.2)
|
||||||
rubydns (1.0.3)
|
rubydns (1.0.3)
|
||||||
|
@ -226,7 +230,7 @@ GEM
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
uglifier (4.2.0)
|
uglifier (4.2.0)
|
||||||
execjs (>= 0.3.0, < 3)
|
execjs (>= 0.3.0, < 3)
|
||||||
unicode-display_width (1.6.1)
|
unicode-display_width (1.7.0)
|
||||||
xpath (2.1.0)
|
xpath (2.1.0)
|
||||||
nokogiri (~> 1.3)
|
nokogiri (~> 1.3)
|
||||||
yard (0.9.25)
|
yard (0.9.25)
|
||||||
|
@ -254,8 +258,8 @@ DEPENDENCIES
|
||||||
rake (~> 12.3)
|
rake (~> 12.3)
|
||||||
redcarpet (>= 3.1)
|
redcarpet (>= 3.1)
|
||||||
rspec (~> 3.0)
|
rspec (~> 3.0)
|
||||||
rubocop (~> 0.70.0)
|
rubocop (~> 0.89)
|
||||||
rubocop-performance
|
rubocop-performance (~> 1.7)
|
||||||
rubydns (~> 1.0.1)
|
rubydns (~> 1.0.1)
|
||||||
sassc (~> 2.0)
|
sassc (~> 2.0)
|
||||||
simplecov (~> 0.10)
|
simplecov (~> 0.10)
|
||||||
|
|
4
Rakefile
4
Rakefile
|
@ -44,8 +44,6 @@ end
|
||||||
|
|
||||||
desc 'Run tests for all middleman gems'
|
desc 'Run tests for all middleman gems'
|
||||||
task :test do
|
task :test do
|
||||||
Rake::Task['rubocop'].invoke
|
|
||||||
|
|
||||||
GEM_PATHS.each do |g|
|
GEM_PATHS.each do |g|
|
||||||
Dir.chdir(File.join(ROOT, g).to_s) { sh "#{Gem.ruby} -S rake test" }
|
Dir.chdir(File.join(ROOT, g).to_s) { sh "#{Gem.ruby} -S rake test" }
|
||||||
end
|
end
|
||||||
|
@ -63,4 +61,4 @@ desc 'Run RuboCop to check code consistency'
|
||||||
RuboCop::RakeTask.new(:rubocop)
|
RuboCop::RakeTask.new(:rubocop)
|
||||||
|
|
||||||
desc 'Run tests for all middleman gems'
|
desc 'Run tests for all middleman gems'
|
||||||
task default: :test
|
task default: %i[rubocop test]
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
RAKE_ROOT = __FILE__.freeze
|
# frozen_string_literal: true
|
||||||
GEM_NAME = 'middleman-cli'.freeze
|
|
||||||
|
RAKE_ROOT = __FILE__
|
||||||
|
GEM_NAME = 'middleman-cli'
|
||||||
require File.expand_path(File.dirname(__FILE__) + '/../gem_rake_helper')
|
require File.expand_path(File.dirname(__FILE__) + '/../gem_rake_helper')
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'middleman-core/profiling'
|
require 'middleman-core/profiling'
|
||||||
Middleman::Profiling.profiler = Middleman::Profiling::RubyProfProfiler.new if ARGV.include? '--profile'
|
Middleman::Profiling.profiler = Middleman::Profiling::RubyProfProfiler.new if ARGV.include? '--profile'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
ENV['TEST'] = 'true'
|
ENV['TEST'] = 'true'
|
||||||
|
|
||||||
require 'active_support/all'
|
require 'active_support/all'
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'rubydns'
|
require 'rubydns'
|
||||||
require 'psych'
|
require 'psych'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
set :layout, false
|
set :layout, false
|
||||||
|
|
||||||
class MyFeature < Middleman::Extension
|
class MyFeature < Middleman::Extension
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Setup our load paths
|
# Setup our load paths
|
||||||
libdir = __dir__
|
libdir = __dir__
|
||||||
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
|
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'middleman-core/application'
|
require 'middleman-core/application'
|
||||||
|
|
||||||
# CLI Module
|
# CLI Module
|
||||||
|
@ -126,7 +128,7 @@ module Middleman::Cli
|
||||||
puts 'Project built successfully.'
|
puts 'Project built successfully.'
|
||||||
else
|
else
|
||||||
msg = 'There were errors during this build'
|
msg = 'There were errors during this build'
|
||||||
msg << ', re-run with `middleman build --verbose` to see the full exception.' unless options['verbose']
|
msg = "#{msg}, re-run with `middleman build --verbose` to see the full exception." unless options['verbose']
|
||||||
shell.say msg, :red
|
shell.say msg, :red
|
||||||
|
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# CLI Module
|
# CLI Module
|
||||||
module Middleman::Cli
|
module Middleman::Cli
|
||||||
# The CLI Config class
|
# The CLI Config class
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# CLI Module
|
# CLI Module
|
||||||
module Middleman::Cli
|
module Middleman::Cli
|
||||||
# The CLI Console class
|
# The CLI Console class
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# CLI Module
|
# CLI Module
|
||||||
module Middleman::Cli
|
module Middleman::Cli
|
||||||
# A thor task for creating new projects
|
# A thor task for creating new projects
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# CLI Module
|
# CLI Module
|
||||||
module Middleman::Cli
|
module Middleman::Cli
|
||||||
# A thor task for creating new projects
|
# A thor task for creating new projects
|
||||||
class Init < Thor::Group
|
class Init < Thor::Group
|
||||||
include Thor::Actions
|
include Thor::Actions
|
||||||
|
|
||||||
GIT_CMD = 'git'.freeze
|
GIT_CMD = 'git'
|
||||||
|
|
||||||
check_unknown_options!
|
check_unknown_options!
|
||||||
|
|
||||||
|
@ -32,9 +34,11 @@ module Middleman::Cli
|
||||||
require 'tmpdir'
|
require 'tmpdir'
|
||||||
|
|
||||||
unless git_present?
|
unless git_present?
|
||||||
msg = 'You need to install the git command line tool to initialize a new project. '
|
msg_array = [
|
||||||
msg << "For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git"
|
'You need to install the git command line tool to initialize a new project. ',
|
||||||
say msg, :red
|
"For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git"
|
||||||
|
]
|
||||||
|
say msg_array.join, :red
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# CLI Module
|
# CLI Module
|
||||||
module Middleman::Cli
|
module Middleman::Cli
|
||||||
# Server thor task
|
# Server thor task
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Backwards compat
|
# Backwards compat
|
||||||
require 'middleman-cli'
|
require 'middleman-cli'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
RAKE_ROOT = __FILE__.freeze
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
RAKE_ROOT = __FILE__
|
||||||
GEM_NAME = ENV['NAME'] || 'middleman-core'
|
GEM_NAME = ENV['NAME'] || 'middleman-core'
|
||||||
require File.expand_path(File.dirname(__FILE__) + '/../gem_rake_helper')
|
require File.expand_path(File.dirname(__FILE__) + '/../gem_rake_helper')
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
ENV['TEST'] = 'true'
|
ENV['TEST'] = 'true'
|
||||||
|
|
||||||
require 'active_support/all'
|
require 'active_support/all'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
Around('@preserve_mime_types') do |_scenario, block|
|
Around('@preserve_mime_types') do |_scenario, block|
|
||||||
mime_types = ::Rack::Mime::MIME_TYPES.clone
|
mime_types = ::Rack::Mime::MIME_TYPES.clone
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
activate :asset_hash
|
activate :asset_hash
|
||||||
|
|
||||||
activate :relative_assets
|
activate :relative_assets
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
configure :build do
|
configure :build do
|
||||||
# Minify JavaScript on build
|
# Minify JavaScript on build
|
||||||
activate :minify_javascript
|
activate :minify_javascript
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
activate :asset_hash,
|
activate :asset_hash,
|
||||||
prefix: 'myprefix-'
|
prefix: 'myprefix-'
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
activate :asset_hash,
|
activate :asset_hash,
|
||||||
rename_proc: lambda do |path, _basename, digest, extension, _options|
|
rename_proc: lambda do |path, _basename, digest, extension, _options|
|
||||||
"#{path}#{digest}#{extension}"
|
"#{path}#{digest}#{extension}"
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
activate :asset_hash
|
activate :asset_hash
|
||||||
|
|
||||||
activate :relative_assets
|
activate :relative_assets
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
activate :asset_host, host: 'http://assets1.example.com'
|
activate :asset_host, host: 'http://assets1.example.com'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
%w[
|
%w[
|
||||||
/auto-css.html
|
/auto-css.html
|
||||||
/auto-css
|
/auto-css
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
%w[
|
%w[
|
||||||
/auto-js.html
|
/auto-js.html
|
||||||
/auto-js
|
/auto-js
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
activate :directory_indexes
|
activate :directory_indexes
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
set :automatic_directory_matcher, '--'
|
set :automatic_directory_matcher, '--'
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
data.store :static_array, ::YAML.load_file(File.expand_path('static_array.yml', File.dirname(__FILE__)))
|
data.store :static_array, ::YAML.load_file(File.expand_path('static_array.yml', File.dirname(__FILE__)))
|
||||||
data.store :static_hash, ::YAML.load_file(File.expand_path('static_hash.yml', File.dirname(__FILE__)))
|
data.store :static_hash, ::YAML.load_file(File.expand_path('static_hash.yml', File.dirname(__FILE__)))
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
set :layout, false
|
set :layout, false
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'slim'
|
require 'slim'
|
||||||
|
|
||||||
page '/capture_html_erb.html', layout: :capture_html
|
page '/capture_html_erb.html', layout: :capture_html
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
proxy '/fake.html', '/real.html', layout: false
|
proxy '/fake.html', '/real.html', layout: false
|
||||||
|
|
||||||
ignore '/should_be_ignored.html'
|
ignore '/should_be_ignored.html'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
set :build_dir, '.build'
|
set :build_dir, '.build'
|
||||||
|
|
||||||
ignore '/should_be_ignored.html'
|
ignore '/should_be_ignored.html'
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
set :build_dir, '.build'
|
set :build_dir, '.build'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
proxy '/fake.html', '/real.html', layout: false
|
proxy '/fake.html', '/real.html', layout: false
|
||||||
|
|
||||||
ignore '/should_be_ignored.html'
|
ignore '/should_be_ignored.html'
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
activate :directory_indexes
|
activate :directory_indexes
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
set :build_dir, 'sub/dir'
|
set :build_dir, 'sub/dir'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'slim'
|
require 'slim'
|
||||||
|
|
||||||
page '/content_for_erb.html', layout: :content_for
|
page '/content_for_erb.html', layout: :content_for
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
set :erb, layout_engine: :str
|
set :erb, layout_engine: :str
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
set :source, 'src'
|
set :source, 'src'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
data.pages.each do |p|
|
data.pages.each do |p|
|
||||||
proxy p.from, p.to
|
proxy p.from, p.to
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
files.watch :source, path: File.join(root, '..', 'external'),
|
files.watch :source, path: File.join(root, '..', 'external'),
|
||||||
destination_dir: 'my_dir'
|
destination_dir: 'my_dir'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
proxy '/fake.html', '/real.html', layout: false
|
proxy '/fake.html', '/real.html', layout: false
|
||||||
proxy 'fake2.html', '/real.html', layout: false
|
proxy 'fake2.html', '/real.html', layout: false
|
||||||
proxy 'fake3.html', 'real.html', layout: false
|
proxy 'fake3.html', 'real.html', layout: false
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class LayoutDisabler < Middleman::Extension
|
class LayoutDisabler < Middleman::Extension
|
||||||
def initialize(app, options_hash = {}, &block)
|
def initialize(app, options_hash = {}, &block)
|
||||||
super
|
super
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
set :layout, false
|
set :layout, false
|
||||||
|
|
||||||
class MyFeature < Middleman::Extension
|
class MyFeature < Middleman::Extension
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'lib/hello_helper'
|
require 'lib/hello_helper'
|
||||||
helpers HelloHelper
|
helpers HelloHelper
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Derp
|
module Derp
|
||||||
def three
|
def three
|
||||||
'Three'
|
'Three'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module FourHelpers
|
module FourHelpers
|
||||||
def four
|
def four
|
||||||
'Four'
|
'Four'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module OneHelper
|
module OneHelper
|
||||||
def one
|
def one
|
||||||
'One'
|
'One'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module YetAnotherThingy
|
module YetAnotherThingy
|
||||||
def two
|
def two
|
||||||
'Two'
|
'Two'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module HelloHelper
|
module HelloHelper
|
||||||
def hello
|
def hello
|
||||||
'Hello World'
|
'Hello World'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
activate :external_pipeline,
|
activate :external_pipeline,
|
||||||
name: :failing,
|
name: :failing,
|
||||||
command: 'mv does-not-exist tmp/file.js',
|
command: 'mv does-not-exist tmp/file.js',
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
set :layout, false
|
set :layout, false
|
||||||
|
|
||||||
class ExtensionA < ::Middleman::Extension
|
class ExtensionA < ::Middleman::Extension
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
config[:frontmatter_delims][:yaml] << %w[\\--- \\---]
|
config[:frontmatter_delims][:yaml] << %w[\\--- \\---]
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
ignore '*.frontmatter'
|
ignore '*.frontmatter'
|
||||||
|
|
||||||
# Reads neighbor for every file on every refresh.
|
# Reads neighbor for every file on every refresh.
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Proxy ignored.html, which should ignore itself through a frontmatter
|
# Proxy ignored.html, which should ignore itself through a frontmatter
|
||||||
proxy 'proxied.html', 'ignored.html'
|
proxy 'proxied.html', 'ignored.html'
|
||||||
page 'override_layout.html', layout: :alternate
|
page 'override_layout.html', layout: :alternate
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Proxy ignored.html, which should ignore itself through a frontmatter
|
# Proxy ignored.html, which should ignore itself through a frontmatter
|
||||||
proxy 'proxied.html', 'ignored.html'
|
proxy 'proxied.html', 'ignored.html'
|
||||||
proxy 'proxied_with_frontmatter.html', 'ignored.html'
|
proxy 'proxied_with_frontmatter.html', 'ignored.html'
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
page '/index.html', layout: false
|
page '/index.html', layout: false
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
activate :gzip
|
activate :gzip
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
set :encoding, 'ISO-8859-1'
|
set :encoding, 'ISO-8859-1'
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
activate :i18n
|
activate :i18n
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
%i[en es].each do |locale|
|
%i[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
|
end
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
activate :i18n, mount_at_root: :en, langs: %i[en es]
|
activate :i18n, mount_at_root: :en, langs: %i[en es]
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
import_file File.expand_path('static.html', root), '/static2.html'
|
import_file File.expand_path('static.html', root), '/static2.html'
|
||||||
|
|
||||||
import_path File.expand_path('bower_components/', root)
|
import_path File.expand_path('bower_components/', root)
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
activate :directory_indexes
|
activate :directory_indexes
|
||||||
page '/leave_me_alone.html', directory_index: false
|
page '/leave_me_alone.html', directory_index: false
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
page '/spaces in file.html', layout: false
|
page '/spaces in file.html', layout: false
|
||||||
|
|
||||||
config[:port] = 5555
|
config[:port] = 5555
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
# activate :minify_css
|
# activate :minify_css
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
set :layout, :custom
|
set :layout, :custom
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
set :layout, :custom
|
set :layout, :custom
|
||||||
|
|
||||||
page '/', layout: :another
|
page '/', layout: :another
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
set :layout, :custom
|
set :layout, :custom
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
set :markdown, smartypants: true
|
set :markdown, smartypants: true
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
set :markdown, smartypants: true
|
set :markdown, smartypants: true
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
ignore 'danger-zone/*'
|
ignore 'danger-zone/*'
|
||||||
ignore '*.textile'
|
ignore '*.textile'
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
activate :directory_indexes
|
activate :directory_indexes
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
activate :directory_indexes
|
activate :directory_indexes
|
||||||
|
|
||||||
# Proxy ignored.html, which should ignore itself through a frontmatter
|
# Proxy ignored.html, which should ignore itself through a frontmatter
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
activate :directory_indexes
|
activate :directory_indexes
|
||||||
|
|
||||||
proxy '/sub/fake.html', '/proxied.html', ignore: true
|
proxy '/sub/fake.html', '/proxied.html', ignore: true
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
files.watch :data, path: File.join(root, 'data0'), priority: 100
|
files.watch :data, path: File.join(root, 'data0'), priority: 100
|
||||||
files.watch :data, path: File.join(root, 'data1')
|
files.watch :data, path: File.join(root, 'data1')
|
||||||
files.watch :data, path: File.join(root, 'data2')
|
files.watch :data, path: File.join(root, 'data2')
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
files.watch :source, path: File.join(root, 'source0'), priority: 100
|
files.watch :source, path: File.join(root, 'source0'), priority: 100
|
||||||
files.watch :source, path: File.join(root, 'source1')
|
files.watch :source, path: File.join(root, 'source1')
|
||||||
files.watch :source, path: File.join(root, 'source2')
|
files.watch :source, path: File.join(root, 'source2')
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
files.watch :source, path: File.join(root, 'external'),
|
files.watch :source, path: File.join(root, 'external'),
|
||||||
destination_dir: 'external'
|
destination_dir: 'external'
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
files.watch :source, path: File.join(root, 'source2'),
|
files.watch :source, path: File.join(root, 'source2'),
|
||||||
destination_dir: 'source2'
|
destination_dir: 'source2'
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
files.watch :source, path: File.join(root, 'external')
|
files.watch :source, path: File.join(root, 'external')
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
set :layout, false
|
set :layout, false
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
set :layout, :inner
|
set :layout, :inner
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
helpers do
|
helpers do
|
||||||
def title
|
def title
|
||||||
content_tag :h1 do
|
content_tag :h1 do
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
page '/sub1/page-classes.html', layout: false
|
page '/sub1/page-classes.html', layout: false
|
||||||
page '/sub1/sub2/page-classes.html', layout: false
|
page '/sub1/sub2/page-classes.html', layout: false
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
page '/path/*', layout: 'alt'
|
page '/path/*', layout: 'alt'
|
||||||
|
|
||||||
# Doesn't work, and shouldn't
|
# Doesn't work, and shouldn't
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
%w[1 2 3].each do |n|
|
%w[1 2 3].each do |n|
|
||||||
proxy "/#{n}.html", '/index.html', id: "page#{n}"
|
proxy "/#{n}.html", '/index.html', id: "page#{n}"
|
||||||
end
|
end
|
||||||
|
|
||||||
page '/overwrites/*', id: :"something-else"
|
page '/overwrites/*', id: :"something-else"
|
||||||
|
|
||||||
config[:page_id_generator] = ->(path) { path + '-foo' }
|
config[:page_id_generator] = ->(path) { "#{path}-foo" }
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
%w[1 2 3].each do |n|
|
%w[1 2 3].each do |n|
|
||||||
proxy "/#{n}.html", '/index.html', id: "page#{n}"
|
proxy "/#{n}.html", '/index.html', id: "page#{n}"
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
proxy '/fake.html', '/real.html', layout: false
|
proxy '/fake.html', '/real.html', layout: false
|
||||||
proxy 'fake2.html', '/real.html', layout: false
|
proxy 'fake2.html', '/real.html', layout: false
|
||||||
proxy 'fake3.html', 'real.html', layout: false
|
proxy 'fake3.html', 'real.html', layout: false
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
redirect 'external.html', to: 'http://example.com'
|
redirect 'external.html', to: 'http://example.com'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
set :fonts_dir, 'fonts'
|
set :fonts_dir, 'fonts'
|
||||||
|
|
||||||
configure :build do
|
configure :build do
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
set :sass_assets_paths, [
|
set :sass_assets_paths, [
|
||||||
File.join(root, 'assets', 'stylesheets'),
|
File.join(root, 'assets', 'stylesheets'),
|
||||||
File.join(root, 'my-vendor', 'stylesheets')
|
File.join(root, 'my-vendor', 'stylesheets')
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
proxy '/sub/fake.html', '/proxied.html', ignore: true
|
proxy '/sub/fake.html', '/proxied.html', ignore: true
|
||||||
proxy '/sub/fake2.html', '/proxied.html', ignore: true
|
proxy '/sub/fake2.html', '/proxied.html', ignore: true
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class ExtensionOne < ::Middleman::Extension
|
class ExtensionOne < ::Middleman::Extension
|
||||||
helpers do
|
helpers do
|
||||||
def extension_two_was_activated
|
def extension_two_was_activated
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
page '/admin/*', layout: :admin
|
page '/admin/*', layout: :admin
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
activate :directory_indexes
|
activate :directory_indexes
|
||||||
page '/admin/*', layout: :admin
|
page '/admin/*', layout: :admin
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Setup our load paths
|
# Setup our load paths
|
||||||
libdir = __dir__
|
libdir = __dir__
|
||||||
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
|
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue