From 953fbeea89f7a675e52f30384795d0eb9e161ddf Mon Sep 17 00:00:00 2001 From: jaredcwhite Date: Mon, 27 Jun 2022 14:57:55 +0000 Subject: [PATCH] Update multiline strings based on latest RuboCop --- .gitpod.yml | 8 ++++++++ bridgetown-core/features/step_definitions.rb | 10 +++++----- .../lib/bridgetown-core/collection.rb | 4 ++-- .../lib/bridgetown-core/commands/apply.rb | 6 +++--- .../lib/bridgetown-core/commands/build.rb | 12 +++++------ .../commands/concerns/build_options.rb | 4 ++-- .../lib/bridgetown-core/commands/console.rb | 10 +++++----- .../lib/bridgetown-core/commands/doctor.rb | 14 ++++++------- .../lib/bridgetown-core/commands/new.rb | 20 +++++++++---------- .../lib/bridgetown-core/commands/serve.rb | 4 ++-- .../lib/bridgetown-core/component.rb | 2 +- .../bridgetown-core/concerns/transformable.rb | 4 ++-- .../lib/bridgetown-core/configuration.rb | 4 ++-- .../lib/bridgetown-core/model/base.rb | 4 ++-- .../lib/bridgetown-core/rack/boot.rb | 4 ++-- .../lib/bridgetown-core/static_file.rb | 2 +- .../lib/bridgetown-core/tags/highlight.rb | 2 +- .../lib/bridgetown-core/tags/post_url.rb | 2 +- bridgetown-core/lib/bridgetown-core/url.rb | 2 +- .../lib/bridgetown-core/watcher.rb | 4 ++-- bridgetown-core/test/helper.rb | 2 +- bridgetown-core/test/test_apply_command.rb | 2 +- bridgetown-core/test/test_doctor_command.rb | 4 ++-- bridgetown-core/test/test_generated_page.rb | 4 ++-- bridgetown-core/test/test_model.rb | 4 ++-- bridgetown-core/test/test_new_command.rb | 4 ++-- bridgetown-core/test/test_tags.rb | 6 +++--- 27 files changed, 78 insertions(+), 70 deletions(-) create mode 100644 .gitpod.yml diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 000000000..2b5b3b85f --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,8 @@ +# This configuration file was automatically generated by Gitpod. +# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file) +# and commit this file to your remote git repository to share the goodness with others. + +tasks: + - init: bundle install + + diff --git a/bridgetown-core/features/step_definitions.rb b/bridgetown-core/features/step_definitions.rb index 87f92c9aa..b6d94b8a8 100644 --- a/bridgetown-core/features/step_definitions.rb +++ b/bridgetown-core/features/step_definitions.rb @@ -26,7 +26,7 @@ # Given(%r!^I have a blank site in "(.*)"$!) do |path| - FileUtils.mkdir_p(path) unless File.exist?(path) + FileUtils.mkdir_p(path) end # @@ -47,7 +47,7 @@ #{text} DATA else - FileUtils.mkdir_p("src") unless File.exist?("src") + FileUtils.mkdir_p("src") File.write(File.join("src", file), <<~DATA) --- #{key || "layout"}: #{value || "none"} @@ -64,7 +64,7 @@ if Paths.root_files.include?(file.split("/").first) File.write(file, text) else - FileUtils.mkdir_p("src") unless File.exist?("src") + FileUtils.mkdir_p("src") File.write(File.join("src", file), text) end end @@ -85,7 +85,7 @@ if Paths.root_files.include?(file.split("/").first) File.write(file, text) else - FileUtils.mkdir_p("src") unless File.exist?("src") + FileUtils.mkdir_p("src") File.write(File.join("src", file), text) end end @@ -93,7 +93,7 @@ # Given(%r!^I have an? "(.*)" page(?: configured with (.*) "(.*)")? with content:$!) do |file, key, value, text| - FileUtils.mkdir_p("src") unless File.exist?("src") + FileUtils.mkdir_p("src") File.write(File.join("src", file), <<~DATA) --- #{key || "layout"}: #{value || "none"} diff --git a/bridgetown-core/lib/bridgetown-core/collection.rb b/bridgetown-core/lib/bridgetown-core/collection.rb index 4c8fe7fe4..a2ac8d9a5 100644 --- a/bridgetown-core/lib/bridgetown-core/collection.rb +++ b/bridgetown-core/lib/bridgetown-core/collection.rb @@ -343,8 +343,8 @@ def determine_sort_order(sort_key, apples, olives) end def order_with_warning(sort_key, resource, order) - Bridgetown.logger.warn "Sort warning:", "'#{sort_key}' not defined in" \ - " #{resource.relative_path}" + Bridgetown.logger.warn "Sort warning:", "'#{sort_key}' not defined in " \ + "#{resource.relative_path}" order end diff --git a/bridgetown-core/lib/bridgetown-core/commands/apply.rb b/bridgetown-core/lib/bridgetown-core/commands/apply.rb index d89018db3..e8e27a768 100644 --- a/bridgetown-core/lib/bridgetown-core/commands/apply.rb +++ b/bridgetown-core/lib/bridgetown-core/commands/apply.rb @@ -58,9 +58,9 @@ def apply_in_pwd automation_command = args.empty? ? "bridgetown.automation.rb" : args[0] if args.empty? && !File.exist?("bridgetown.automation.rb") - raise ArgumentError, "You must specify a path or a URL," \ - " or add bridgetown.automation.rb to the" \ - " current folder." + raise ArgumentError, "You must specify a path or a URL, " \ + "or add bridgetown.automation.rb to the " \ + "current folder." end Bridgetown.with_unbundled_env do diff --git a/bridgetown-core/lib/bridgetown-core/commands/build.rb b/bridgetown-core/lib/bridgetown-core/commands/build.rb index 3e9f877b3..197ee9dc8 100644 --- a/bridgetown-core/lib/bridgetown-core/commands/build.rb +++ b/bridgetown-core/lib/bridgetown-core/commands/build.rb @@ -22,8 +22,8 @@ def self.banner desc: "Watch for changes and rebuild" def self.print_startup_message - Bridgetown.logger.info "Starting:", "Bridgetown v#{Bridgetown::VERSION.magenta}" \ - " (codename \"#{Bridgetown::CODE_NAME.yellow}\")" + Bridgetown.logger.info "Starting:", "Bridgetown v#{Bridgetown::VERSION.magenta} " \ + "(codename \"#{Bridgetown::CODE_NAME.yellow}\")" end # Build your bridgetown site @@ -45,8 +45,8 @@ def build @site = Bridgetown::Site.new(config_options) if config_options.fetch("skip_initial_build", false) - Bridgetown.logger.warn "Build Warning:", "Skipping the initial build." \ - " This may result in an out-of-date site." + Bridgetown.logger.warn "Build Warning:", "Skipping the initial build. " \ + "This may result in an out-of-date site." else build_site(config_options) end @@ -77,8 +77,8 @@ def build_site(config_options) end Bridgetown.logger.info "Generating…" @site.process - Bridgetown.logger.info "Done! 🎉", "#{"Completed".bold.green} in less than" \ - " #{(Time.now - t).ceil(2)} seconds." + Bridgetown.logger.info "Done! 🎉", "#{"Completed".bold.green} in less than " \ + "#{(Time.now - t).ceil(2)} seconds." return unless config_options[:using_puma] diff --git a/bridgetown-core/lib/bridgetown-core/commands/concerns/build_options.rb b/bridgetown-core/lib/bridgetown-core/commands/concerns/build_options.rb index 2da20cf3d..cc92d971a 100644 --- a/bridgetown-core/lib/bridgetown-core/commands/concerns/build_options.rb +++ b/bridgetown-core/lib/bridgetown-core/commands/concerns/build_options.rb @@ -21,8 +21,8 @@ def self.extended(klass) desc: "Destination directory (defaults to output)" klass.class_option :root_dir, aliases: "-r", - desc: "The top-level root folder" \ - " where config files are located" + desc: "The top-level root folder " \ + "where config files are located" klass.class_option :plugins_dir, aliases: "-p", type: :array, diff --git a/bridgetown-core/lib/bridgetown-core/commands/console.rb b/bridgetown-core/lib/bridgetown-core/commands/console.rb index 6f0e53a5e..bfb063809 100644 --- a/bridgetown-core/lib/bridgetown-core/commands/console.rb +++ b/bridgetown-core/lib/bridgetown-core/commands/console.rb @@ -64,9 +64,9 @@ def console require "irb/ext/save-history" require "amazing_print" unless options[:"bypass-ap"] - Bridgetown.logger.info "Starting:", "Bridgetown v#{Bridgetown::VERSION.magenta}" \ - " (codename \"#{Bridgetown::CODE_NAME.yellow}\")" \ - " console…" + Bridgetown.logger.info "Starting:", "Bridgetown v#{Bridgetown::VERSION.magenta} " \ + "(codename \"#{Bridgetown::CODE_NAME.yellow}\") " \ + "console…" Bridgetown.logger.info "Environment:", Bridgetown.environment.cyan site = Bridgetown::Site.new(configuration_with_overrides(options)) @@ -80,8 +80,8 @@ def console IRB.conf[:MAIN_CONTEXT] = irb.context Bridgetown.logger.info "Console:", "Your site is now available as #{"site".cyan}" Bridgetown.logger.info "", - "You can also access #{"collections".cyan} or perform a" \ - " #{"reload!".cyan}" + "You can also access #{"collections".cyan} or perform a " \ + "#{"reload!".cyan}" trap("SIGINT") do irb.signal_handle diff --git a/bridgetown-core/lib/bridgetown-core/commands/doctor.rb b/bridgetown-core/lib/bridgetown-core/commands/doctor.rb index 3cc05468c..9c74e1059 100644 --- a/bridgetown-core/lib/bridgetown-core/commands/doctor.rb +++ b/bridgetown-core/lib/bridgetown-core/commands/doctor.rb @@ -62,8 +62,8 @@ def conflicting_urls(site) next unless paths.size > 1 conflicting_urls = true - Bridgetown.logger.warn "Conflict:", "The URL '#{url}' is the destination" \ - " for the following pages: #{paths.join(", ")}" + Bridgetown.logger.warn "Conflict:", "The URL '#{url}' is the destination " \ + "for the following pages: #{paths.join(", ")}" end conflicting_urls end @@ -77,8 +77,8 @@ def urls_only_differ_by_case(site) urls_only_differ_by_case = true Bridgetown.logger.warn( "Warning:", - "The following URLs only differ by case. On a case-insensitive file system one of the" \ - " URLs will be overwritten by the other: #{real_urls.join(", ")}" + "The following URLs only differ by case. On a case-insensitive file system one of " \ + "the URLs will be overwritten by the other: #{real_urls.join(", ")}" ) end urls_only_differ_by_case @@ -121,7 +121,7 @@ def case_insensitive_urls(things, _destination) def url_exists?(url) return true unless url.nil? || url.empty? - Bridgetown.logger.warn "Warning:", "You didn't set an URL in the config file, "\ + Bridgetown.logger.warn "Warning:", "You didn't set an URL in the config file, " \ "you may encounter problems with some plugins." false end @@ -132,7 +132,7 @@ def url_valid?(url) # Addressable::URI#parse only raises a TypeError # https://git.io/vFfbx rescue TypeError - Bridgetown.logger.warn "Warning:", "The site URL does not seem to be valid, "\ + Bridgetown.logger.warn "Warning:", "The site URL does not seem to be valid, " \ "check the value of `url` in your config file." false end @@ -140,7 +140,7 @@ def url_valid?(url) def url_absolute(url) return true if url.is_a?(String) && Addressable::URI.parse(url).absolute? - Bridgetown.logger.warn "Warning:", "Your site URL does not seem to be absolute, "\ + Bridgetown.logger.warn "Warning:", "Your site URL does not seem to be absolute, " \ "check the value of `url` in your config file." false end diff --git a/bridgetown-core/lib/bridgetown-core/commands/new.rb b/bridgetown-core/lib/bridgetown-core/commands/new.rb index e91859b1e..661979a27 100644 --- a/bridgetown-core/lib/bridgetown-core/commands/new.rb +++ b/bridgetown-core/lib/bridgetown-core/commands/new.rb @@ -68,8 +68,8 @@ def new_site if preserve_source_location?(new_site_path, options) say_status :conflict, "#{new_site_path} exists and is not empty.", :red Bridgetown.logger.abort_with( - "Ensure #{new_site_path} is empty or else try again with `--force` to proceed and" \ - " overwrite any files." + "Ensure #{new_site_path} is empty or else try again with `--force` to proceed and " \ + "overwrite any files." ) end @@ -194,18 +194,18 @@ def after_install(path, cli_path, options = {}) logger = Bridgetown.logger bt_start = "bin/bridgetown start" logger.info "" - logger.info "Success!".green, "🎉 Your new Bridgetown site was" \ - " generated in #{cli_path.cyan}." + logger.info "Success!".green, "🎉 Your new Bridgetown site was " \ + "generated in #{cli_path.cyan}." if options["skip-yarn"] logger.info "You can now #{"cd".cyan} #{cli_path.cyan} to get started." - logger.info "You'll probably also want to #{"yarn install".cyan}" \ - " to load in your frontend assets." + logger.info "You'll probably also want to #{"yarn install".cyan} " \ + "to load in your frontend assets." else - logger.info "You can now #{"cd".cyan} #{cli_path.cyan} and run #{bt_start.cyan}" \ - " to get started." + logger.info "You can now #{"cd".cyan} #{cli_path.cyan} and run #{bt_start.cyan} " \ + "to get started." end - logger.info "Then check out our online documentation for" \ - " next steps: #{DOCSURL.cyan}" + logger.info "Then check out our online documentation for " \ + "next steps: #{DOCSURL.cyan}" if @skipped_bundle logger.info "Bundle install skipped.".yellow diff --git a/bridgetown-core/lib/bridgetown-core/commands/serve.rb b/bridgetown-core/lib/bridgetown-core/commands/serve.rb index 9a4abd0f3..7dfa7ccff 100644 --- a/bridgetown-core/lib/bridgetown-core/commands/serve.rb +++ b/bridgetown-core/lib/bridgetown-core/commands/serve.rb @@ -178,8 +178,8 @@ def boot_or_detach(server, opts) Process.detach(pid) Bridgetown.logger.info "Server detached with pid '#{pid}'.", \ - "Run `pkill -f bridgetown' or `kill -9 #{pid}'" \ - " to stop the server." + "Run `pkill -f bridgetown' or `kill -9 #{pid}' " \ + "to stop the server." else t = Thread.new { server.start } trap("INT") { server.shutdown } diff --git a/bridgetown-core/lib/bridgetown-core/component.rb b/bridgetown-core/lib/bridgetown-core/component.rb index b463ccc99..8040fd1af 100644 --- a/bridgetown-core/lib/bridgetown-core/component.rb +++ b/bridgetown-core/lib/bridgetown-core/component.rb @@ -136,7 +136,7 @@ def render_in(view_context, &block) end rescue StandardError => e Bridgetown.logger.error "Component error:", - "#{self.class} encountered an error while "\ + "#{self.class} encountered an error while " \ "rendering `#{self.class.path_for_errors}'" raise e end diff --git a/bridgetown-core/lib/bridgetown-core/concerns/transformable.rb b/bridgetown-core/lib/bridgetown-core/concerns/transformable.rb index e203f094a..f00f39263 100644 --- a/bridgetown-core/lib/bridgetown-core/concerns/transformable.rb +++ b/bridgetown-core/lib/bridgetown-core/concerns/transformable.rb @@ -23,7 +23,7 @@ def transform_content(document) output.html_safe rescue StandardError => e Bridgetown.logger.error "Conversion error:", - "#{converter.class} encountered an error while "\ + "#{converter.class} encountered an error while " \ "converting `#{document.relative_path}'" raise e end @@ -53,7 +53,7 @@ def transform_with_layout(layout, output, document) layout_output rescue StandardError => e Bridgetown.logger.error "Conversion error:", - "#{converter.class} encountered an error while "\ + "#{converter.class} encountered an error while " \ "converting `#{document.relative_path}'" raise e end diff --git a/bridgetown-core/lib/bridgetown-core/configuration.rb b/bridgetown-core/lib/bridgetown-core/configuration.rb index e7c2e938d..8d493df8f 100644 --- a/bridgetown-core/lib/bridgetown-core/configuration.rb +++ b/bridgetown-core/lib/bridgetown-core/configuration.rb @@ -208,8 +208,8 @@ def read_config_files(files) config = Utils.deep_merge_hashes(self, new_config) end rescue ArgumentError => e - Bridgetown.logger.warn "WARNING:", "Error reading configuration. Using defaults" \ - " (and options)." + Bridgetown.logger.warn "WARNING:", "Error reading configuration. Using defaults " \ + "(and options)." warn e end diff --git a/bridgetown-core/lib/bridgetown-core/model/base.rb b/bridgetown-core/lib/bridgetown-core/model/base.rb index 0aa41ab4e..33d3247d8 100644 --- a/bridgetown-core/lib/bridgetown-core/model/base.rb +++ b/bridgetown-core/lib/bridgetown-core/model/base.rb @@ -152,8 +152,8 @@ def method_missing(method_name, *args) return attributes[key] end - Bridgetown.logger.warn "key `#{method_name}' not found in attributes for" \ - " #{attributes[:id].presence || "new #{self.class}"}" + Bridgetown.logger.warn "key `#{method_name}' not found in attributes for " \ + "#{attributes[:id].presence || "new #{self.class}"}" nil end diff --git a/bridgetown-core/lib/bridgetown-core/rack/boot.rb b/bridgetown-core/lib/bridgetown-core/rack/boot.rb index dfc16aa1d..22e0eba9c 100644 --- a/bridgetown-core/lib/bridgetown-core/rack/boot.rb +++ b/bridgetown-core/lib/bridgetown-core/rack/boot.rb @@ -33,8 +33,8 @@ def self.boot(roda_app = nil) rescue Roda::RodaError => e if e.message.include?("sessions plugin :secret option") raise Bridgetown::Errors::InvalidConfigurationError, - "The Roda sessions plugin can't find a valid secret. Run `bin/bridgetown secret'" \ - " and put the key in a ENV var you can use to configure the session in `roda_app.rb'" + "The Roda sessions plugin can't find a valid secret. Run `bin/bridgetown secret' " \ + "and put the key in a ENV var you can use to configure the session in `roda_app.rb'" end raise e diff --git a/bridgetown-core/lib/bridgetown-core/static_file.rb b/bridgetown-core/lib/bridgetown-core/static_file.rb index fcb154752..cbf30ce38 100644 --- a/bridgetown-core/lib/bridgetown-core/static_file.rb +++ b/bridgetown-core/lib/bridgetown-core/static_file.rb @@ -108,7 +108,7 @@ def write(dest) self.class.mtimes[path] = mtime FileUtils.mkdir_p(File.dirname(dest_path)) - FileUtils.rm(dest_path) if File.exist?(dest_path) + FileUtils.rm_rf(dest_path) Bridgetown.logger.debug "Saving file:", dest_path copy_file(dest_path) diff --git a/bridgetown-core/lib/bridgetown-core/tags/highlight.rb b/bridgetown-core/lib/bridgetown-core/tags/highlight.rb index 87b98975c..3239cd643 100644 --- a/bridgetown-core/lib/bridgetown-core/tags/highlight.rb +++ b/bridgetown-core/lib/bridgetown-core/tags/highlight.rb @@ -88,7 +88,7 @@ def add_code_tag(code) "class=\"language-#{@lang.to_s.tr("+", "-")}\"", "data-lang=\"#{@lang}\"", ].join(" ") - "
"\
+        "
" \
           "#{code.chomp}
