test fix
This commit is contained in:
parent
38f9601a2b
commit
2bd6a5de31
|
@ -14,8 +14,7 @@ end
|
||||||
#Add patchfile to Admin area
|
#Add patchfile to Admin area
|
||||||
@patchfile_li = File.read(app_path+"/patchfile_li.txt")
|
@patchfile_li = File.read(app_path+"/patchfile_li.txt")
|
||||||
@patchfile_li_choices = File.read(app_path+"/patchfile_li_choices.txt")
|
@patchfile_li_choices = File.read(app_path+"/patchfile_li_choices.txt")
|
||||||
Dir.chdir(ENV['PWD']+'/app/views/shared') do
|
@file_text = File.read(ENV['PWD']+'/app/views/shared/_side_bar.html.erb")
|
||||||
@file_text = File.read("_side_bar.html.erb")
|
|
||||||
if !@file_text.include?('<div class="patchfile sub-nav-block icons-megaphone">')
|
if !@file_text.include?('<div class="patchfile sub-nav-block icons-megaphone">')
|
||||||
@indert_index = @file_text.index('</nav>')
|
@indert_index = @file_text.index('</nav>')
|
||||||
@file_text.insert(@indert_index , @patchfile_li_choices)
|
@file_text.insert(@indert_index , @patchfile_li_choices)
|
||||||
|
@ -24,11 +23,10 @@ Dir.chdir(ENV['PWD']+'/app/views/shared') do
|
||||||
@indert_index = @file_text.index('<li title="<%= t(\'site_info\') %>">')
|
@indert_index = @file_text.index('<li title="<%= t(\'site_info\') %>">')
|
||||||
@file_text.insert(@indert_index , @patchfile_li)
|
@file_text.insert(@indert_index , @patchfile_li)
|
||||||
end
|
end
|
||||||
f = File.open('_side_bar.html.erb','w')
|
f = File.open(ENV['PWD']+'/app/views/shared/_side_bar.html.erb','w')
|
||||||
f.write(@file_text)
|
f.write(@file_text)
|
||||||
f.close
|
f.close
|
||||||
puts "finish change patchfile in #{ENV['PWD']}/app/views/shared"
|
puts "finish change patchfile in #{ENV['PWD']}/app/views/shared"
|
||||||
end
|
|
||||||
# Describe your gem and declare its dependencies:
|
# Describe your gem and declare its dependencies:
|
||||||
Gem::Specification.new do |s|
|
Gem::Specification.new do |s|
|
||||||
s.name = "patchfile"
|
s.name = "patchfile"
|
||||||
|
|
Loading…
Reference in New Issue