Skip to content

Commit

Permalink
Fix SpaceInsidePercentLiteralDelimiters offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdefreyne committed Jun 28, 2016
1 parent d82741f commit b5edd86
Show file tree
Hide file tree
Showing 29 changed files with 90 additions and 90 deletions.
6 changes: 3 additions & 3 deletions lib/nanoc/base/entities/configuration.rb
Expand Up @@ -22,9 +22,9 @@ class Configuration
# that lacks some options, the default value will be taken from
# `DEFAULT_CONFIG`.
DEFAULT_CONFIG = {
text_extensions: %w( adoc asciidoc atom css erb haml htm html js less markdown md php rb sass scss txt xhtml xml coffee hb handlebars mustache ms slim rdoc ).sort,
lib_dirs: %w( lib ),
commands_dirs: %w( commands ),
text_extensions: %w(adoc asciidoc atom css erb haml htm html js less markdown md php rb sass scss txt xhtml xml coffee hb handlebars mustache ms slim rdoc).sort,
lib_dirs: %w(lib),
commands_dirs: %w(commands),
output_dir: 'output',
data_sources: [{}],
index_filenames: ['index.html'],
Expand Down
2 changes: 1 addition & 1 deletion lib/nanoc/base/repos/config_loader.rb
Expand Up @@ -26,7 +26,7 @@ def self.cwd_is_nanoc_site?

# @return [String]
def self.config_filename_for_cwd
filenames = %w( nanoc.yaml config.yaml )
filenames = %w(nanoc.yaml config.yaml)
candidate = filenames.find { |f| File.file?(f) }
candidate && File.expand_path(candidate)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/nanoc/cli.rb
Expand Up @@ -203,7 +203,7 @@ def self.setup_cleaning_streams
def self.enable_utf8?(io)
return true unless io.tty?

%w( LC_ALL LC_CTYPE LANG ).any? { |e| ENV[e] =~ /UTF/i }
%w(LC_ALL LC_CTYPE LANG).any? { |e| ENV[e] =~ /UTF/i }
end

# @return [Boolean] true if color support is present, false if not
Expand Down
2 changes: 1 addition & 1 deletion lib/nanoc/cli/error_handler.rb
Expand Up @@ -42,7 +42,7 @@ def self.enable
# @return [void]
def handle_while(&_block)
# Set exit handler
%w( INT TERM ).each do |signal|
%w(INT TERM).each do |signal|
Signal.trap(signal) do
puts
exit!(0)
Expand Down
2 changes: 1 addition & 1 deletion lib/nanoc/filters/asciidoc.rb
Expand Up @@ -13,7 +13,7 @@ def run(content, _params = {})
stdout = StringIO.new
stderr = $stderr
piper = Nanoc::Extra::Piper.new(stdout: stdout, stderr: stderr)
piper.run(%w( asciidoc -o - - ), content)
piper.run(%w(asciidoc -o - -), content)
stdout.string
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/nanoc/base/checksummer_spec.rb
Expand Up @@ -49,11 +49,11 @@
end

context 'Array' do
let(:obj) { %w( hello goodbye ) }
let(:obj) { %w(hello goodbye) }
it { is_expected.to eql('Array<String<hello>,String<goodbye>,>') }

context 'different order' do
let(:obj) { %w( goodbye hello ) }
let(:obj) { %w(goodbye hello) }
it { is_expected.to eql('Array<String<goodbye>,String<hello>,>') }
end

Expand Down
12 changes: 6 additions & 6 deletions spec/nanoc/cli/commands/deploy_spec.rb
Expand Up @@ -84,12 +84,12 @@
end

context '--list-deployers' do
let(:command) { %w( deploy --list-deployers ) }
let(:command) { %w(deploy --list-deployers) }
include_examples 'lists all deployers'
end

context '-D' do
let(:command) { %w( deploy -D ) }
let(:command) { %w(deploy -D) }
include_examples 'lists all deployers'
end
end
Expand Down Expand Up @@ -133,19 +133,19 @@
end

context '--list' do
let(:command) { %w( deploy --list ) }
let(:command) { %w(deploy --list) }
include_examples 'lists all deployment configurations'
end

context '-L' do
let(:command) { %w( deploy -L ) }
let(:command) { %w(deploy -L) }
include_examples 'lists all deployment configurations'
end
end

describe 'deploying' do
let(:run) { Nanoc::CLI.run(command) }
let(:command) { %w( deploy ) }
let(:command) { %w(deploy) }

before do
FileUtils.mkdir_p('output')
Expand Down Expand Up @@ -251,7 +251,7 @@
end

context 'non-default target' do
let(:command) { %w( deploy --target production ) }
let(:command) { %w(deploy --target production) }

context 'requested deploy config does not exist' do
it 'errors' do
Expand Down
8 changes: 4 additions & 4 deletions spec/nanoc/helpers/tagging_spec.rb
Expand Up @@ -32,7 +32,7 @@
end

context 'one tag' do
let(:item_attributes) { { tags: %w( donkey ) } }
let(:item_attributes) { { tags: %w(donkey) } }

context 'implicit base_url' do
it { is_expected.to eql('donkey') }
Expand All @@ -50,16 +50,16 @@
end

context 'two tags' do
let(:item_attributes) { { tags: %w( donkey giraffe ) } }
let(:item_attributes) { { tags: %w(donkey giraffe) } }
it { is_expected.to eql('donkey, giraffe') }
end

context 'three tags' do
let(:item_attributes) { { tags: %w( donkey giraffe zebra ) } }
let(:item_attributes) { { tags: %w(donkey giraffe zebra) } }
it { is_expected.to eql('donkey, giraffe, zebra') }

context 'custom separator' do
let(:item_attributes) { { tags: %w( donkey giraffe zebra ) } }
let(:item_attributes) { { tags: %w(donkey giraffe zebra) } }
let(:params) { { separator: ' / ' } }
it { is_expected.to eql('donkey / giraffe / zebra') }
end
Expand Down
2 changes: 1 addition & 1 deletion spec/nanoc/regressions/gh_804_spec.rb
Expand Up @@ -17,7 +17,7 @@
end

it 'does not crash' do
expect { Nanoc::CLI.run(%w( check donkey )) }.to(
expect { Nanoc::CLI.run(%w(check donkey)) }.to(
raise_error(Nanoc::Int::Errors::GenericTrivial, 'One or more checks failed').and(
output(/Issues found!\n \(global\):\n \[ (\e\[31m)?ERROR(\e\[0m)? \] donkey - Not enough donkeys\n \/catlady.md:\n \[ (\e\[31m)?ERROR(\e\[0m)? \] donkey - Too many cats\n/).to_stdout,
),
Expand Down
2 changes: 1 addition & 1 deletion spec/nanoc/regressions/gh_809_spec.rb
Expand Up @@ -12,6 +12,6 @@
Nanoc::CLI.run(['compile'])

regex = /Running check stale… (\e\[32m)?ok(\e\[0m)?/
expect { Nanoc::CLI.run(%w( check stale )) }.to output(regex).to_stdout
expect { Nanoc::CLI.run(%w(check stale)) }.to output(regex).to_stdout
end
end
2 changes: 1 addition & 1 deletion spec/nanoc/regressions/gh_841_spec.rb
Expand Up @@ -10,6 +10,6 @@
end

it 'preprocesses before running the check' do
Nanoc::CLI.run(%w( check stale ))
Nanoc::CLI.run(%w(check stale))
end
end
2 changes: 1 addition & 1 deletion spec/nanoc/regressions/gh_867_spec.rb
Expand Up @@ -10,6 +10,6 @@
end

it 'preprocesses before running show-data' do
expect { Nanoc::CLI.run(%w( show-data )) }.not_to output(/foo/).to_stdout
expect { Nanoc::CLI.run(%w(show-data)) }.not_to output(/foo/).to_stdout
end
end
16 changes: 8 additions & 8 deletions test/base/test_compiler.rb
Expand Up @@ -156,7 +156,7 @@ def test_compile_with_two_mutually_dependent_reps

def test_disallow_routes_not_starting_with_slash
# Create site
Nanoc::CLI.run %w( create_site bar)
Nanoc::CLI.run %w(create_site bar)

FileUtils.cd('bar') do
# Create routes
Expand All @@ -183,7 +183,7 @@ def test_disallow_routes_not_starting_with_slash

def test_disallow_duplicate_routes
# Create site
Nanoc::CLI.run %w( create_site bar)
Nanoc::CLI.run %w(create_site bar)

FileUtils.cd('bar') do
# Create routes
Expand All @@ -209,10 +209,10 @@ def test_disallow_duplicate_routes
end

def test_compile_should_recompile_all_reps
Nanoc::CLI.run %w( create_site bar )
Nanoc::CLI.run %w(create_site bar)

FileUtils.cd('bar') do
Nanoc::CLI.run %w( compile )
Nanoc::CLI.run %w(compile)

site = Nanoc::Int::SiteLoader.new.new_from_cwd
site.compile
Expand All @@ -225,7 +225,7 @@ def test_compile_should_recompile_all_reps

def test_disallow_multiple_snapshots_with_the_same_name
# Create site
Nanoc::CLI.run %w( create_site bar )
Nanoc::CLI.run %w(create_site bar)

FileUtils.cd('bar') do
# Create routes
Expand Down Expand Up @@ -447,8 +447,8 @@ def test_unfiltered_binary_item_should_not_be_moved_outside_content
site = Nanoc::Int::SiteLoader.new.new_from_cwd
site.compile

assert_equal Set.new(%w( content/blah.dat )), Set.new(Dir['content/*'])
assert_equal Set.new(%w( output/blah.dat )), Set.new(Dir['output/*'])
assert_equal Set.new(%w(content/blah.dat)), Set.new(Dir['content/*'])
assert_equal Set.new(%w(output/blah.dat)), Set.new(Dir['output/*'])
end
end

Expand All @@ -469,7 +469,7 @@ def test_tmp_text_items_are_removed_after_compilation
end

def test_find_layouts_by_glob
Nanoc::CLI.run %w( create_site bar )
Nanoc::CLI.run %w(create_site bar)
FileUtils.cd('bar') do
File.open('Rules', 'w') do |io|
io.write "compile '/**/*' do\n"
Expand Down
2 changes: 1 addition & 1 deletion test/base/test_site.rb
Expand Up @@ -96,7 +96,7 @@ def test_initialize_with_parent_config_file_cycle
end

def test_identifier_classes
Nanoc::CLI.run %w( create_site bar)
Nanoc::CLI.run %w(create_site bar)
FileUtils.cd('bar') do
FileUtils.mkdir_p('content')
FileUtils.mkdir_p('layouts')
Expand Down
4 changes: 2 additions & 2 deletions test/cli/commands/test_check.rb
Expand Up @@ -4,12 +4,12 @@ def test_check_stale
FileUtils.mkdir_p('output')

# Should not raise now
Nanoc::CLI.run %w( check stale )
Nanoc::CLI.run %w(check stale)

# Should raise now
File.open('output/blah.html', 'w') { |io| io.write 'moo' }
assert_raises Nanoc::Int::Errors::GenericTrivial do
Nanoc::CLI.run %w( check stale )
Nanoc::CLI.run %w(check stale)
end
end
end
Expand Down
12 changes: 6 additions & 6 deletions test/cli/commands/test_compile.rb
Expand Up @@ -21,7 +21,7 @@ def test_profiling_information
io.write "layout '*', :erb\n"
end

Nanoc::CLI.run %w( compile --verbose )
Nanoc::CLI.run %w(compile --verbose)
end
end

Expand Down Expand Up @@ -58,7 +58,7 @@ def test_auto_prune
end

assert File.file?('output/stray.html')
Nanoc::CLI.run %w( compile )
Nanoc::CLI.run %w(compile)
assert File.file?('output/stray.html')

File.open('nanoc.yaml', 'w') do |io|
Expand All @@ -68,7 +68,7 @@ def test_auto_prune
end

assert File.file?('output/stray.html')
Nanoc::CLI.run %w( compile )
Nanoc::CLI.run %w(compile)
refute File.file?('output/stray.html')
end
end
Expand Down Expand Up @@ -108,7 +108,7 @@ def test_auto_prune_with_exclude
end

assert File.file?('output/stray.html')
Nanoc::CLI.run %w( compile )
Nanoc::CLI.run %w(compile)
assert File.file?('output/stray.html')

File.open('nanoc.yaml', 'w') do |io|
Expand All @@ -119,7 +119,7 @@ def test_auto_prune_with_exclude
end

assert File.file?('output/stray.html')
Nanoc::CLI.run %w( compile )
Nanoc::CLI.run %w(compile)
refute File.file?('output/stray.html')
assert File.directory?('output/excluded_dir'), 'excluded_dir should still be there'
end
Expand Down Expand Up @@ -205,7 +205,7 @@ def test_file_action_printer_skip
def new_file_action_printer(reps)
# Ensure CLI is loaded
begin
Nanoc::CLI.run(%w( help %))
Nanoc::CLI.run(%w(help %))
rescue SystemExit
end

Expand Down
24 changes: 12 additions & 12 deletions test/cli/commands/test_create_site.rb
@@ -1,13 +1,13 @@
class Nanoc::CLI::Commands::CreateSiteTest < Nanoc::TestCase
def test_create_site_with_existing_name
Nanoc::CLI.run %w( create_site foo )
Nanoc::CLI.run %w(create_site foo)
assert_raises(::Nanoc::Int::Errors::GenericTrivial) do
Nanoc::CLI.run %w( create_site foo )
Nanoc::CLI.run %w(create_site foo)
end
end

def test_can_compile_new_site
Nanoc::CLI.run %w( create_site foo )
Nanoc::CLI.run %w(create_site foo)

FileUtils.cd('foo') do
site = Nanoc::Int::SiteLoader.new.new_from_cwd
Expand All @@ -19,14 +19,14 @@ def test_can_compile_new_site_in_current_directory
FileUtils.mkdir('foo')

FileUtils.cd('foo') do
Nanoc::CLI.run %w( create_site ./ )
Nanoc::CLI.run %w(create_site ./)
site = Nanoc::Int::SiteLoader.new.new_from_cwd
site.compile
end
end

def test_can_compile_new_site_with_binary_items
Nanoc::CLI.run %w( create_site foo )
Nanoc::CLI.run %w(create_site foo)

FileUtils.cd('foo') do
File.open('content/blah', 'w') { |io| io << 'asdf' }
Expand All @@ -40,7 +40,7 @@ def test_can_compile_new_site_with_binary_items
def test_can_compile_site_in_nonempty_directory
FileUtils.mkdir('foo')
FileUtils.touch(File.join('foo', 'SomeFile.txt'))
Nanoc::CLI.run %w( create_site foo --force )
Nanoc::CLI.run %w(create_site foo --force)

FileUtils.cd('foo') do
site = Nanoc::Int::SiteLoader.new.new_from_cwd
Expand All @@ -51,7 +51,7 @@ def test_can_compile_site_in_nonempty_directory
def test_compiled_site_output
FileUtils.mkdir('foo')
FileUtils.touch(File.join('foo', 'SomeFile.txt'))
Nanoc::CLI.run %w( create_site foo --force )
Nanoc::CLI.run %w(create_site foo --force)

FileUtils.cd('foo') do
site = Nanoc::Int::SiteLoader.new.new_from_cwd
Expand All @@ -70,7 +70,7 @@ def test_default_encoding
original_encoding = Encoding.default_external
Encoding.default_external = 'ISO-8859-1' # ew!

Nanoc::CLI.run %w( create_site foo )
Nanoc::CLI.run %w(create_site foo)

FileUtils.cd('foo') do
# Try with encoding = default encoding = utf-8
Expand All @@ -97,9 +97,9 @@ def test_default_encoding
end

def test_new_site_has_correct_stylesheets
Nanoc::CLI.run %w( create_site foo )
Nanoc::CLI.run %w(create_site foo)
FileUtils.cd('foo') do
Nanoc::CLI.run %w( compile )
Nanoc::CLI.run %w(compile)

assert File.file?('content/stylesheet.css')
assert_match(/\/stylesheet.css/, File.read('output/index.html'))
Expand All @@ -109,12 +109,12 @@ def test_new_site_has_correct_stylesheets
def test_new_site_prunes_by_default
FileUtils.mkdir('foo')
FileUtils.touch(File.join('foo', 'SomeFile.txt'))
Nanoc::CLI.run %w( create_site foo --force )
Nanoc::CLI.run %w(create_site foo --force)

FileUtils.cd('foo') do
File.write('output/blah.txt', 'stuff')

Nanoc::CLI.run %w( compile )
Nanoc::CLI.run %w(compile)

refute File.file?('output/blah.txt')
end
Expand Down

0 comments on commit b5edd86

Please sign in to comment.