add some rescue
This commit is contained in:
parent
c47f65def8
commit
c3e52b08df
|
@ -127,8 +127,9 @@ class Admin::PatchfilesController < OrbitAdminController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
def getfont
|
def getfont
|
||||||
|
@font_array = []
|
||||||
@ckeditor_path = ENV['PWD'] + '/app/assets/javascripts/ckeditor'
|
@ckeditor_path = ENV['PWD'] + '/app/assets/javascripts/ckeditor'
|
||||||
@filedata = File.read(@ckeditor_path+"/config.js.erb")
|
@filedata = File.read(@ckeditor_path+"/config.js.erb") rescue return
|
||||||
@name_to_search ="config.font_names"
|
@name_to_search ="config.font_names"
|
||||||
@index_of_font = @filedata.index(@name_to_search)
|
@index_of_font = @filedata.index(@name_to_search)
|
||||||
@font_str = ""
|
@font_str = ""
|
||||||
|
|
|
@ -32,7 +32,7 @@ class Patchfilefield
|
||||||
end
|
end
|
||||||
def get_font_to_store
|
def get_font_to_store
|
||||||
@ckeditor_path = ENV['PWD'] + '/app/assets/javascripts/ckeditor'
|
@ckeditor_path = ENV['PWD'] + '/app/assets/javascripts/ckeditor'
|
||||||
@filedata = File.read(@ckeditor_path+"/config.js.erb")
|
@filedata = File.read(@ckeditor_path+"/config.js.erb") rescue return
|
||||||
@name_to_search ="config.font_names"
|
@name_to_search ="config.font_names"
|
||||||
@index_of_font = @filedata.index(@name_to_search)
|
@index_of_font = @filedata.index(@name_to_search)
|
||||||
@font_str = ""
|
@font_str = ""
|
||||||
|
@ -119,7 +119,7 @@ class Patchfilefield
|
||||||
end
|
end
|
||||||
def check_font_state
|
def check_font_state
|
||||||
@ckeditor_path = ENV['PWD'] + '/app/assets/javascripts/ckeditor'
|
@ckeditor_path = ENV['PWD'] + '/app/assets/javascripts/ckeditor'
|
||||||
@filedata = File.read(@ckeditor_path+"/config.js.erb")
|
@filedata = File.read(@ckeditor_path+"/config.js.erb") rescue return
|
||||||
@name_to_search ="config.font_names"
|
@name_to_search ="config.font_names"
|
||||||
@index_of_font = @filedata.index(@name_to_search)
|
@index_of_font = @filedata.index(@name_to_search)
|
||||||
@font_str = ""
|
@font_str = ""
|
||||||
|
@ -221,7 +221,7 @@ class Patchfilefield
|
||||||
puts @filedata
|
puts @filedata
|
||||||
@filetowrite.write(@filedata)
|
@filetowrite.write(@filedata)
|
||||||
@filetowrite.close
|
@filetowrite.close
|
||||||
@filetocover = File.open("config.js.erb","w")
|
@filetocover = File.open("config.js.erb","w") rescue return
|
||||||
@filetocover.write(@filedata)
|
@filetocover.write(@filedata)
|
||||||
@filetocover.close
|
@filetocover.close
|
||||||
File.delete("config_back.js.erb")
|
File.delete("config_back.js.erb")
|
||||||
|
|
Loading…
Reference in New Issue