Sha256: afec75b2f1e9e34f904b81ea96138dd5b64d8da4d5752ef04db34fec630cdd8e

Contents?: true

Size: 1.03 KB

Versions: 12

Compression:

Stored size: 1.03 KB

Contents

namespace :imagine_cms do
  
  namespace :cache do
    
    desc "Clear CMS cache (generated .html files)"
    task :clear => :environment do
      include ActionDispatch::Routing::UrlFor
      include Rails.application.routes.url_helpers
      
      # expire home page
      ActionController::Base.expire_page url_for(:controller => 'cms/content', :action => 'show', :content_path => nil, :only_path => true)
      
      # expire all other pages
      CmsPage.select([ :id, :path ]).find_each do |page|
        ActionController::Base.expire_page url_for(:controller => 'cms/content', :action => 'show', :content_path => page.path.split('/'), :only_path => true)
      end
      
      puts "Cache cleared."
    end
    
  end
  
  desc "Copy dojo editor files to public"
  task :install_dojo => :environment do
    sourcedir = File.expand_path('../../../app/assets/javascripts/dojo', __FILE__)
    targetdir = File.expand_path(File.join(Rails.root, 'public', 'assets'))
    FileUtils.mkdir_p targetdir
    FileUtils.cp_r sourcedir, targetdir
  end
  
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
imagine_cms-5.2.6 lib/tasks/imagine_cms_tasks.rake
imagine_cms-5.2.5 lib/tasks/imagine_cms_tasks.rake
imagine_cms-5.2.4 lib/tasks/imagine_cms_tasks.rake
imagine_cms-5.2.3 lib/tasks/imagine_cms_tasks.rake
imagine_cms-5.2.2 lib/tasks/imagine_cms_tasks.rake
imagine_cms-5.2.1 lib/tasks/imagine_cms_tasks.rake
imagine_cms-5.2.0 lib/tasks/imagine_cms_tasks.rake
imagine_cms-4.2.4 lib/tasks/imagine_cms_tasks.rake
imagine_cms-4.2.3 lib/tasks/imagine_cms_tasks.rake
imagine_cms-4.2.2 lib/tasks/imagine_cms_tasks.rake
imagine_cms-4.2.1 lib/tasks/imagine_cms_tasks.rake
imagine_cms-4.2.0 lib/tasks/imagine_cms_tasks.rake