sportweb 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +97 -92
- data/Gemfile.lock +1 -1
- data/HISTORY.md +3 -3
- data/Manifest.txt +9 -0
- data/README.md +77 -57
- data/Rakefile +44 -44
- data/bin/sportweb +6 -6
- data/lib/sportweb.rb +37 -66
- data/lib/sportweb/app.rb +233 -137
- data/lib/sportweb/boot_with_bundler.rb +130 -128
- data/lib/sportweb/boot_with_require.rb +30 -30
- data/lib/sportweb/version.rb +12 -4
- data/public/404.html +67 -0
- data/public/422.html +67 -0
- data/public/500.html +66 -0
- data/public/favicon.ico +0 -0
- data/public/images/placeholder24x24.png +0 -0
- data/public/images/placeholder32x32.png +0 -0
- data/public/images/placeholder48x48.png +0 -0
- data/public/images/placeholder64x64.png +0 -0
- data/public/robots.txt +1 -0
- metadata +15 -5
@@ -1,128 +1,130 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
puts '[boot] enter boot_with_bundler.rb'
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
puts '
|
10
|
-
|
11
|
-
puts '[boot]
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
require '
|
19
|
-
require '
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
#
|
28
|
-
#
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
#
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
puts "
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
if
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
puts "
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
puts '[boot]
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
##
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
#
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
puts '[boot]
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
require
|
90
|
-
puts '[boot]
|
91
|
-
|
92
|
-
puts '[boot]
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
###
|
99
|
-
|
100
|
-
|
101
|
-
##
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
puts '[boot]
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
puts '[boot] enter boot_with_bundler.rb'
|
4
|
+
|
5
|
+
|
6
|
+
## note: use production env
|
7
|
+
## note: requires precompiled assets with fingerprints!!!!
|
8
|
+
ENV['RACK_ENV'] ||= 'production'
|
9
|
+
puts "ENV['RACK_ENV'] = #{ENV['RACK_ENV']}"
|
10
|
+
|
11
|
+
puts '[boot] before require bundler'
|
12
|
+
require 'bundler'
|
13
|
+
puts '[boot] after require bundler'
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
# ruby core n stdlibs
|
18
|
+
require 'json'
|
19
|
+
require 'uri'
|
20
|
+
require 'logger'
|
21
|
+
require 'pp'
|
22
|
+
|
23
|
+
|
24
|
+
# 3rd party gems via bundler (see Gemfile)
|
25
|
+
|
26
|
+
####
|
27
|
+
# Note:
|
28
|
+
# The Bundle setup "clears" the load path,
|
29
|
+
# so the subsequent attempt to require something that is not in Gemfile
|
30
|
+
# will result of the load error.
|
31
|
+
|
32
|
+
##
|
33
|
+
# note: will look for Gemfile in current working folder
|
34
|
+
# use BUNDLE_GEMFILE env variable to
|
35
|
+
# tell bundler where the Gemfile is
|
36
|
+
|
37
|
+
puts "SportWeb.root: >>#{SportWeb.root}<<"
|
38
|
+
|
39
|
+
puts "ENV['BUNDLE_GEMFILE']=>>#{ENV['BUNDLE_GEMFILE']}<<"
|
40
|
+
|
41
|
+
## check if BUNDLE_GEMFILE env present/set? why? why not?
|
42
|
+
## for now check if Gemfile exists in working (current) dir? if yes, use it
|
43
|
+
|
44
|
+
if File.exist?( "./Gemfile")
|
45
|
+
puts "using local Gemfile"
|
46
|
+
ENV['BUNDLE_GEMFILE'] = "./Gemfile"
|
47
|
+
else
|
48
|
+
puts "using built-in Gemfile (shipping with sportweb gem)"
|
49
|
+
ENV['BUNDLE_GEMFILE'] = "#{SportWeb.root}/Gemfile"
|
50
|
+
end
|
51
|
+
|
52
|
+
puts "ENV['BUNDLE_GEMFILE']=>>#{ENV['BUNDLE_GEMFILE']}<<"
|
53
|
+
|
54
|
+
puts "load_path before:"
|
55
|
+
pp $:
|
56
|
+
|
57
|
+
puts '[boot] before Bundler.setup'
|
58
|
+
Bundler.setup
|
59
|
+
puts '[boot] after Bundler.setup'
|
60
|
+
|
61
|
+
|
62
|
+
unless File.exist?( "./Gemfile")
|
63
|
+
## if using built-in Gemfile shipping with gems
|
64
|
+
## auto-add sportweb/lib (that, this gem) to load path
|
65
|
+
## note: built-in Gemfile excludes (does NOT include) sportweb
|
66
|
+
|
67
|
+
puts "[boot] adding #\{SportWeb.root}/lib to load path #{SportWeb.root}/lib"
|
68
|
+
$:.unshift "#{SportWeb.root}/lib"
|
69
|
+
end
|
70
|
+
|
71
|
+
|
72
|
+
puts "load_path after:"
|
73
|
+
pp $:
|
74
|
+
|
75
|
+
####
|
76
|
+
# Note:
|
77
|
+
# For a small Gemfile, we'd advise you to skip Bundler.require
|
78
|
+
# and just require the gems by hand (especially given the need
|
79
|
+
# to put in a :require directive in the Gemfile).
|
80
|
+
# For much larger Gemfiles, using Bundler.require allows
|
81
|
+
# you to skip repeating a large stack of requirements.
|
82
|
+
|
83
|
+
puts '[boot] before Bundler.require'
|
84
|
+
Bundler.require(:default, ENV['RACK_ENV'].to_sym)
|
85
|
+
puts '[boot] after Bundler.require'
|
86
|
+
|
87
|
+
|
88
|
+
#########
|
89
|
+
# require rails n rails/all - still needed ??
|
90
|
+
puts '[boot] before require rails'
|
91
|
+
require 'rails'
|
92
|
+
puts '[boot] after require rails'
|
93
|
+
|
94
|
+
puts '[boot] before require rails/all'
|
95
|
+
## note: do NOT load active_record/railtie - will load database/config ??
|
96
|
+
## require it ourself
|
97
|
+
|
98
|
+
### require 'rails/all'
|
99
|
+
|
100
|
+
###
|
101
|
+
## gem 'sprockets-rails', :require => 'sprockets/railtie'
|
102
|
+
##
|
103
|
+
## Or alternatively require 'sprockets/railtie' in your config/application.rb if you have Bundler auto-require disabled.
|
104
|
+
|
105
|
+
['action_controller',
|
106
|
+
'sprockets'].each do |framework|
|
107
|
+
begin
|
108
|
+
require "#{framework}/railtie"
|
109
|
+
rescue LoadError
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
|
114
|
+
## require: 'action_controller/railtie' ## needed by sprockets-rails
|
115
|
+
## require: 'sprockets/railtie'
|
116
|
+
|
117
|
+
|
118
|
+
puts '[boot] after require rails/all'
|
119
|
+
|
120
|
+
|
121
|
+
#############
|
122
|
+
### move require app to sportweb.rb ????
|
123
|
+
|
124
|
+
puts '[boot] before require sportweb/app'
|
125
|
+
require 'sportweb/app'
|
126
|
+
puts '[boot] after require sportweb/app'
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
puts '[boot] leave boot_with_bundler.rb'
|
@@ -1,30 +1,30 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
###
|
4
|
-
# note: it's an addon to sportdb (get all libs via sportdb)
|
5
|
-
|
6
|
-
puts '[boot] before require worlddb'
|
7
|
-
require 'worlddb'
|
8
|
-
puts '[boot] after require worlddb'
|
9
|
-
|
10
|
-
|
11
|
-
puts '[boot] before require sportdb'
|
12
|
-
require 'sportdb'
|
13
|
-
puts '[boot] after require sportdb'
|
14
|
-
|
15
|
-
|
16
|
-
puts '[boot] before require rails'
|
17
|
-
require 'rails'
|
18
|
-
puts '[boot] after require rails'
|
19
|
-
|
20
|
-
|
21
|
-
puts '[boot] before require rails/all'
|
22
|
-
require 'rails/all'
|
23
|
-
puts '[boot] after require rails/all'
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
puts '[boot] before before sportdb-admin'
|
28
|
-
require 'sportdb/admin' ## require addon sportdb-keys
|
29
|
-
puts '[boot] after require sportdb-admin'
|
30
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
###
|
4
|
+
# note: it's an addon to sportdb (get all libs via sportdb)
|
5
|
+
|
6
|
+
puts '[boot] before require worlddb'
|
7
|
+
require 'worlddb'
|
8
|
+
puts '[boot] after require worlddb'
|
9
|
+
|
10
|
+
|
11
|
+
puts '[boot] before require sportdb'
|
12
|
+
require 'sportdb'
|
13
|
+
puts '[boot] after require sportdb'
|
14
|
+
|
15
|
+
|
16
|
+
puts '[boot] before require rails'
|
17
|
+
require 'rails'
|
18
|
+
puts '[boot] after require rails'
|
19
|
+
|
20
|
+
|
21
|
+
puts '[boot] before require rails/all'
|
22
|
+
require 'rails/all'
|
23
|
+
puts '[boot] after require rails/all'
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
puts '[boot] before before sportdb-admin'
|
28
|
+
require 'sportdb/admin' ## require addon sportdb-keys
|
29
|
+
puts '[boot] after require sportdb-admin'
|
30
|
+
|
data/lib/sportweb/version.rb
CHANGED
@@ -1,4 +1,12 @@
|
|
1
|
-
|
2
|
-
module SportWeb
|
3
|
-
VERSION = '0.
|
4
|
-
|
1
|
+
|
2
|
+
module SportWeb
|
3
|
+
VERSION = '0.2.0'
|
4
|
+
|
5
|
+
def self.banner
|
6
|
+
"sportweb/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.root
|
10
|
+
"#{File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )}"
|
11
|
+
end
|
12
|
+
end # module SportWeb
|
data/public/404.html
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
.rails-default-error-page {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
.rails-default-error-page div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
.rails-default-error-page div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
.rails-default-error-page h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
.rails-default-error-page div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body class="rails-default-error-page">
|
58
|
+
<!-- This file lives in public/404.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
62
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
63
|
+
</div>
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
65
|
+
</div>
|
66
|
+
</body>
|
67
|
+
</html>
|
data/public/422.html
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
.rails-default-error-page {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
.rails-default-error-page div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
.rails-default-error-page div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
.rails-default-error-page h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
.rails-default-error-page div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body class="rails-default-error-page">
|
58
|
+
<!-- This file lives in public/422.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>The change you wanted was rejected.</h1>
|
62
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
63
|
+
</div>
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
65
|
+
</div>
|
66
|
+
</body>
|
67
|
+
</html>
|