Sha256: 7a2a5c83de1b078ed0dc014d8ca7052210c1726936ed79b939c50730ef04d6d4

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 KB

Contents

namespace :radiant do
  namespace :extensions do
    namespace :page_group_permissions do
      
      desc "Runs the migration of the Page Group Permissions extension"
      task :migrate => :environment do
        require 'radiant/extension_migrator'
        if ENV["VERSION"]
          PageGroupPermissionsExtension.migrator.migrate(ENV["VERSION"].to_i)
        else
          PageGroupPermissionsExtension.migrator.migrate
        end
      end
      
      desc "Copies public assets of the Page Group Permissions to the instance public/ directory."
      task :update => :environment do
        is_svn_or_dir = proc {|path| path =~ /\.svn/ || File.directory?(path) }
        Dir[PageGroupPermissionsExtension.root + "/public/**/*"].reject(&is_svn_or_dir).each do |file|
          path = file.sub(PageGroupPermissionsExtension.root, '')
          directory = File.dirname(path)
          puts "Copying #{path}..."
          mkdir_p RAILS_ROOT + directory
          cp file, RAILS_ROOT + path
        end
      end  
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
radiant-page_group_permissions-extension-1.0.1 lib/tasks/page_group_permissions_extension_tasks.rake
radiant-page_group_permissions-extension-1.0.0 lib/tasks/page_group_permissions_extension_tasks.rake