diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index d8b4bb3..6c592a7 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2016-11-14 18:28:34 +0300 using RuboCop version 0.45.0. +# on 2017-05-25 14:46:57 +0300 using RuboCop version 0.49.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new diff --git a/Changelog.md b/Changelog.md index 49e55f9..450144c 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,9 @@ # Change log -# 1.0.0 +## master (unrelased) +* Fix RuboCop 0.49 warnings (minor speedup by `Performance/Caller` cop) + +## 1.0.0 * Shorter call `OnlyofficeLoggerHelper.log` instead of longer variant `OnlyofficeLoggerHelper::log.print_to_log` ## 0.0.1 diff --git a/lib/onlyoffice_logger_helper/logger_helper.rb b/lib/onlyoffice_logger_helper/logger_helper.rb index 669edd8..b450c1c 100644 --- a/lib/onlyoffice_logger_helper/logger_helper.rb +++ b/lib/onlyoffice_logger_helper/logger_helper.rb @@ -1,7 +1,7 @@ # Module for output stuff in console module OnlyofficeLoggerHelper def self.log(entry, color_code = nil) - caller_name = caller[0].to_s[/\w+.rb/].chomp('.rb') + caller_name = caller(1..1).first.to_s[/\w+.rb/].chomp('.rb') time_stamp = Time.now.strftime('%T/%d.%m.%y') message = "#{time_stamp} [#{caller_name}] #{entry}" color_code ? puts(colorize(message, color_code)) : puts(message) diff --git a/onlyoffice_logger_helper.gemspec b/onlyoffice_logger_helper.gemspec index a177557..50763c7 100644 --- a/onlyoffice_logger_helper.gemspec +++ b/onlyoffice_logger_helper.gemspec @@ -1,4 +1,3 @@ -# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'onlyoffice_logger_helper/version' @@ -7,7 +6,7 @@ Gem::Specification.new do |spec| spec.name = 'onlyoffice_logger_helper' spec.version = OnlyofficeLoggerHelper::VERSION spec.authors = ['ONLYOFFICE', 'Pavel Lobashov', 'Roman Zagudaev'] - spec.email = %w(shockwavenn@gmail.com rzagudaev@gmail.com) + spec.email = %w[shockwavenn@gmail.com rzagudaev@gmail.com] spec.summary = 'Simple logging gem for ONLYOFFICE projects' spec.description = 'Simple logging gem for ONLYOFFICE projects. Used in QA'