Sha256: a917b492cc787689544cbbcca314c6aceb3be2fe5e43dafaacdaae88be84f237
Contents?: true
Size: 1.76 KB
Versions: 2
Compression:
Stored size: 1.76 KB
Contents
module Ajax module Helpers module TaskHelper INSTALL_FILES = %w[ app/views/layouts/ajax/application.html.erb app/controllers/ajax_controller.rb app/views/ajax/framework.html.erb config/initializers/ajax.rb public/images/ajax-loading.gif public/javascripts/ajax.js public/javascripts/jquery.address-1.3.js public/javascripts/jquery.address-1.3.min.js public/javascripts/jquery.json-2.2.min.js ] UPDATE_JAVASCRIPT_FILES = %w[ public/javascripts/ajax.js] def copy_unless_exists(file, from_dir=nil, to_dir=nil) to_dir ||= Rails.root.to_s from_dir ||= Ajax.root.to_s from_file, to_file = File.join(from_dir, file), File.join(to_dir, file) if File.exist?(to_file) return false else FileUtils.mkdir_p(File.dirname(to_file)) unless File.directory?(File.dirname(to_file)) FileUtils.cp(from_file, to_file) return true end rescue Exception => e e end def copy_and_overwrite(file, from_dir=nil, to_dir=nil) to_dir ||= Rails.root.to_s from_dir ||= Ajax.root.to_s from_file, to_file = File.join(from_dir, file), File.join(to_dir, file) FileUtils.mkdir_p(File.dirname(to_file)) unless File.directory?(File.dirname(to_file)) FileUtils.cp(from_file, to_file) return true rescue Exception => e e end def show_result(file) result = yield file return unless verbose case result when Exception puts "skipped: #{file} #{result.message}" when true puts "created: #{file}" else puts "skipped: #{file}" end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ajax-1.1.7 | lib/ajax/helpers/task_helper.rb |
ajax-1.1.6 | lib/ajax/helpers/task_helper.rb |