From 145203b76bf85c1d71455b4a872f2c167bcdc9e1 Mon Sep 17 00:00:00 2001 From: Jose Luis Duran Date: Mon, 14 May 2018 14:19:43 -0300 Subject: [PATCH] Remove RuboCop To-do --- .rubocop.yml | 2 -- .rubocop_todo.yml | 17 ----------------- .../strategies/figures_converter/options.rb | 12 +++++++++++- 3 files changed, 11 insertions(+), 20 deletions(-) delete mode 100644 .rubocop_todo.yml diff --git a/.rubocop.yml b/.rubocop.yml index f9b5df8f..94401715 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,3 @@ -inherit_from: .rubocop_todo.yml - AllCops: TargetRubyVersion: 2.3 Exclude: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml deleted file mode 100644 index dabaf21f..00000000 --- a/.rubocop_todo.yml +++ /dev/null @@ -1,17 +0,0 @@ -# This configuration was generated by -# `rubocop --auto-gen-config` -# on 2018-05-14 00:00:00 -0000 using RuboCop version 0.56.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 -# versions of RuboCop, may require this file to be generated again. - -# Offense count: 1 -Style/MethodMissingSuper: - Exclude: - - 'lib/numbers_and_words/strategies/figures_converter/options.rb' - -# Offense count: 1 -Style/MissingRespondToMissing: - Exclude: - - 'lib/numbers_and_words/strategies/figures_converter/options.rb' diff --git a/lib/numbers_and_words/strategies/figures_converter/options.rb b/lib/numbers_and_words/strategies/figures_converter/options.rb index 9cab9332..7355558d 100644 --- a/lib/numbers_and_words/strategies/figures_converter/options.rb +++ b/lib/numbers_and_words/strategies/figures_converter/options.rb @@ -22,11 +22,21 @@ def initialize(strategy, options) end def method_missing(method_name, *args, &block) - Object.const_get(proxy_class_name(method_name)).new self, args, block + method = Object.const_get(proxy_class_name(method_name)) + + if method + method.new(self, args, block) + else + super + end rescue NameError nil end + def respond_to_missing?(method_name, include_private = false) + Object.const_get(proxy_class_name(method_name)) || super + end + private def proxy_class_name(method_name)