sportweb 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,128 +1,130 @@
1
- # encoding: utf-8
2
-
3
- puts '[boot] enter boot_with_bundler.rb'
4
-
5
-
6
- ENV['RACK_ENV'] ||= 'development'
7
- puts "ENV['RACK_ENV'] = #{ENV['RACK_ENV']}"
8
-
9
- puts '[boot] before require bundler'
10
- require 'bundler'
11
- puts '[boot] after require bundler'
12
-
13
-
14
-
15
- # ruby core n stdlibs
16
- require 'json'
17
- require 'uri'
18
- require 'logger'
19
- require 'pp'
20
-
21
-
22
- # 3rd party gems via bundler (see Gemfile)
23
-
24
- ####
25
- # Note:
26
- # The Bundle setup "clears" the load path,
27
- # so the subsequent attempt to require something that is not in Gemfile
28
- # will result of the load error.
29
-
30
- ##
31
- # note: will look for Gemfile in current working folder
32
- # use BUNDLE_GEMFILE env variable to
33
- # tell bundler where the Gemfile is
34
-
35
- puts "SportWeb.root: >>#{SportWeb.root}<<"
36
-
37
- puts "ENV['BUNDLE_GEMFILE']=>>#{ENV['BUNDLE_GEMFILE']}<<"
38
-
39
- ## check if BUNDLE_GEMFILE env present/set? why? why not?
40
- ## for now check if Gemfile exists in working (current) dir? if yes, use it
41
-
42
- if File.exist?( "./Gemfile")
43
- puts "using local Gemfile"
44
- ENV['BUNDLE_GEMFILE'] = "./Gemfile"
45
- else
46
- puts "using built-in Gemfile (shipping with sportweb gem)"
47
- ENV['BUNDLE_GEMFILE'] = "#{SportWeb.root}/Gemfile"
48
- end
49
-
50
- puts "ENV['BUNDLE_GEMFILE']=>>#{ENV['BUNDLE_GEMFILE']}<<"
51
-
52
- puts "load_path before:"
53
- pp $:
54
-
55
- puts '[boot] before Bundler.setup'
56
- Bundler.setup
57
- puts '[boot] after Bundler.setup'
58
-
59
-
60
- unless File.exist?( "./Gemfile")
61
- ## if using built-in Gemfile shipping with gems
62
- ## auto-add sportweb/lib (that, this gem) to load path
63
- ## note: built-in Gemfile excludes (does NOT include) sportweb
64
-
65
- puts "[boot] adding #\{SportWeb.root}/lib to load path #{SportWeb.root}/lib"
66
- $:.unshift "#{SportWeb.root}/lib"
67
- end
68
-
69
-
70
- puts "load_path after:"
71
- pp $:
72
-
73
- ####
74
- # Note:
75
- # For a small Gemfile, we'd advise you to skip Bundler.require
76
- # and just require the gems by hand (especially given the need
77
- # to put in a :require directive in the Gemfile).
78
- # For much larger Gemfiles, using Bundler.require allows
79
- # you to skip repeating a large stack of requirements.
80
-
81
- puts '[boot] before Bundler.require'
82
- Bundler.require(:default, ENV['RACK_ENV'].to_sym)
83
- puts '[boot] after Bundler.require'
84
-
85
-
86
- #########
87
- # require rails n rails/all - still needed ??
88
- puts '[boot] before require rails'
89
- require 'rails'
90
- puts '[boot] after require rails'
91
-
92
- puts '[boot] before require rails/all'
93
- ## note: do NOT load active_record/railtie - will load database/config ??
94
- ## require it ourself
95
-
96
- ### require 'rails/all'
97
-
98
- ###
99
- ## gem 'sprockets-rails', :require => 'sprockets/railtie'
100
- ##
101
- ## Or alternatively require 'sprockets/railtie' in your config/application.rb if you have Bundler auto-require disabled.
102
-
103
- ['action_controller',
104
- 'sprockets'].each do |framework|
105
- begin
106
- require "#{framework}/railtie"
107
- rescue LoadError
108
- end
109
- end
110
-
111
-
112
- ## require: 'action_controller/railtie' ## needed by sprockets-rails
113
- ## require: 'sprockets/railtie'
114
-
115
-
116
- puts '[boot] after require rails/all'
117
-
118
-
119
- #############
120
- ### move require app to sportweb.rb ????
121
-
122
- puts '[boot] before require sportweb/app'
123
- require 'sportweb/app'
124
- puts '[boot] after require sportweb/app'
125
-
126
-
127
-
128
- puts '[boot] leave boot_with_bundler.rb'
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
+
@@ -1,4 +1,12 @@
1
-
2
- module SportWeb
3
- VERSION = '0.1.0'
4
- end
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>