Sha256: 97ccb1f99b0e66250abff75f54c3d2a7fd9d231d268d40220986bc67a88a1406

Contents?: true

Size: 1.05 KB

Versions: 11

Compression:

Stored size: 1.05 KB

Contents

namespace :camaleon_cms do
  desc 'Generate thumbnails for uploaded files'
  task generate_thumbnails: :environment do
    include CamaleonCms::CamaleonHelper
    include CamaleonCms::HooksHelper
    include CamaleonCms::SiteHelper
    include CamaleonCms::PluginsHelper
    include CamaleonCms::ThemeHelper
    include CamaleonCms::UploaderHelper
    include Rails.application.routes.url_helpers
    $current_site = CamaleonCms::Site.find(ENV['site_id'].to_i)
    cama_uploader_init_connection
    @fog_connection_bucket_dir.files.all.each do |file|
      puts file.inspect
      cama_uploader_generate_thumbnail(file.key, file.key, '')
    end
  end

  desc 'Copy Camaleon CMS and all plugins migrations to migration folder'
  task generate_migrations: :environment do
    PluginRoutes.all_plugins.each do |plugin|
      ENV['FROM'] = plugin['KEY']
      if Rake::Task.task_defined?('railties:install:migrations')
        Rake::Task['railties:install:migrations'].invoke
      else
        Rake::Task['app:railties:install:migrations'].invoke
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
camaleon_cms-2.9.0 lib/tasks/camaleon_cms/camaleon_tasks.rake
camaleon_cms-2.8.3 lib/tasks/camaleon_cms/camaleon_tasks.rake
camaleon_cms-2.8.2 lib/tasks/camaleon_cms/camaleon_tasks.rake
camaleon_cms-2.8.1 lib/tasks/camaleon_cms/camaleon_tasks.rake
camaleon_cms-2.8.0 lib/tasks/camaleon_cms/camaleon_tasks.rake
camaleon_cms-2.7.5 lib/tasks/camaleon_cms/camaleon_tasks.rake
camaleon_cms-2.7.4 lib/tasks/camaleon_cms/camaleon_tasks.rake
camaleon_cms-2.7.3 lib/tasks/camaleon_cms/camaleon_tasks.rake
camaleon_cms-2.7.2 lib/tasks/camaleon_cms/camaleon_tasks.rake
camaleon_cms-2.7.1 lib/tasks/camaleon_cms/camaleon_tasks.rake
camaleon_cms-2.7.0 lib/tasks/camaleon_cms/camaleon_tasks.rake