diff options
author | bogdanvlviv <bogdanvlviv@gmail.com> | 2017-05-15 14:17:28 +0000 |
---|---|---|
committer | bogdanvlviv <bogdanvlviv@gmail.com> | 2017-05-23 00:53:51 +0300 |
commit | 40bdbce191ad90dfea43dad51fac5c4726b89392 (patch) | |
tree | a6c6d8369874775cdc6cf1d4b90684490c0198bc /actionview/Rakefile | |
parent | d414881a342d849d65810a037c0b1baff8538e41 (diff) | |
download | rails-40bdbce191ad90dfea43dad51fac5c4726b89392.tar.gz rails-40bdbce191ad90dfea43dad51fac5c4726b89392.tar.bz2 rails-40bdbce191ad90dfea43dad51fac5c4726b89392.zip |
Define path with __dir__
".. with __dir__ we can restore order in the Universe." - by @fxn
Related to 5b8738c2df003a96f0e490c43559747618d10f5f
Diffstat (limited to 'actionview/Rakefile')
-rw-r--r-- | actionview/Rakefile | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/actionview/Rakefile b/actionview/Rakefile index 4f22ef84c8..0fc38e8db4 100644 --- a/actionview/Rakefile +++ b/actionview/Rakefile @@ -2,8 +2,6 @@ require "rake/testtask" require "fileutils" require "open3" -dir = File.dirname(__FILE__) - desc "Default Task" task default: :test @@ -95,7 +93,7 @@ namespace :assets do desc "Verify compiled Action View assets" task :verify do file = "lib/assets/compiled/rails-ujs.js" - pathname = Pathname.new("#{dir}/#{file}") + pathname = Pathname.new("#{__dir__}/#{file}") print "[verify] #{file} exists " if pathname.exist? @@ -113,11 +111,11 @@ namespace :assets do fail end - print "[verify] #{dir} can be required as a module " + print "[verify] #{__dir__} can be required as a module " js = <<-JS window = { Event: class {} } class Element {} - require('#{dir}') + require('#{__dir__}') JS _, stderr, status = Open3.capture3("node", "--print", js) if status.success? @@ -130,7 +128,7 @@ namespace :assets do end task :lines do - load File.expand_path("..", File.dirname(__FILE__)) + "/tools/line_statistics" + load File.join(File.expand_path("..", __dir__), "/tools/line_statistics") files = FileList["lib/**/*.rb"] CodeTools::LineStatistics.new(files).print_loc end |