lib/j1/commands/patch.rb in j1-template-2022.0.16 vs lib/j1/commands/patch.rb in j1-template-2022.0.17
- old
+ new
@@ -17,31 +17,26 @@
end
end
end
def process(args, options = {})
- patch_install(options)
@args = args
+ patch_install(options)
end
private
- def is_windows?
- #noinspection RubyResolve
- RbConfig::CONFIG["host_os"] =~ %r!mswin|mingw|cygwin!i
- end
-
def patch_install(options)
- if is_windows?
+ if J1::Utils::is_windows?
major, minor = RUBY_VERSION.split('.')
lib_version = major + '.' + minor
curr_path = File.expand_path(File.dirname(File.dirname(__FILE__)))
patch_gem_eventmachine = 'eventmachine-1.2.7-x64-mingw32'
patch_gem_execjs = 'execjs-2.7.0'
patch_eventmachine_source_path = curr_path + '/patches/rubygems' + '/' + patch_gem_eventmachine + '/lib/' + lib_version
patch_execjs_source_path = curr_path + '/patches/rubygems' + '/' + patch_gem_execjs + '/lib/execjs/external_runtime.rb'
- process, output = J1::Utils::Exec.run('gem', 'env', 'gempath')
+ process, output = J1::Utils::Exec1.run('gem', 'env', 'gempath')
raise SystemExit unless process.success?
result = output.split(';')
user_path = result[0]
system_path = result[1]