Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/copycopter_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,7 @@ def self.configure(apply = true)

if defined? Rails
require 'copycopter_client/rails'
elsif defined?(Padrino) && defined?(Rake)
load 'tasks/copycopter_client_tasks.rake'
end

6 changes: 3 additions & 3 deletions lib/tasks/copycopter_client_tasks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ namespace :copycopter do
puts "Successfully marked all blurbs as published."
end

desc "Export Copycopter blurbs to yaml."
desc "Export Copycopter blurbs to yaml. Optionally set CC_EXPORT_PATH to the output path"
task :export => :environment do
CopycopterClient.cache.sync

if yml = CopycopterClient.export
PATH = "config/locales/copycopter.yml"
File.new("#{Rails.root}/#{PATH}", 'w').write(yml)
PATH = ENV['CC_EXPORT_PATH'] ? ENV['CC_EXPORT_PATH'] : "config/locales/copycopter.yml"
File.new("#{Bundler.root}/#{PATH}", 'w').write(yml)
puts "Successfully exported blurbs to #{PATH}."
else
puts "No blurbs have been cached."
Expand Down