Skip to content

Instantly share code, notes, and snippets.

@taylor-smith
Last active August 29, 2015 14:01
Show Gist options
  • Save taylor-smith/8d42dbbbfd33dc898fff to your computer and use it in GitHub Desktop.
Save taylor-smith/8d42dbbbfd33dc898fff to your computer and use it in GitHub Desktop.
require 'sqlite3'
namespace :type_of_task do
task :name_of_task => [:task_dependency] do
puts "I Work!"
end
end
namespace :db do
task :load do
db = SQLite3::Database.new("test.db")
puts 'I work!'
end
task :create => [:load] do
db ||= SQLite3::Database.new "test db"
db
puts "I Work"
end
task :drop => [:load] do
File.delete("test.db")
puts "I work"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment