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