" end end diff --git a/bridgetown-core/lib/bridgetown-core/tags/post_url.rb b/bridgetown-core/lib/bridgetown-core/tags/post_url.rb index 60bbe0101..93e2a0347 100644 --- a/bridgetown-core/lib/bridgetown-core/tags/post_url.rb +++ b/bridgetown-core/lib/bridgetown-core/tags/post_url.rb @@ -80,7 +80,7 @@ def render(context) next unless @post.deprecated_equality document Bridgetown::Deprecator.deprecation_message( - "A call to "\ + "A call to " \ "'{% post_url #{@post.name} %}' did not match " \ "a post using the new matching method of checking name " \ "(path-date-slug) equality. Please make sure that you " \ diff --git a/bridgetown-core/lib/bridgetown-core/url.rb b/bridgetown-core/lib/bridgetown-core/url.rb index 39d9f3768..25cc10b05 100644 --- a/bridgetown-core/lib/bridgetown-core/url.rb +++ b/bridgetown-core/lib/bridgetown-core/url.rb @@ -100,7 +100,7 @@ def generate_url_from_drop(template) winner = pool.find { |key| @placeholders.key?(key) } if winner.nil? raise NoMethodError, - "The URL template doesn't have #{pool.join(" or ")} keys. "\ + "The URL template doesn't have #{pool.join(" or ")} keys. " \ "Check your permalink template!" end diff --git a/bridgetown-core/lib/bridgetown-core/watcher.rb b/bridgetown-core/lib/bridgetown-core/watcher.rb index ec28a55cf..4fd7245f7 100644 --- a/bridgetown-core/lib/bridgetown-core/watcher.rb +++ b/bridgetown-core/lib/bridgetown-core/watcher.rb @@ -99,8 +99,8 @@ def reload_site(site, options, paths: []) # rubocop:todo Metrics/MethodLength site.process end - Bridgetown.logger.info "Done! 🎉", "#{"Completed".bold.green} in less than" \ - " #{(Time.now - time).ceil(2)} seconds." + Bridgetown.logger.info "Done! 🎉", "#{"Completed".bold.green} in less than " \ + "#{(Time.now - time).ceil(2)} seconds." rescue StandardError => e Bridgetown::Errors.print_build_error(e, trace: options[:trace]) end diff --git a/bridgetown-core/test/helper.rb b/bridgetown-core/test/helper.rb index 572282323..2cadcc2ac 100644 --- a/bridgetown-core/test/helper.rb +++ b/bridgetown-core/test/helper.rb @@ -112,7 +112,7 @@ def mu_pp(obj) end def mocks_expect(*args) - RSpec::Mocks::ExampleMethods::ExpectHost.instance_method(:expect)\ + RSpec::Mocks::ExampleMethods::ExpectHost.instance_method(:expect) \ .bind_call(self, *args) end diff --git a/bridgetown-core/test/test_apply_command.rb b/bridgetown-core/test/test_apply_command.rb index 261f72659..2575702c0 100644 --- a/bridgetown-core/test/test_apply_command.rb +++ b/bridgetown-core/test/test_apply_command.rb @@ -8,7 +8,7 @@ class TestApplyCommand < BridgetownUnitTest context "the apply command" do setup do @cmd = Bridgetown::Commands::Apply.new - File.delete("bridgetown.automation.rb") if File.exist?("bridgetown.automation.rb") + FileUtils.rm_rf("bridgetown.automation.rb") @template = "" + <<-TEMPLATE say_status :urltest, "Works!" TEMPLATE diff --git a/bridgetown-core/test/test_doctor_command.rb b/bridgetown-core/test/test_doctor_command.rb index 34e9045c4..db735e6c3 100644 --- a/bridgetown-core/test/test_doctor_command.rb +++ b/bridgetown-core/test/test_doctor_command.rb @@ -33,8 +33,8 @@ class TestDoctorCommand < BridgetownUnitTest ret = Bridgetown::Commands::Doctor.new.send(:urls_only_differ_by_case, @site) assert_equal true, ret end - assert_includes output, "Warning: The following URLs only differ by case. "\ - "On a case-insensitive file system one of the URLs will be overwritten by the "\ + assert_includes output, "Warning: The following URLs only differ by case. " \ + "On a case-insensitive file system one of the URLs will be overwritten by the " \ "other: #{dest_dir}/about/index.html, #{dest_dir}/About/index.html" end end diff --git a/bridgetown-core/test/test_generated_page.rb b/bridgetown-core/test/test_generated_page.rb index 962e53b3f..199991ee1 100644 --- a/bridgetown-core/test/test_generated_page.rb +++ b/bridgetown-core/test/test_generated_page.rb @@ -95,7 +95,7 @@ def render_and_write refute File.exist?(dest_dir("virtual-about", "index.html")) end - should "be processed and written to destination when passed as "\ + should "be processed and written to destination when passed as " \ "an entry in 'site.generated_pages' array" do @page.content = "{{ site.title }}" @page.data["permalink"] = "/virtual-about/" @@ -305,7 +305,7 @@ def render_and_write should "not be writable outside of destination" do unexpected = File.expand_path("../../../baddie.html", dest_dir) - File.delete unexpected if File.exist?(unexpected) + FileUtils.rm_rf unexpected page = setup_page("exploit.md") do_render(page) page.write(dest_dir) diff --git a/bridgetown-core/test/test_model.rb b/bridgetown-core/test/test_model.rb index 68e7525da..6924402e7 100644 --- a/bridgetown-core/test/test_model.rb +++ b/bridgetown-core/test/test_model.rb @@ -23,7 +23,7 @@ class TestModel < BridgetownUnitTest assert_equal model.layout, new_model.layout.to_sym assert_equal model.content, new_model.content ensure - File.delete(@filepath) if File.exist?(@filepath) + FileUtils.rm_rf(@filepath) end should "refrain from overwriting non-YAML front matter files" do @@ -42,7 +42,7 @@ class TestModel < BridgetownUnitTest assert_includes File.read(@filepath), "---\ntitle: Hello" ensure - File.delete(@filepath) if File.exist?(@filepath) + FileUtils.rm_rf(@filepath) end end end diff --git a/bridgetown-core/test/test_new_command.rb b/bridgetown-core/test/test_new_command.rb index b9170c349..32da3339d 100644 --- a/bridgetown-core/test/test_new_command.rb +++ b/bridgetown-core/test/test_new_command.rb @@ -103,8 +103,8 @@ def static_template_files output = capture_output do Bridgetown::Commands::Base.start(argumentize(@args)) end - success_message = "Your new Bridgetown site was generated in" \ - " #{@path.cyan}." + success_message = "Your new Bridgetown site was generated in " \ + "#{@path.cyan}." assert_includes output, success_message end diff --git a/bridgetown-core/test/test_tags.rb b/bridgetown-core/test/test_tags.rb index 44a1f56b1..23c0f030a 100644 --- a/bridgetown-core/test/test_tags.rb +++ b/bridgetown-core/test/test_tags.rb @@ -449,9 +449,9 @@ def highlight_block_with_opts(options_string) end should "throw a deprecation warning" do - deprecation_warning = " Deprecation: A call to "\ - "'{% post_url 2008-11-21-nested %}' did not match a post using the new matching "\ - "method of checking name (path-date-slug) equality. Please make sure that you "\ + deprecation_warning = " Deprecation: A call to " \ + "'{% post_url 2008-11-21-nested %}' did not match a post using the new matching " \ + "method of checking name (path-date-slug) equality. Please make sure that you " \ "change this tag to match the post's name exactly." assert_includes Bridgetown.logger.messages, deprecation_warning end