From fd8fdd87d32f2be1a9bdccfd475c32e291969163 Mon Sep 17 00:00:00 2001 From: Pat Hawks Date: Sun, 3 Jan 2016 17:10:39 -0800 Subject: [PATCH] Rubocop: Style/RegexpLiteral --- lib/jekyll/static_file.rb | 2 +- lib/jekyll/url.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/static_file.rb b/lib/jekyll/static_file.rb index 881e44b1..72c26741 100644 --- a/lib/jekyll/static_file.rb +++ b/lib/jekyll/static_file.rb @@ -124,7 +124,7 @@ module Jekyll :template => @collection.url_template, :placeholders => placeholders, }) - end.to_s.gsub /\/$/, '' + end.to_s.gsub(/\/$/, '') end # Returns the type of the collection if present, nil otherwise. diff --git a/lib/jekyll/url.rb b/lib/jekyll/url.rb index 367872c0..950945a7 100644 --- a/lib/jekyll/url.rb +++ b/lib/jekyll/url.rb @@ -92,7 +92,7 @@ module Jekyll # as well as the beginning "/" so we can enforce and ensure it. def sanitize_url(str) - "/" + str.gsub(/\/{2,}/, "/").gsub(%r!\.+\/|\A/+!, "") + "/" + str.gsub(/\/{2,}/, "/").gsub(/\.+\/|\A\/+/, "") end # Escapes a path to be a valid URL path segment