class I18nJSON::CLI::ExportCommand
Private Instance Methods
error_description(error)
click to toggle source
# File lib/i18n-json/cli/export_command.rb, line 91 def error_description(error) [ error.class.name, error.message ].reject(&:empty?).join(" => ") end
load_require_file!(require_file)
click to toggle source
# File lib/i18n-json/cli/export_command.rb, line 81 def load_require_file!(require_file) require_without_warnings(require_file) rescue Exception => error # rubocop:disable Lint/RescueException ui.stderr_print("=> ERROR: couldn't load", options[:require_file].inspect) ui.fail_with( "\n#{error_description(error)}\n#{error.backtrace.join("\n")}" ) end
require_without_warnings(path)
click to toggle source
# File lib/i18n-json/cli/export_command.rb, line 98 def require_without_warnings(path) old_verbose = $VERBOSE $VERBOSE = nil require path ensure $VERBOSE = old_verbose end
set_defaults!()
click to toggle source
# File lib/i18n-json/cli/export_command.rb, line 73 def set_defaults! config_file = "./config/i18n.yml" require_file = "./config/environment.rb" options[:config_file] ||= config_file if File.file?(config_file) options[:require_file] ||= require_file if File.file?(require_file) end