diff options
author | Sutou Kouhei <kou@clear-code.com> | 2022-01-04 06:17:45 +0900 |
---|---|---|
committer | Sutou Kouhei <kou@clear-code.com> | 2022-01-04 06:17:45 +0900 |
commit | ea3eb7c0f9b8610c05cbf40e5eda333e41020bfe (patch) | |
tree | 87e738993e4b00767a5b5662342bf721292f049d | |
parent | 7ccc152b66926a4754659da9bda08a9fddb82dde (diff) | |
download | rake-compiler-ea3eb7c0f9b8610c05cbf40e5eda333e41020bfe.tar.gz |
Reduce duplicated File.basename(binary_path)
-rw-r--r-- | lib/rake/extensiontask.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/rake/extensiontask.rb b/lib/rake/extensiontask.rb index 7e06ee9..5395b3d 100644 --- a/lib/rake/extensiontask.rb +++ b/lib/rake/extensiontask.rb @@ -108,12 +108,13 @@ module Rake platf = for_platform || platform binary_path = binary(platf) + binary_base_name = File.basename(binary_path) # lib_path lib_path = lib_dir # lib_binary_path - lib_binary_path = "#{lib_path}/#{File.basename(binary_path)}" + lib_binary_path = "#{lib_path}/#{binary_base_name}" # tmp_path tmp_path = "#{@tmp_dir}/#{platf}/#{@name}/#{ruby_ver}" @@ -178,8 +179,8 @@ Java extension should be preferred. chdir tmp_path do sh make - if binary_path != File.basename(binary_path) - cp File.basename(binary_path), binary_path + if binary_path != binary_base_name + cp binary_base_name, binary_path end end end |