module Bitcat

Constants

MAJOR
MINOR
PATCH
VERSION

Public Class Methods

banner() click to toggle source
main() click to toggle source
# File lib/bitcat.rb, line 28
def self.main
  p banner
  ##  p root   #=> e.g. "C:/Sites/openblockchains/bitcat"

  database = './kitties.db'

  unless File.exist?( database )
    puts "*** error - no SQLite database found - expected >#{database}<"
    puts
    puts "  note: for how to setup a database,"
    puts "        see <https://github.com/openblockchains/copycats#database-setup>"
    puts
    exit 1
  end


  ## connect to local kitties.db database
  connect( adapter:  'sqlite3',
           database:  database )

  ## print some (record) stats
  puts "kitties: #{Copycats::Model::Kitty.count}"
  puts "genes:   #{Copycats::Model::Gene.count}"
  puts "traits:  #{Copycats::Model::Trait.count}"

  run!
end
root() click to toggle source
# File lib/bitcat/version.rb, line 19
def self.root
  "#{File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )}"
end
run!() click to toggle source

convenience method

# File lib/bitcat.rb, line 20
def self.run!
  app    = App
  port   = 4567
  Rack::Handler::WEBrick.run( app, Port:port ) do |server|
    ## todo: add traps here - why, why not??
  end
end
version() click to toggle source
# File lib/bitcat/version.rb, line 11
def self.version
  VERSION
end