Sha256: 1841e59d08117e45f610364ee97a724df991e18525e1bad99d264e2959011f0c

Contents?: true

Size: 1.3 KB

Versions: 21

Compression:

Stored size: 1.3 KB

Contents

namespace :copy_tuner do
  desc "Notify CopyTuner of a new deploy."
  task :deploy => :environment do
    CopyTunerClient.deploy
    puts "Successfully marked all blurbs as published."
  end

  desc "Export CopyTuner blurbs to yaml."
  task :export, %i[path] => :environment do |_, args|
    args.with_defaults(path: "config/locales/copy_tuner.yml")
    CopyTunerClient.cache.sync

    if yml = CopyTunerClient.export
      File.new("#{Rails.root}/#{args[:path]}", 'w').write(yml)
      puts "Successfully exported blurbs to #{args[:path]}."
    else
      raise "No blurbs have been cached."
    end
  end

  desc "Detect invalid keys."
  task :detect_conflict_keys => :environment do
    conflict_keys = CopyTunerClient::DottedHash.conflict_keys(CopyTunerClient.cache.blurbs)

    if conflict_keys.empty?
      puts 'All success'
    else
      puts conflict_keys.sort.join("\n")
      exit 1
    end
  end

  desc "Detect html incompatible keys."
  task :detect_html_incompatible_keys => :environment do
    require 'copy_tuner_client/i18n_compat'
    html_incompatible_blurbs = CopyTunerClient::I18nCompat.select_html_incompatible_blurbs(CopyTunerClient.cache.blurbs)

    if html_incompatible_blurbs.empty?
      puts 'All success'
    else
      puts html_incompatible_blurbs.keys.sort.join("\n")
      exit 1
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
copy_tuner_client-0.19.0 lib/tasks/copy_tuner_client_tasks.rake
copy_tuner_client-0.18.0 lib/tasks/copy_tuner_client_tasks.rake
copy_tuner_client-0.17.1 lib/tasks/copy_tuner_client_tasks.rake
copy_tuner_client-0.16.3 lib/tasks/copy_tuner_client_tasks.rake
copy_tuner_client-0.16.2 lib/tasks/copy_tuner_client_tasks.rake
copy_tuner_client-0.16.1 lib/tasks/copy_tuner_client_tasks.rake
copy_tuner_client-0.16.0 lib/tasks/copy_tuner_client_tasks.rake
copy_tuner_client-0.15.1 lib/tasks/copy_tuner_client_tasks.rake
copy_tuner_client-0.15.0 lib/tasks/copy_tuner_client_tasks.rake
copy_tuner_client-0.14.2 lib/tasks/copy_tuner_client_tasks.rake
copy_tuner_client-0.14.1 lib/tasks/copy_tuner_client_tasks.rake
copy_tuner_client-0.14.0 lib/tasks/copy_tuner_client_tasks.rake
copy_tuner_client-0.13.6 lib/tasks/copy_tuner_client_tasks.rake
copy_tuner_client-0.13.5 lib/tasks/copy_tuner_client_tasks.rake
copy_tuner_client-0.13.3 lib/tasks/copy_tuner_client_tasks.rake
copy_tuner_client-0.13.2 lib/tasks/copy_tuner_client_tasks.rake
copy_tuner_client-0.13.1 lib/tasks/copy_tuner_client_tasks.rake
copy_tuner_client-0.13.0 lib/tasks/copy_tuner_client_tasks.rake
copy_tuner_client-0.12.0 lib/tasks/copy_tuner_client_tasks.rake
copy_tuner_client-0.11.0 lib/tasks/copy_tuner_client_tasks.rake