@@ -27,8 +27,6 @@ class << self
2727 # programs.
2828 # @param files [Array[String]] nil An Array specifying the file names to
2929 # compile w.r.t the source_dir directory.
30- # @param invoker [Symbol] nil Determines whether the invoker is a command line
31- # program or a rake task. Affect build directory for rake task.
3230 #
3331 # TODO: The path can be relative to the source_dir if source_dir is specified.
3432 def compile path ,
@@ -39,8 +37,7 @@ def compile path,
3937 make : false ,
4038 debug : false ,
4139 source_dir : nil ,
42- files : nil ,
43- invoker : nil
40+ files : nil
4441 CONFIG . flush
4542 CONFIG . debug = debug
4643 CONFIG . add_link "m" # link cmath libraries
@@ -57,9 +54,8 @@ def compile path,
5754 elsif test && multi_file
5855 return [ tree , supervisor , ext ]
5956 end
60- write_files target_name , supervisor , ext , target_dir : target_dir , force : force ,
61- invoker : invoker
62- full_path = build_path ( target_dir , target_name , invoker : invoker )
57+ write_files target_name , supervisor , ext , target_dir : target_dir , force : force
58+ full_path = build_path ( target_dir , target_name )
6359 load_extconf full_path
6460 run_make full_path if make
6561 end
@@ -124,12 +120,10 @@ def extract_target_name path
124120 # @param directory [String] nil Target directory in which files are to be placed.
125121 # @param force [Boolean] false Recreate the target directory and rewrite the
126122 # files whether they are already present or not.
127- # @param invoker [Symbol|NilClass] nil Determines the build directory based on whether
128- # it being invoked by a rake task or cmd.
129- def write_files target_name , supervisor , ext , target_dir : nil , force : false , invoker : nil
130- path = build_path ( target_dir , target_name , invoker : invoker )
123+ def write_files target_name , supervisor , ext , target_dir : nil , force : false
124+ path = build_path ( target_dir , target_name )
131125 FileUtils . rm_rf ( path ) if force && Dir . exist? ( path )
132- FileUtils . mkdir_p ( path ) unless Dir . exist? ( path )
126+ Dir . mkdir ( path ) unless Dir . exist? ( path )
133127
134128 write_to_file "#{ path } /#{ Rubex ::COMMON_UTILS_FILE } .h" ,
135129 supervisor . header ( Rubex ::COMMON_UTILS_FILE ) . to_s
@@ -158,14 +152,10 @@ def run_make path
158152 #
159153 # @param directory [String] The directory inside which this build path will exist.
160154 # @param target_name [String] Name of the folder inside the directory.
161- # @param invoker [Symbol|NilClass] nil The calling program. Can be :rake or :cmd.
162- def build_path directory , target_name , invoker : nil
155+ def build_path directory , target_name
163156 directory = ( directory ? directory . to_s : Dir . pwd )
164157 unless directory . end_with? ( target_name )
165158 directory += "/#{ target_name } "
166- if invoker == :rake
167- directory += "/build"
168- end
169159 end
170160 directory
171161 end
0 commit comments