Skip to content

Commit

Permalink
Merge pull request #566 from koic/use_require_relative
Browse files Browse the repository at this point in the history
Use `require_relative` in the Rake codebase
  • Loading branch information
hsbt authored May 10, 2024
2 parents 68b0d71 + 61bb453 commit 1ad1a11
Show file tree
Hide file tree
Showing 17 changed files with 54 additions and 54 deletions.
54 changes: 27 additions & 27 deletions lib/rake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,42 +23,42 @@

module Rake; end

require "rake/version"
require_relative "rake/version"

require "rbconfig"
require "fileutils"
require "singleton"
require "monitor"
require "optparse"

require "rake/ext/string"
require_relative "rake/ext/string"

require "rake/win32"
require_relative "rake/win32"

require "rake/linked_list"
require "rake/cpu_counter"
require "rake/scope"
require "rake/task_argument_error"
require "rake/rule_recursion_overflow_error"
require "rake/rake_module"
require "rake/trace_output"
require "rake/pseudo_status"
require "rake/task_arguments"
require "rake/invocation_chain"
require "rake/task"
require "rake/file_task"
require "rake/file_creation_task"
require "rake/multi_task"
require "rake/dsl_definition"
require "rake/file_utils_ext"
require "rake/file_list"
require "rake/default_loader"
require "rake/early_time"
require "rake/late_time"
require "rake/name_space"
require "rake/task_manager"
require "rake/application"
require "rake/backtrace"
require_relative "rake/linked_list"
require_relative "rake/cpu_counter"
require_relative "rake/scope"
require_relative "rake/task_argument_error"
require_relative "rake/rule_recursion_overflow_error"
require_relative "rake/rake_module"
require_relative "rake/trace_output"
require_relative "rake/pseudo_status"
require_relative "rake/task_arguments"
require_relative "rake/invocation_chain"
require_relative "rake/task"
require_relative "rake/file_task"
require_relative "rake/file_creation_task"
require_relative "rake/multi_task"
require_relative "rake/dsl_definition"
require_relative "rake/file_utils_ext"
require_relative "rake/file_list"
require_relative "rake/default_loader"
require_relative "rake/early_time"
require_relative "rake/late_time"
require_relative "rake/name_space"
require_relative "rake/task_manager"
require_relative "rake/application"
require_relative "rake/backtrace"

$trace = false

Expand Down
12 changes: 6 additions & 6 deletions lib/rake/application.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# frozen_string_literal: true
require "optparse"

require "rake/task_manager"
require "rake/file_list"
require "rake/thread_pool"
require "rake/thread_history_display"
require "rake/trace_output"
require "rake/win32"
require_relative "task_manager"
require_relative "file_list"
require_relative "thread_pool"
require_relative "thread_history_display"
require_relative "trace_output"
require_relative "win32"

module Rake

Expand Down
2 changes: 1 addition & 1 deletion lib/rake/clean.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# The intent of this task is to return a project to its
# pristine, just unpacked state.

require "rake"
require_relative "../rake"

# :stopdoc:

Expand Down
2 changes: 1 addition & 1 deletion lib/rake/dsl_definition.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true
# Rake DSL functions.
require "rake/file_utils_ext"
require_relative "file_utils_ext"

module Rake

Expand Down
2 changes: 1 addition & 1 deletion lib/rake/ext/string.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true
require "rake/ext/core"
require_relative "core"

class String

Expand Down
4 changes: 2 additions & 2 deletions lib/rake/file_creation_task.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true
require "rake/file_task"
require "rake/early_time"
require_relative "file_task"
require_relative "early_time"

module Rake

Expand Down
6 changes: 3 additions & 3 deletions lib/rake/file_list.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true
require "rake/cloneable"
require "rake/file_utils_ext"
require "rake/ext/string"
require_relative "cloneable"
require_relative "file_utils_ext"
require_relative "ext/string"

module Rake

Expand Down
4 changes: 2 additions & 2 deletions lib/rake/file_task.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true
require "rake/task"
require "rake/early_time"
require_relative "task"
require_relative "early_time"

module Rake

Expand Down
2 changes: 1 addition & 1 deletion lib/rake/file_utils_ext.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true
require "rake/file_utils"
require_relative "file_utils"

module Rake
#
Expand Down
4 changes: 2 additions & 2 deletions lib/rake/packagetask.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Define a package task library to aid in the definition of
# redistributable package files.

require "rake"
require "rake/tasklib"
require_relative "../rake"
require_relative "tasklib"

module Rake

Expand Down
2 changes: 1 addition & 1 deletion lib/rake/phony.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# See FileTask#out_of_date? and Task#timestamp for more info.

require "rake"
require_relative "../rake"

task :phony

Expand Down
2 changes: 1 addition & 1 deletion lib/rake/rake_test_loader.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require "rake/file_list"
require_relative "file_list"

# Load the test files from the command line.
argv = ARGV.select do |argument|
Expand Down
2 changes: 1 addition & 1 deletion lib/rake/task.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true
require "rake/invocation_exception_mixin"
require_relative "invocation_exception_mixin"

module Rake

Expand Down
2 changes: 1 addition & 1 deletion lib/rake/tasklib.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true
require "rake"
require_relative "../rake"

module Rake

Expand Down
4 changes: 2 additions & 2 deletions lib/rake/testtask.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true
require "rake"
require "rake/tasklib"
require_relative "../rake"
require_relative "tasklib"

module Rake

Expand Down
2 changes: 1 addition & 1 deletion lib/rake/thread_history_display.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true
require "rake/private_reader"
require_relative "private_reader"

module Rake

Expand Down
2 changes: 1 addition & 1 deletion lib/rake/thread_pool.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require "rake/promise"
require_relative "promise"
require "set"

module Rake
Expand Down

0 comments on commit 1ad1a11

Please sign in to comment.