]> source.dussan.org Git - redmine.git/commitdiff
Use `require_relative` instead of `File.dirname(__FILE__) + ...` (#38093).
authorGo MAEDA <maeda@farend.jp>
Mon, 16 Jan 2023 21:55:30 +0000 (21:55 +0000)
committerGo MAEDA <maeda@farend.jp>
Mon, 16 Jan 2023 21:55:30 +0000 (21:55 +0000)
Patch by Go MAEDA.

git-svn-id: https://svn.redmine.org/redmine/trunk@22052 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/plugins/acts_as_activity_provider/init.rb
lib/plugins/acts_as_attachable/init.rb
lib/plugins/acts_as_customizable/init.rb
lib/plugins/acts_as_event/init.rb
lib/plugins/acts_as_searchable/init.rb
lib/plugins/acts_as_tree/init.rb
lib/plugins/acts_as_watchable/init.rb
lib/plugins/gravatar/init.rb
lib/redmine/core_ext/string.rb
lib/redmine/utils.rb

index 465ab3b9b912e33590625a9da4860783d52742f2..cfd1a51419b73a2545ea66e0bf54fab6a927a138 100644 (file)
@@ -1,4 +1,4 @@
 # frozen_string_literal: true
 
-require File.dirname(__FILE__) + '/lib/acts_as_activity_provider'
+require_relative 'lib/acts_as_activity_provider'
 ActiveRecord::Base.send(:include, Redmine::Acts::ActivityProvider)
index fad72214c07e3b5c497bdcdfdb1d6af935d47776..16ca1a207340b4b60c98cf73053146cf8a52b751 100644 (file)
@@ -1,4 +1,4 @@
 # frozen_string_literal: true
 
-require File.dirname(__FILE__) + '/lib/acts_as_attachable'
+require_relative 'lib/acts_as_attachable'
 ActiveRecord::Base.send(:include, Redmine::Acts::Attachable)
index c44db3df0c490ae676a264ba81d6bb50986fb669..8b04bf4ca470eac41e46ac957b97f9bcecf22278 100644 (file)
@@ -1,4 +1,4 @@
 # frozen_string_literal: true
 
-require File.dirname(__FILE__) + '/lib/acts_as_customizable'
+require_relative 'lib/acts_as_customizable'
 ActiveRecord::Base.send(:include, Redmine::Acts::Customizable)
index 2c025f2c01312cf92fb528977ae1756ff5d40f6d..2ac430796f47a965de36fa5cca88b54b9d58dd77 100644 (file)
@@ -1,4 +1,4 @@
 # frozen_string_literal: true
 
-require File.dirname(__FILE__) + '/lib/acts_as_event'
+require_relative 'lib/acts_as_event'
 ActiveRecord::Base.send(:include, Redmine::Acts::Event)
index 661b0203da24160289c88d26c70772e4bbbf93ea..54f8616a53ebd49fadb0f6bedfaf0b03de45f845 100644 (file)
@@ -1,4 +1,4 @@
 # frozen_string_literal: true
 
-require File.dirname(__FILE__) + '/lib/acts_as_searchable'
+require_relative 'lib/acts_as_searchable'
 ActiveRecord::Base.send(:include, Redmine::Acts::Searchable)
index cb8394e97278229fadd9e72aa477d9d6147aa558..36d1193d0b255d846d3043f685ae0b9c151d4461 100644 (file)
@@ -1,4 +1,4 @@
 # frozen_string_literal: true
 
-require File.dirname(__FILE__) + '/lib/active_record/acts/tree'
+require_relative 'lib/active_record/acts/tree'
 ActiveRecord::Base.send :include, ActiveRecord::Acts::Tree
index d91feec418e0768f4ad11ad74bea170f97761f7a..49f50a0222bec2a2e25442e430af850cf8307066 100644 (file)
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 # Include hook code here
-require File.dirname(__FILE__) + '/lib/acts_as_watchable'
+require_relative 'lib/acts_as_watchable'
 ActiveRecord::Base.send(:include, Redmine::Acts::Watchable)
index aafad761343967cb23ec221783b7d792cb549719..a312000f5cb75c22e6a223328ad53bf6cd9337ad 100644 (file)
@@ -1,4 +1,4 @@
 # frozen_string_literal: true
 
-require File.dirname(__FILE__) + '/lib/gravatar'
+require_relative 'lib/gravatar'
 ActionView::Base.send :include, GravatarHelper::PublicMethods
index 443b8fc3969d0fd2531528e08eec659e0521c789..61a1b702d9e6477f7b5cc07d8acf6178aa950fc7 100644 (file)
@@ -1,7 +1,7 @@
 # frozen_string_literal: true
 
-require File.dirname(__FILE__) + '/string/conversions'
-require File.dirname(__FILE__) + '/string/inflections'
+require_relative 'string/conversions'
+require_relative 'string/inflections'
 
 # @private
 class String
index 976a96937549ea1e47bbed8d042a51f92c5d001d..a42cee94deacc1abecbe5638fe814018ea0f4b9d 100644 (file)
@@ -17,8 +17,8 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
-require File.dirname(__FILE__) + '/utils/date_calculation'
-require File.dirname(__FILE__) + '/utils/shell'
+require_relative 'utils/date_calculation'
+require_relative 'utils/shell'
 require 'fileutils'
 
 module Redmine