From a859de3c9ded3ce44b2c715d106b7b5f125898c0 Mon Sep 17 00:00:00 2001 From: Ville Lautanala Date: Sat, 30 Dec 2017 21:09:16 +0200 Subject: [PATCH] Update Rubocop to 0.52 --- Gemfile | 2 +- Rakefile | 4 ++-- lib/uglifier.rb | 8 ++------ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Gemfile b/Gemfile index e12b7c7..403ef1b 100644 --- a/Gemfile +++ b/Gemfile @@ -2,4 +2,4 @@ source "https://rubygems.org" gemspec -gem 'rubocop', '~> 0.51.0', :group => [:development] if RUBY_VERSION >= '2.1' +gem 'rubocop', '~> 0.52.1', :group => [:development] if RUBY_VERSION >= '2.1' diff --git a/Rakefile b/Rakefile index 3c902c0..6901d76 100644 --- a/Rakefile +++ b/Rakefile @@ -1,7 +1,5 @@ # encoding: utf-8 -# rubocop:disable Metrics/BlockLength - require 'fileutils' require 'bundler/gem_tasks' require 'rspec/core/rake_task' @@ -24,6 +22,7 @@ def changelog_tail end end +# rubocop:disable Metrics/BlockLength namespace :uglifyjs do desc "Update UglifyJS source to version specified in VERSION environment variable" task :update do @@ -84,6 +83,7 @@ namespace :uglifyjs do `git commit -m "Update UglifyJS to #{version}"` end end +# rubocop:enable Metrics/BlockLength desc "Update UglifyJS to version specified in VERSION environment variable" task :uglifyjs => ['uglifyjs:update', 'uglifyjs:build', 'uglifyjs:changelog', 'uglifyjs:commit'] diff --git a/lib/uglifier.rb b/lib/uglifier.rb index 83b7d10..0c1310c 100644 --- a/lib/uglifier.rb +++ b/lib/uglifier.rb @@ -188,9 +188,7 @@ def source_map_comments suffix += "\n//# sourceMappingURL=" + @options[:source_map][:map_url] end - if @options[:source_map][:url] - suffix += "\n//# sourceURL=" + @options[:source_map][:url] - end + suffix += "\n//# sourceURL=" + @options[:source_map][:url] if @options[:source_map][:url] suffix end @@ -449,9 +447,7 @@ def input_source_map(source, generate_map) source_map_options = @options[:source_map].is_a?(Hash) ? @options[:source_map] : {} sanitize_map_root(source_map_options.fetch(:input_source_map) do url = extract_source_mapping_url(source) - if url && url.start_with?("data:") - Base64.strict_decode64(url.split(",", 2)[-1]) - end + Base64.strict_decode64(url.split(",", 2)[-1]) if url && url.start_with?("data:") end) rescue ArgumentError, JSON::ParserError nil