public
Description: CMS plugin for ruby on rails. Really easy to set up and use.
Homepage: http://www.pullmonkey.com/projects/simple_cms
Clone URL: git://github.com/pullmonkey/simple_cms.git
simple_cms / tasks / simple_cms_tasks.rake
100644 48 lines (41 sloc) 2.177 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# desc "Explaining what the task does"
namespace :simple_cms do
  
  PLUGIN_ROOT = File.dirname(__FILE__) + '/../'
 
  desc 'Installs required javascript and css files to the public/javascripts and public/stylesheets directories'
  task :install do
    FileList[PLUGIN_ROOT + '/assets/javascripts/*.js'].each do |f|
      puts "ADDING /public/javascripts/" + File.basename(f)
      FileUtils.cp f, RAILS_ROOT + '/public/javascripts'
    end
    FileList[PLUGIN_ROOT + '/assets/stylesheets/*.css'].each do |f|
      puts "ADDING /public/stylesheets/" + File.basename(f)
      FileUtils.cp f, RAILS_ROOT + '/public/stylesheets'
    end
    
    puts "COPYING tiny_mce:"
    FileUtils.cp_r Dir[PLUGIN_ROOT + '/assets/javascripts/tiny_mce'], RAILS_ROOT + '/public/javascripts'
  end
  
  desc 'Uninstalls all javascript and css files that were created by the simple_cms:install'
  task :uninstall do
    puts "REMOVING /assets/javascripts/tiny_mce:"
    FileUtils.rm_rf RAILS_ROOT + '/public/javascripts/tiny_mce'
 
    FileList[PLUGIN_ROOT + '/assets/javascripts/*.js'].each do |file|
      puts "REMOVING /public/javascripts/" + File.basename(file)
      FileUtils.rm RAILS_ROOT + '/public/javascripts/' + File.basename(file)
    end
    FileList[PLUGIN_ROOT + '/assets/stylesheets/*.css'].each do |file|
      puts "REMOVING /public/stylesheets/" + File.basename(file)
      FileUtils.rm RAILS_ROOT + '/public/stylesheets/' + File.basename(file)
    end
  end
 
  desc 'Installs simple_cms dependencies(attachment_fu, responds_to_parent, acts_as_versioned, and coderay)'
  task :install_dependencies do
    puts "Installing plugin attachment_fu..."
    puts `ruby script/plugin install http://svn.pullmonkey.com/plugins/trunk/attachment_fu/`
    puts "Installing plugin responds_to_parent..."
    puts `ruby script/plugin install http://svn.pullmonkey.com/plugins/trunk/responds_to_parent/`
    puts "Installing plugin acts_as_versioned..."
    puts `ruby script/plugin install http://svn.pullmonkey.com/plugins/trunk/acts_as_versioned_2.1.1/`
    puts "Installing plugin coderay..."
    puts `ruby script/plugin install http://svn.pullmonkey.com/plugins/trunk/coderay/`
  end
end