Skip to content

Commit 23869f5

Browse files
committed
style: prefer __dir__ to __FILE__
See rails/rails@40bdbce1
1 parent 17f18a5 commit 23869f5

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/generators/tailwindcss/controller/controller_generator.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module Tailwindcss
44
module Generators
55
class ControllerGenerator < Erb::Generators::ControllerGenerator
6-
source_root File.expand_path("../templates", __FILE__)
6+
source_root File.expand_path("templates", __dir__)
77
end
88
end
99
end

lib/generators/tailwindcss/mailer/mailer_generator.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module Tailwindcss
44
module Generators
55
class MailerGenerator < Erb::Generators::MailerGenerator
6-
source_root File.expand_path("../templates", __FILE__)
6+
source_root File.expand_path("templates", __dir__)
77
end
88
end
99
end

lib/generators/tailwindcss/scaffold/scaffold_generator.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module Generators
66
class ScaffoldGenerator < Erb::Generators::ScaffoldGenerator
77
include Rails::Generators::ResourceHelpers
88

9-
source_root File.expand_path("../templates", __FILE__)
9+
source_root File.expand_path("templates", __dir__)
1010

1111
argument :attributes, type: :array, default: [], banner: "field:type field:type"
1212

0 commit comments

Comments
 (0)