tiny_mce.rake

来自「用ruby on rails写的一个博客程序,还不错..ruby on rail」· RAKE 代码 · 共 40 行

RAKE
40
字号
VERSION = '2.0.6.1'namespace :tiny_mce do  namespace :scripts do    desc 'Install the TinyMCE scripts into the public/javascripts directory of this application'    task :install do      require 'fileutils'      dest = RAILS_ROOT + '/public/javascripts/tiny_mce'      if File.exists?(dest)        puts "Error : destination directory #{dest} already exists, perhaps you need to update instead?"        exit 1      else        puts "Creating directory #{dest}..."        FileUtils.mkdir dest        puts "** Installing TinyMCE version #{VERSION} to #{dest}..."        recursively_copy File.expand_path(File.dirname(__FILE__) + '/../public/javascripts/tiny_mce'), dest        puts "** Successfully installed TinyMCE version #{VERSION}"      end    end        task :update do      puts "Not yet implemented."    end  endenddef recursively_copy(source, dest)  Dir.chdir(source)  Dir.foreach(source) do |entry|    next if entry =~ /^\./    if File.directory?(File.join(source, entry))      puts "Creating directory #{entry}..."      FileUtils.mkdir File.join(dest, entry)#, :noop => true#, :verbose => true      recursively_copy File.join(source, entry), File.join(dest, entry)    else      puts "  Installing file #{entry}..."      FileUtils.cp File.join(source, entry), File.join(dest, entry)#, :noop => true#, :verbose => true    end  endend

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?