Skip to content

Commit

Permalink
Prefer require_relative
Browse files Browse the repository at this point in the history
  • Loading branch information
marcandre committed Sep 14, 2020
1 parent 7c0f81d commit bfafa52
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion lib/rdoc/generator/darkfish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require 'erb'
require 'fileutils'
require 'pathname'
require 'rdoc/generator/markup'
require_relative 'markup'

##
# Darkfish RDoc HTML Generator
Expand Down
6 changes: 3 additions & 3 deletions lib/rdoc/generator/pot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ def extract_messages
extractor.extract
end

require 'rdoc/generator/pot/message_extractor'
require 'rdoc/generator/pot/po'
require 'rdoc/generator/pot/po_entry'
require_relative 'pot/message_extractor'
require_relative 'pot/po'
require_relative 'pot/po_entry'

end
2 changes: 1 addition & 1 deletion lib/rdoc/i18n.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
module RDoc::I18n

autoload :Locale, 'rdoc/i18n/locale'
require 'rdoc/i18n/text'
require_relative 'i18n/text'

end
12 changes: 6 additions & 6 deletions lib/rdoc/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ def initialize top_level, file_name, content, options, stats
end

# simple must come first in order to show up last in the parsers list
require 'rdoc/parser/simple'
require 'rdoc/parser/c'
require 'rdoc/parser/changelog'
require 'rdoc/parser/markdown'
require 'rdoc/parser/rd'
require 'rdoc/parser/ruby'
require_relative 'parser/simple'
require_relative 'parser/c'
require_relative 'parser/changelog'
require_relative 'parser/markdown'
require_relative 'parser/rd'
require_relative 'parser/ruby'
6 changes: 3 additions & 3 deletions lib/rdoc/rdoc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,6 @@ def remove_siginfo_handler
end

# require built-in generators after discovery in case they've been replaced
require 'rdoc/generator/darkfish'
require 'rdoc/generator/ri'
require 'rdoc/generator/pot'
require_relative 'generator/darkfish'
require_relative 'generator/ri'
require_relative 'generator/pot'
2 changes: 1 addition & 1 deletion lib/rdoc/ri/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
##
# For RubyGems backwards compatibility

require 'rdoc/ri/formatter'
require_relative 'formatter'

##
# The RI driver implements the command-line ri tool.
Expand Down
2 changes: 1 addition & 1 deletion lib/rdoc/ri/paths.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true
require 'rdoc/rdoc'
require_relative '../rdoc'

##
# The directories where ri data lives. Paths can be enumerated via ::each, or
Expand Down
2 changes: 1 addition & 1 deletion lib/rdoc/ri/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
rescue Gem::LoadError
end unless defined?(RDoc)

require 'rdoc/task'
require_relative '../task'

##
# RDoc::RI::Task creates ri data in <code>./.rdoc</code> for your project.
Expand Down
2 changes: 1 addition & 1 deletion lib/rdoc/rubygems_hook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def self.generation_hook installer, specs
def self.load_rdoc
return if @rdoc_version

require 'rdoc/rdoc'
require_relative 'rdoc'

@rdoc_version = Gem::Version.new ::RDoc::VERSION
end
Expand Down

0 comments on commit bfafa52

Please sign in to comment.