lib/rails-editor.rb in RailsEditor-0.0.28 vs lib/rails-editor.rb in RailsEditor-0.0.29
- old
+ new
@@ -1,8 +1,9 @@
EDITOR_LIB_HOME = File.expand_path(File.dirname(__FILE__) + "/../")
require "rubygems"
require "rake/gempackagetask"
+require "fileutils"
class RailsEditor
attr_accessor :rails_root
def initialize(args = {:rails_root => ENV['PWD']})
@rails_root = args[:rails_root]
end
@@ -23,11 +24,11 @@
end
if not File.exists?(save_dir) or not FileTest.directory?(save_dir)
puts "Dir.mkdir(" + save_dir + ") "
Dir.mkdir(save_dir)
end
- puts "File.cp(" + editor_file + "," + save_dir + "/" + File.basename(editor_file) + ") "
- File.cp(editor_file,save_dir + "/" + File.basename(editor_file))
+ puts "FileUtils.cp(" + editor_file + "," + save_dir + "/" + File.basename(editor_file) + ") "
+ FileUtils.cp(editor_file,save_dir + "/" + File.basename(editor_file))
end
if File.exists? editor_script = @rails_root + "/script/editor"
File.chmod(0755,editor_script)
end
puts "******************************************************"