diff --git a/Gemfile b/Gemfile index 9a79033..7087b2c 100644 --- a/Gemfile +++ b/Gemfile @@ -4,3 +4,8 @@ gem 'sinatra', '~> 3.0' gem 'sinatra-contrib', '~> 3.0' gem 'puma', '~> 6.3' +group :development, :test do + gem 'rerun' + gem 'wdm', '>= 0.1.0' if Gem.win_platform? +end + diff --git a/Gemfile.lock b/Gemfile.lock index 3cbb969..2c32f87 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,10 @@ GEM remote: https://rubygems.org/ specs: + ffi (1.15.5) + listen (3.8.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) multi_json (1.15.0) mustermann (3.0.0) ruby2_keywords (~> 0.0.1) @@ -10,6 +14,11 @@ GEM rack (2.2.7) rack-protection (3.0.6) rack + rb-fsevent (0.11.2) + rb-inotify (0.10.1) + ffi (~> 1.0) + rerun (0.14.0) + listen (~> 3.0) ruby2_keywords (0.0.5) sinatra (3.0.6) mustermann (~> 3.0) @@ -29,6 +38,7 @@ PLATFORMS DEPENDENCIES puma (~> 6.3) + rerun sinatra (~> 3.0) sinatra-contrib (~> 3.0) diff --git a/Rakefile b/Rakefile index 396921a..615918e 100644 --- a/Rakefile +++ b/Rakefile @@ -1,8 +1,19 @@ require 'bundler/setup' +task :setup do + # Set bundle to install gems to local vendor path + system("bundle config set --local path 'vendor/bundle'") + # Install gems + system("bundle install") +end + namespace :server do task :start do + ENV['APP_ENV'] = 'production' system("puma") end -end + task :dev do + system('rerun --quiet --dir="src/" puma') + end +end diff --git a/config.ru b/config.ru index 0a74d21..5548770 100644 --- a/config.ru +++ b/config.ru @@ -1,3 +1,3 @@ root = ::File.dirname(__FILE__) -require ::File.join( root, 'server' ) +require ::File.join( root, 'src', 'server' ) run GameData.new diff --git a/public/css/remmington.css b/public/css/remmington.css new file mode 100644 index 0000000..f002ff9 --- /dev/null +++ b/public/css/remmington.css @@ -0,0 +1,3 @@ +#main-nav{ + margin-bottom: 15px; +} diff --git a/public/js/edgeville.js b/public/js/edgeville.js new file mode 100644 index 0000000..d0d1351 --- /dev/null +++ b/public/js/edgeville.js @@ -0,0 +1,5 @@ +$(document).ready(function() { + + $(document).foundation(); + +}); diff --git a/server.rb b/server.rb deleted file mode 100755 index 42a02a2..0000000 --- a/server.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'sinatra/base' - -# Base app -class GameData < Sinatra::Base - enable :sessions -end - -# Load routes -require_relative 'src/routes/init' diff --git a/src/routes/index.rb b/src/routes/index.rb index 092db3c..c92e6c5 100644 --- a/src/routes/index.rb +++ b/src/routes/index.rb @@ -1,6 +1,9 @@ class GameData < Sinatra::Base get '/' do - return 'Test.' + erb :'index/index', locals: { + title: 'Test!!!', + results: [] + } end # more routes... diff --git a/src/server.rb b/src/server.rb new file mode 100755 index 0000000..9f382d2 --- /dev/null +++ b/src/server.rb @@ -0,0 +1,16 @@ +require 'sinatra/base' + +# Base app +class GameData < Sinatra::Base + enable :sessions + + # Set up static file serving + enable :static + set :public_folder, File.join(__dir__, '/../public') + + # Set up our view engine + set :views, File.join(settings.root, '/../views') +end + +# Load routes +require_relative 'routes/init' diff --git a/views/index/index.erb b/views/index/index.erb new file mode 100644 index 0000000..34193f3 --- /dev/null +++ b/views/index/index.erb @@ -0,0 +1,31 @@ +
+ <% if results.length > 0 %> +
+

Latest benchmark results:

+
+
+ + + + + + + + + + <% results.each do |r| %> + + + + + + <% end %> + +
Hardware testedBenchmark usedScore
<%= r.hardware %><%= r.benchmark %><%= r.formatted_score() %>
+
+ <% else %> +
+

I'm sorry, there don't appear to be any benchmark results logged yet. Check again later!

+
+ <% end %> +
diff --git a/views/layout.erb b/views/layout.erb new file mode 100644 index 0000000..dd5f8d2 --- /dev/null +++ b/views/layout.erb @@ -0,0 +1,23 @@ + + + + + + + <%= title %> | Game Data + + + + + + + + + <%= erb :'partials/navbar', :locals => locals %> + + +
+ <%= yield %> +
+ + diff --git a/views/partials/navbar.erb b/views/partials/navbar.erb new file mode 100644 index 0000000..1645770 --- /dev/null +++ b/views/partials/navbar.erb @@ -0,0 +1,11 @@ +