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 = "create table if not exists sheeps (\n id integer primary key autoincrement,\n name varchar(128) not null,\n path varchar(256) not null,\n files integer(6) not null,\n lines integer(7) not null,\n chars integer(10) not null,\n bytes integer(10) not null,\n inited_at datetime not null,\n updated_at datetime not null\n);\n" 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 |