Sha256: 7a947c7aa5d1f18af5f211175a4837c5503f4aca8a30604674aa0b93d5f87d59

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

namespace :radiant do
  namespace :extensions do
    namespace :<%= file_name %> do

      desc "Runs the migration of the <%= localization_name %> language pack"
      task :migrate => :environment do
        require 'trusty_cms/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 <%= localization_name %> language pack 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, :verbose => false
          cp file, Rails.root + path, :verbose => false
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
trusty-cms-1.0.1 lib/generators/language_extension/templates/tasks.rake