Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (18 sloc) 411 Bytes
task :app do
require 'rack'
Rack::Builder.parse_file('config.ru')
include Timeless::Models
end
namespace :change do
desc 'Create a change for an entry'
task :post, [:entry] => :app do |n, args|
require 'yaml'
n = Change.last.id + 1
File.open("changes/#{n}.yaml", "w") do |f|
f << {
"created_at" => Time.now,
"entry" => args[:entry]
}.to_yaml
end
end
end
Something went wrong with that request. Please try again.