Fix deprecated for ruby 2.7.
This commit is contained in:
parent
c1c1489570
commit
abdaf6085c
|
@ -6,6 +6,20 @@ require 'json'
|
||||||
bundle_update_flag = ARGV[0]=='update' || ARGV[0]=='install'
|
bundle_update_flag = ARGV[0]=='update' || ARGV[0]=='install'
|
||||||
if bundle_update_flag
|
if bundle_update_flag
|
||||||
env_pwd = ENV['PWD']
|
env_pwd = ENV['PWD']
|
||||||
|
begin
|
||||||
|
require ::File.expand_path('app/helpers/bundler_helper.rb', env_pwd)
|
||||||
|
extend BundlerHelper
|
||||||
|
rescue LoadError
|
||||||
|
def bundler_with_clean_env
|
||||||
|
if block_given?
|
||||||
|
if Bundler.respond_to?(:with_unbundled_env)
|
||||||
|
Bundler.with_unbundled_env(&Proc.new)
|
||||||
|
else
|
||||||
|
Bundler.with_clean_env(&Proc.new)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
app_path = File.expand_path(__dir__)
|
app_path = File.expand_path(__dir__)
|
||||||
template_path = env_pwd + '/app/templates'
|
template_path = env_pwd + '/app/templates'
|
||||||
all_template = Dir.glob(template_path+'/*/')
|
all_template = Dir.glob(template_path+'/*/')
|
||||||
|
@ -40,9 +54,9 @@ if bundle_update_flag
|
||||||
copy_h["name"][locale] = copy_h["name"][locale].sub(/\d+/){|ff| last_index.to_s}
|
copy_h["name"][locale] = copy_h["name"][locale].sub(/\d+/){|ff| last_index.to_s}
|
||||||
end
|
end
|
||||||
widget_info << copy_h
|
widget_info << copy_h
|
||||||
Bundler.with_clean_env{%x[cp -f #{app_path}/modules/gallery/_#{h["filename"]}.html.erb #{folder}modules/gallery/_#{copy_h["filename"]}.html.erb]}
|
bundler_with_clean_env{%x[cp -f #{app_path}/modules/gallery/_#{h["filename"]}.html.erb #{folder}modules/gallery/_#{copy_h["filename"]}.html.erb]}
|
||||||
elsif h["force_cover"] == "true"
|
elsif h["force_cover"] == "true"
|
||||||
Bundler.with_clean_env{%x[cp -f #{app_path}/modules/gallery/_#{h["filename"]}.html.erb #{folder}modules/gallery/_#{widget_info[widget_info_index]["filename"]}.html.erb]}
|
bundler_with_clean_env{%x[cp -f #{app_path}/modules/gallery/_#{h["filename"]}.html.erb #{folder}modules/gallery/_#{widget_info[widget_info_index]["filename"]}.html.erb]}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if update_flag
|
if update_flag
|
||||||
|
|
Loading…
Reference in New Issue