Module: WorldDb
- Defined in:
- lib/worlddb.rb,
lib/worlddb/stats.rb,
lib/worlddb/reader.rb,
lib/worlddb/schema.rb,
lib/worlddb/deleter.rb,
lib/worlddb/version.rb,
lib/worlddb/cli/opts.rb
Defined Under Namespace
Modules: Models
Classes: CreateDb, Deleter, Opts, Reader, Stats
Constant Summary
collapse
- VERSION =
sync version w/ sport.db - why? why not?
'1.6.0'
Class Method Summary
collapse
Class Method Details
.banner ⇒ Object
49
50
51
|
# File 'lib/worlddb.rb', line 49
def self.banner
"worlddb #{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
end
|
.delete! ⇒ Object
delete ALL records (use with care!)
87
88
89
90
|
# File 'lib/worlddb.rb', line 87
def self.delete!
puts '*** deleting world table records/data...'
Deleter.new.run
end
|
.main ⇒ Object
57
58
59
60
|
# File 'lib/worlddb.rb', line 57
def self.main
require 'worlddb/cli/main'
end
|
.props ⇒ Object
103
104
105
|
# File 'lib/worlddb.rb', line 103
def self.props
Stats.new.props
end
|
.read(ary, include_path) ⇒ Object
68
69
70
71
72
73
|
# File 'lib/worlddb.rb', line 68
def self.read( ary, include_path )
reader = Reader.new( include_path )
ary.each do |name|
reader.load( name )
end
end
|
.read_all(include_path, opts = {}) ⇒ Object
load all builtins (using plain text reader); helper for convenience
81
82
83
|
# File 'lib/worlddb.rb', line 81
def self.read_all( include_path, opts={} ) read_setup( 'setups/all', include_path, opts )
end
|
.read_setup(setup, include_path, opts = {}) ⇒ Object
76
77
78
79
|
# File 'lib/worlddb.rb', line 76
def self.read_setup( setup, include_path, opts={} )
reader = Reader.new( include_path, opts )
reader.load_setup( setup )
end
|
.root ⇒ Object
53
54
55
|
# File 'lib/worlddb.rb', line 53
def self.root
"#{File.expand_path( File.dirname(File.dirname(__FILE__)) )}"
end
|
.stats ⇒ Object
93
94
95
96
97
|
# File 'lib/worlddb.rb', line 93
def self.stats
stats = Stats.new
stats.tables
end
|
.tables ⇒ Object
99
100
101
|
# File 'lib/worlddb.rb', line 99
def self.tables
Stats.new.tables
end
|