Sha256: 805e8d19bde9927b9be11cfdeafb889992ad9e78ac596b300d62264429535b38

Contents?: true

Size: 1000 Bytes

Versions: 3

Compression:

Stored size: 1000 Bytes

Contents

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
radiant-0.7.2 lib/generators/extension/templates/tasks.rake
radiant-0.7.0 lib/generators/extension/templates/tasks.rake
radiant-0.7.1 lib/generators/extension/templates/tasks.rake