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
20 changes: 20 additions & 0 deletions lib/copycopter_client/tasks.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace :copycopter do
desc "Notify Copycopter of a new deploy."
task :deploy => :environment do
CopycopterClient.deploy
puts "Successfully marked all blurbs as published."
end

desc "Export Copycopter blurbs to yaml."
task :export => :environment do
CopycopterClient.cache.sync

if yml = CopycopterClient.export
PATH = "config/locales/copycopter.yml"
File.new("#{Rails.root}/#{PATH}", 'w').write(yml)
puts "Successfully exported blurbs to #{PATH}."
else
puts "No blurbs have been cached."
end
end
end
21 changes: 1 addition & 20 deletions lib/tasks/copycopter_client_tasks.rake
Original file line number Diff line number Diff line change
@@ -1,20 +1 @@
namespace :copycopter do
desc "Notify Copycopter of a new deploy."
task :deploy => :environment do
CopycopterClient.deploy
puts "Successfully marked all blurbs as published."
end

desc "Export Copycopter blurbs to yaml."
task :export => :environment do
CopycopterClient.cache.sync

if yml = CopycopterClient.export
PATH = "config/locales/copycopter.yml"
File.new("#{Rails.root}/#{PATH}", 'w').write(yml)
puts "Successfully exported blurbs to #{PATH}."
else
puts "No blurbs have been cached."
end
end
end
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'copycopter_client', 'tasks'))