bin/review-compile in review-5.3.0 vs bin/review-compile in review-5.4.0

- old
+ new

@@ -20,11 +20,11 @@ DEFAULT_CONFIG_FILENAME = 'config.yml'.freeze def main Signal.trap(:INT) { exit 1 } - if RUBY_PLATFORM !~ /mswin(?!ce)|mingw|cygwin|bccwin/ + unless RUBY_PLATFORM.match?(/mswin(?!ce)|mingw|cygwin|bccwin/) Signal.trap(:PIPE, 'IGNORE') end _main rescue Errno::EPIPE exit 0 @@ -32,15 +32,13 @@ def _main @logger = ReVIEW.logger @mode = :files @basedir = nil - if File.basename($PROGRAM_NAME).start_with?('review2') - @target = File.basename($PROGRAM_NAME, '.rb').sub('review2', '') - else - @target = nil - end + @target = if File.basename($PROGRAM_NAME).start_with?('review2') + File.basename($PROGRAM_NAME, '.rb').sub('review2', '') + end @check_only = false @output_filename = nil @config = ReVIEW::Configure.values @@ -50,16 +48,16 @@ loader = ReVIEW::YAMLLoader.new if @config['yaml'] error! "#{@config['yaml']} not found." unless File.exist?(@config['yaml']) begin @config.deep_merge!(loader.load_file(@config['yaml'])) - rescue => e + rescue StandardError => e error! "yaml error #{e.message}" end elsif File.exist?(DEFAULT_CONFIG_FILENAME) begin @config.deep_merge!(loader.load_file(DEFAULT_CONFIG_FILENAME)) - rescue => e + rescue StandardError => e error! "yaml error #{e.message}" end end @config['builder'] = @target