Class: Shepherd::Setup
- Inherits:
-
Object
- Object
- Shepherd::Setup
- Defined in:
- lib/shepherd/setup.rb
Instance Method Summary collapse
-
#initialize ⇒ Setup
constructor
A new instance of Setup.
Constructor Details
#initialize ⇒ Setup
Returns a new instance of Setup.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/shepherd/setup.rb', line 5 def initialize puts "[shep] performing a setup:\n\n" @schema = <<-EOS create table if not exists sheeps ( id integer primary key autoincrement, name varchar(128) not null, path varchar(256) not null, files integer(6) not null, lines integer(7) not null, chars integer(10) not null, bytes integer(10) not null, inited_at datetime not null, updated_at datetime not null ); EOS crdir "#{Dir.home}/.shepherd" crfile "#{Dir.home}/.shepherd/herd.db" puts "[shep] setup: making a real database: #{Dir.home}/.shepherd/herd.db" Db.new.execute "#{@schema}" exit 0 end |