sportdb-setup 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +3 -0
- data/Manifest.txt +6 -0
- data/README.md +25 -0
- data/Rakefile +28 -0
- data/lib/sportdb/setup.rb +131 -0
- data/lib/sportdb/setup/version.rb +25 -0
- metadata +90 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5fd18718bc91a5ab84711e2713cf913e78faecaf
|
4
|
+
data.tar.gz: ac4d72ef21e27350e735934e48020438d4e11012
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: '0857e16179f3f9033cd609598c8f0bf8f21b281797c0b7c2c6ede83d6090649a3e6f5e84e2dd70dd9996019c29084d52800ce6cef036cd801316e142e63cb25e'
|
7
|
+
data.tar.gz: 0e17c3a8b5a3136f77c5b4962ce25d826d9474c47a102b18196c934059fded091abbba6a633cd42a93658a88b25147123ea1480df3ccf2c0fdae213eb2e876bd
|
data/CHANGELOG.md
ADDED
data/Manifest.txt
ADDED
data/README.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# sportdb-setup - sport.db dev (source) mode boot scripts for setting up load path and more
|
2
|
+
|
3
|
+
* home :: [github.com/sportdb/sport.db](https://github.com/sportdb/sport.db)
|
4
|
+
* bugs :: [github.com/sportdb/sport.db/issues](https://github.com/sportdb/sport.db/issues)
|
5
|
+
* gem :: [rubygems.org/gems/sportdb-setup](https://rubygems.org/gems/sportdb-setup)
|
6
|
+
* rdoc :: [rubydoc.info/gems/sportdb-setup](http://rubydoc.info/gems/sportdb-setup)
|
7
|
+
* forum :: [opensport](http://groups.google.com/group/opensport)
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
To be done
|
14
|
+
|
15
|
+
## License
|
16
|
+
|
17
|
+
The scripts are dedicated to the public domain.
|
18
|
+
Use it as you please with no restrictions whatsoever.
|
19
|
+
|
20
|
+
|
21
|
+
## Questions? Comments?
|
22
|
+
|
23
|
+
Send them along to the
|
24
|
+
[Open Sports & Friends Forum/Mailing List](http://groups.google.com/group/opensport).
|
25
|
+
Thanks!
|
data/Rakefile
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'hoe'
|
2
|
+
require './lib/sportdb/setup/version.rb'
|
3
|
+
|
4
|
+
Hoe.spec 'sportdb-setup' do
|
5
|
+
|
6
|
+
self.version = SportDb::Module::Boot::VERSION
|
7
|
+
|
8
|
+
self.summary = "sportdb-setup - sport.db dev (source) mode boot scripts for setting up load path and more"
|
9
|
+
self.description = summary
|
10
|
+
|
11
|
+
self.urls = { home: 'https://github.com/sportdb/sport.db' }
|
12
|
+
|
13
|
+
self.author = 'Gerald Bauer'
|
14
|
+
self.email = 'opensport@googlegroups.com'
|
15
|
+
|
16
|
+
# switch extension to .markdown for gihub formatting
|
17
|
+
self.readme_file = 'README.md'
|
18
|
+
self.history_file = 'CHANGELOG.md'
|
19
|
+
|
20
|
+
self.licenses = ['Public Domain']
|
21
|
+
|
22
|
+
self.extra_deps = []
|
23
|
+
|
24
|
+
self.spec_extras = {
|
25
|
+
required_ruby_version: '>= 2.2.2'
|
26
|
+
}
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,131 @@
|
|
1
|
+
##########
|
2
|
+
# setup load path
|
3
|
+
# lets you use environments
|
4
|
+
# e.g. dev/development or prod/production
|
5
|
+
|
6
|
+
require 'pp'
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
$RUBYLIBS_DEBUG = true
|
12
|
+
$RUBYCOCO_DEBUG = true ## always include (NOT just in sportdb?)
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
### todo/check - move true values and debug? "upstream" to monos - why? why not??
|
18
|
+
|
19
|
+
TRUE_VALUES = [
|
20
|
+
'true', 't',
|
21
|
+
'yes', 'y',
|
22
|
+
'on',
|
23
|
+
'1', # note: add 1 too
|
24
|
+
]
|
25
|
+
|
26
|
+
### include / check for ruby debug flag too - why? why not?
|
27
|
+
def debug? ## always include (NOT just insportdb?)
|
28
|
+
value = ENV['DEBUG']
|
29
|
+
if value && TRUE_VALUES.include?( value.downcase )
|
30
|
+
true
|
31
|
+
else
|
32
|
+
false
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
## convenience pre-configured/pre-built shortcut - lets you use
|
38
|
+
## require 'sportdb/setup'
|
39
|
+
## SportDb::Boot.setup
|
40
|
+
|
41
|
+
|
42
|
+
module SportDb
|
43
|
+
module Boot
|
44
|
+
def self.root
|
45
|
+
## note: uses a copy-n-paste version of Mono.root for now - why? why not?
|
46
|
+
@@root ||= begin
|
47
|
+
## todo/fix:
|
48
|
+
## check if windows - otherwise use /sites
|
49
|
+
## check if root directory exists?
|
50
|
+
if ENV['MOPATH']
|
51
|
+
## use expand path to make (assure) absolute path - why? why not?
|
52
|
+
File.expand_path( ENV['MOPATH'] )
|
53
|
+
elsif Dir.exist?( 'C:/Sites' )
|
54
|
+
'C:/Sites'
|
55
|
+
else
|
56
|
+
'/sites'
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.root=( path )
|
62
|
+
## use expand path to make (assure) absolute path - why? why not?
|
63
|
+
@@root = File.expand_path( path )
|
64
|
+
end
|
65
|
+
|
66
|
+
|
67
|
+
def self.setup ## setup load path
|
68
|
+
### note: for now always assume dev/development
|
69
|
+
### add ENV check later or pass in as args or such
|
70
|
+
|
71
|
+
puts "SportDb::Boot.root: >#{root}<"
|
72
|
+
|
73
|
+
## add football webget & sources too
|
74
|
+
$LOAD_PATH.unshift( "#{root}/yorobot/sport.db.more/football-sources/lib" )
|
75
|
+
$LOAD_PATH.unshift( "#{root}/yorobot/sport.db.more/webget-football/lib" )
|
76
|
+
|
77
|
+
|
78
|
+
### todo/fix: use an inline Gemfile and bundler's setup? why? why not?
|
79
|
+
$LOAD_PATH.unshift( "#{root}/yorobot/sport.db.more/sportdb-exporters/lib" )
|
80
|
+
$LOAD_PATH.unshift( "#{root}/yorobot/sport.db.more/sportdb-writers/lib" )
|
81
|
+
$LOAD_PATH.unshift( "#{root}/yorobot/sport.db.more/sportdb-linters/lib" )
|
82
|
+
|
83
|
+
$LOAD_PATH.unshift( "#{root}/sportdb/sport.db/sports/lib" )
|
84
|
+
|
85
|
+
$LOAD_PATH.unshift( "#{root}/sportdb/sport.db/sportdb-importers/lib" )
|
86
|
+
$LOAD_PATH.unshift( "#{root}/sportdb/sport.db/sportdb-readers/lib" )
|
87
|
+
$LOAD_PATH.unshift( "#{root}/sportdb/sport.db/sportdb-sync/lib" )
|
88
|
+
$LOAD_PATH.unshift( "#{root}/sportdb/sport.db/sportdb-models/lib" )
|
89
|
+
$LOAD_PATH.unshift( "#{root}/sportdb/sport.db/sportdb-catalogs/lib" )
|
90
|
+
|
91
|
+
## todo/check:
|
92
|
+
## add fifa, footballdb-leagues, footballdb-clubs too ???
|
93
|
+
$LOAD_PATH.unshift( "#{root}/sportdb/football.db/footballdb-clubs/lib" )
|
94
|
+
$LOAD_PATH.unshift( "#{root}/sportdb/football.db/footballdb-leagues/lib" )
|
95
|
+
$LOAD_PATH.unshift( "#{root}/sportdb/football.db/fifa/lib" )
|
96
|
+
|
97
|
+
$LOAD_PATH.unshift( "#{root}/sportdb/sport.db/sportdb-formats/lib" )
|
98
|
+
$LOAD_PATH.unshift( "#{root}/sportdb/sport.db/sportdb-structs/lib" )
|
99
|
+
$LOAD_PATH.unshift( "#{root}/sportdb/sport.db/sportdb-langs/lib" )
|
100
|
+
$LOAD_PATH.unshift( "#{root}/sportdb/sport.db/score-formats/lib" )
|
101
|
+
|
102
|
+
$LOAD_PATH.unshift( "#{root}/rubycoco/core/date-formats/lib" )
|
103
|
+
$LOAD_PATH.unshift( "#{root}/rubycoco/core/alphabets/lib" )
|
104
|
+
|
105
|
+
pp $: # print load path
|
106
|
+
end # method setup
|
107
|
+
end # module Boot
|
108
|
+
end # module Sportdb
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
##
|
113
|
+
## todo/fix: add path support (W/O using global constants) for:
|
114
|
+
## - SPORTDB_DIR e.g. "#{SportDb::Boot.root}/sportdb" -- path to libs
|
115
|
+
## - OPENFOOTBALL_DIR e.g. "#{SportDb::Boot.root}/openfootball" -- path to datasets
|
116
|
+
|
117
|
+
|
118
|
+
### use something like SportDb::Path[:sportdb]
|
119
|
+
## SportDb.path( :sportdb )
|
120
|
+
## SportDb::Boot.sportdb_path or sportdb_dir or such???
|
121
|
+
## SportDb::Env.path( 'sportdb' ) ???
|
122
|
+
## SportDb::Env::SPORTDB_DIR ???
|
123
|
+
## or such - why? why not?
|
124
|
+
##
|
125
|
+
## check rails path setup / style or others???
|
126
|
+
|
127
|
+
|
128
|
+
##################
|
129
|
+
### say hello - use version (meta/module) info
|
130
|
+
require 'sportdb/setup/version'
|
131
|
+
puts "#{SportDb::Module::Boot.banner} in (#{SportDb::Module::Boot.root})"
|
@@ -0,0 +1,25 @@
|
|
1
|
+
|
2
|
+
module SportDb
|
3
|
+
module Module
|
4
|
+
module Boot
|
5
|
+
|
6
|
+
MAJOR = 0 ## todo: namespace inside version or something - why? why not??
|
7
|
+
MINOR = 0
|
8
|
+
PATCH = 1
|
9
|
+
VERSION = [MAJOR,MINOR,PATCH].join('.')
|
10
|
+
|
11
|
+
def self.version
|
12
|
+
VERSION
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.banner
|
16
|
+
"sportdb-setup/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.root
|
20
|
+
File.expand_path( File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) )
|
21
|
+
end
|
22
|
+
|
23
|
+
end # module Boot
|
24
|
+
end # module Module
|
25
|
+
end # module SportDb
|
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sportdb-setup
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Gerald Bauer
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-11-16 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rdoc
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.0'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '7'
|
23
|
+
type: :development
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '4.0'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '7'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: hoe
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '3.22'
|
40
|
+
type: :development
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '3.22'
|
47
|
+
description: sportdb-setup - sport.db dev (source) mode boot scripts for setting up
|
48
|
+
load path and more
|
49
|
+
email: opensport@googlegroups.com
|
50
|
+
executables: []
|
51
|
+
extensions: []
|
52
|
+
extra_rdoc_files:
|
53
|
+
- CHANGELOG.md
|
54
|
+
- Manifest.txt
|
55
|
+
- README.md
|
56
|
+
files:
|
57
|
+
- CHANGELOG.md
|
58
|
+
- Manifest.txt
|
59
|
+
- README.md
|
60
|
+
- Rakefile
|
61
|
+
- lib/sportdb/setup.rb
|
62
|
+
- lib/sportdb/setup/version.rb
|
63
|
+
homepage: https://github.com/sportdb/sport.db
|
64
|
+
licenses:
|
65
|
+
- Public Domain
|
66
|
+
metadata: {}
|
67
|
+
post_install_message:
|
68
|
+
rdoc_options:
|
69
|
+
- "--main"
|
70
|
+
- README.md
|
71
|
+
require_paths:
|
72
|
+
- lib
|
73
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 2.2.2
|
78
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
requirements: []
|
84
|
+
rubyforge_project:
|
85
|
+
rubygems_version: 2.5.2
|
86
|
+
signing_key:
|
87
|
+
specification_version: 4
|
88
|
+
summary: sportdb-setup - sport.db dev (source) mode boot scripts for setting up load
|
89
|
+
path and more
|
90
|
+
test_files: []
|