From 0155a73f25c6ad024de34f65922553087ffd7836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Thu, 4 Aug 2022 17:02:03 +0800 Subject: [PATCH] update old --- temp_file/config/application.rb | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/temp_file/config/application.rb b/temp_file/config/application.rb index 01c2a06..0a9a878 100644 --- a/temp_file/config/application.rb +++ b/temp_file/config/application.rb @@ -20,12 +20,52 @@ if Rails.version.to_i>4 end end end + if RUBY_VERSION.to_f > 2.1 + if RUBY_VERSION.to_f>2.4 + module Psych + def self.load(yaml, permitted_classes: [Symbol], permitted_symbols: [], aliases: false, filename: nil, fallback: nil, symbolize_names: false, freeze: false, strict_integer: false) + return self.unsafe_load(yaml, filename: filename, fallback: fallback, symbolize_names: symbolize_names, freeze: freeze, strict_integer: strict_integer) + end + end + end class Time def new_offset(offset) DateTime.new(self.to_i).new_offset(offset) end end + class ActionController::Parameters + def any?(&block) + self.permit!.to_h.any?(&block) + end + end + module URI + def self.escape(uri) + self::DEFAULT_PARSER.escape(uri) + end + def self.unescape(uri) + self::DEFAULT_PARSER.unescape(uri) + end + def self.parse(uri) + uri = uri.strip + scheme, userinfo, host, port, + registry, path, opaque, query, fragment = self.split(uri) + + if scheme && self.scheme_list.include?(scheme.upcase) + self.scheme_list[scheme.upcase].new(scheme, userinfo, host, port, + registry, path, opaque, query, + fragment, self) + else + Generic.new(scheme, userinfo, host, port, + registry, path, opaque, query, + fragment, self) + end + end + class <