зеркало из https://github.com/github/ruby.git
[ruby/psych] Prefer `require_relative` for internal requires
https://github.com/ruby/psych/commit/a0f55ee85a
This commit is contained in:
Родитель
48cd633094
Коммит
d04d6bbc6c
|
@ -1,8 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
require 'psych/versions'
|
||||
require_relative 'psych/versions'
|
||||
case RUBY_ENGINE
|
||||
when 'jruby'
|
||||
require 'psych_jars'
|
||||
require_relative 'psych_jars'
|
||||
if JRuby::Util.respond_to?(:load_ext)
|
||||
JRuby::Util.load_ext('org.jruby.ext.psych.PsychLibrary')
|
||||
else
|
||||
|
@ -12,21 +12,21 @@ when 'jruby'
|
|||
else
|
||||
require 'psych.so'
|
||||
end
|
||||
require 'psych/nodes'
|
||||
require 'psych/streaming'
|
||||
require 'psych/visitors'
|
||||
require 'psych/handler'
|
||||
require 'psych/tree_builder'
|
||||
require 'psych/parser'
|
||||
require 'psych/omap'
|
||||
require 'psych/set'
|
||||
require 'psych/coder'
|
||||
require 'psych/core_ext'
|
||||
require 'psych/stream'
|
||||
require 'psych/json/tree_builder'
|
||||
require 'psych/json/stream'
|
||||
require 'psych/handlers/document_stream'
|
||||
require 'psych/class_loader'
|
||||
require_relative 'psych/nodes'
|
||||
require_relative 'psych/streaming'
|
||||
require_relative 'psych/visitors'
|
||||
require_relative 'psych/handler'
|
||||
require_relative 'psych/tree_builder'
|
||||
require_relative 'psych/parser'
|
||||
require_relative 'psych/omap'
|
||||
require_relative 'psych/set'
|
||||
require_relative 'psych/coder'
|
||||
require_relative 'psych/core_ext'
|
||||
require_relative 'psych/stream'
|
||||
require_relative 'psych/json/tree_builder'
|
||||
require_relative 'psych/json/stream'
|
||||
require_relative 'psych/handlers/document_stream'
|
||||
require_relative 'psych/class_loader'
|
||||
|
||||
###
|
||||
# = Overview
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
require 'psych/omap'
|
||||
require 'psych/set'
|
||||
require_relative 'omap'
|
||||
require_relative 'set'
|
||||
|
||||
module Psych
|
||||
class ClassLoader # :nodoc:
|
||||
|
|
|
@ -15,5 +15,5 @@ class Object
|
|||
end
|
||||
|
||||
if defined?(::IRB)
|
||||
require 'psych/y'
|
||||
require_relative 'y'
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
require 'psych/tree_builder'
|
||||
require_relative '../tree_builder'
|
||||
|
||||
module Psych
|
||||
module Handlers
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
require 'psych/handler'
|
||||
require_relative '../handler'
|
||||
|
||||
module Psych
|
||||
module Handlers
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
require 'psych/json/ruby_events'
|
||||
require 'psych/json/yaml_events'
|
||||
require_relative 'ruby_events'
|
||||
require_relative 'yaml_events'
|
||||
|
||||
module Psych
|
||||
module JSON
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
require 'psych/json/yaml_events'
|
||||
require_relative 'yaml_events'
|
||||
|
||||
module Psych
|
||||
module JSON
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# frozen_string_literal: true
|
||||
require 'psych/nodes/node'
|
||||
require 'psych/nodes/stream'
|
||||
require 'psych/nodes/document'
|
||||
require 'psych/nodes/sequence'
|
||||
require 'psych/nodes/scalar'
|
||||
require 'psych/nodes/mapping'
|
||||
require 'psych/nodes/alias'
|
||||
require_relative 'nodes/node'
|
||||
require_relative 'nodes/stream'
|
||||
require_relative 'nodes/document'
|
||||
require_relative 'nodes/sequence'
|
||||
require_relative 'nodes/scalar'
|
||||
require_relative 'nodes/mapping'
|
||||
require_relative 'nodes/alias'
|
||||
|
||||
module Psych
|
||||
###
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
require 'stringio'
|
||||
require 'psych/class_loader'
|
||||
require 'psych/scalar_scanner'
|
||||
require_relative '../class_loader'
|
||||
require_relative '../scalar_scanner'
|
||||
|
||||
module Psych
|
||||
module Nodes
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
require 'psych/exception'
|
||||
require_relative 'exception'
|
||||
|
||||
module Psych
|
||||
class SyntaxError < Psych::Exception
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
require 'psych/handler'
|
||||
require_relative 'handler'
|
||||
|
||||
module Psych
|
||||
###
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
require 'psych/visitors/visitor'
|
||||
require 'psych/visitors/to_ruby'
|
||||
require 'psych/visitors/emitter'
|
||||
require 'psych/visitors/yaml_tree'
|
||||
require 'psych/visitors/json_tree'
|
||||
require 'psych/visitors/depth_first'
|
||||
require_relative 'visitors/visitor'
|
||||
require_relative 'visitors/to_ruby'
|
||||
require_relative 'visitors/emitter'
|
||||
require_relative 'visitors/yaml_tree'
|
||||
require_relative 'visitors/json_tree'
|
||||
require_relative 'visitors/depth_first'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
require 'psych/json/ruby_events'
|
||||
require_relative '../json/ruby_events'
|
||||
|
||||
module Psych
|
||||
module Visitors
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
require 'psych/scalar_scanner'
|
||||
require 'psych/class_loader'
|
||||
require 'psych/exception'
|
||||
require_relative '../scalar_scanner'
|
||||
require_relative '../class_loader'
|
||||
require_relative '../exception'
|
||||
|
||||
unless defined?(Regexp::NOENCODING)
|
||||
Regexp::NOENCODING = 32
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
require 'psych/tree_builder'
|
||||
require 'psych/scalar_scanner'
|
||||
require 'psych/class_loader'
|
||||
require_relative '../tree_builder'
|
||||
require_relative '../scalar_scanner'
|
||||
require_relative '../class_loader'
|
||||
|
||||
module Psych
|
||||
module Visitors
|
||||
|
|
Загрузка…
Ссылка в новой задаче