Skip to content

Commit

Permalink
initial commit - scaffold project file structure with corneal
Browse files Browse the repository at this point in the history
  • Loading branch information
AlwinaO committed Dec 10, 2018
0 parents commit 972e229
Show file tree
Hide file tree
Showing 18 changed files with 409 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
source 'http://rubygems.org'

gem 'sinatra'
gem 'activerecord', '~> 4.2', '>= 4.2.6', :require => 'active_record'
gem 'sinatra-activerecord', :require => 'sinatra/activerecord'
gem 'rake'
gem 'require_all'
gem 'sqlite3'
gem 'thin'
gem 'shotgun'
gem 'pry'
gem 'bcrypt'
gem "tux"

group :test do
gem 'rspec'
gem 'capybara'
gem 'rack-test'
gem 'database_cleaner', git: 'https://github.com/bmabey/database_cleaner.git'
end
131 changes: 131 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
GIT
remote: https://github.com/bmabey/database_cleaner.git
revision: 4c2408ffdbbd990e78d6590f4ef6ba5e58aca673
specs:
database_cleaner (1.7.0)

GEM
remote: http://rubygems.org/
specs:
activemodel (4.2.11)
activesupport (= 4.2.11)
builder (~> 3.1)
activerecord (4.2.11)
activemodel (= 4.2.11)
activesupport (= 4.2.11)
arel (~> 6.0)
activesupport (4.2.11)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
arel (6.0.4)
bcrypt (3.1.12)
bond (0.5.1)
builder (3.2.3)
capybara (3.12.0)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (~> 1.2)
xpath (~> 3.2)
coderay (1.1.2)
concurrent-ruby (1.1.3)
daemons (1.2.6)
diff-lcs (1.3)
eventmachine (1.2.7)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
method_source (0.9.2)
mini_mime (1.0.1)
mini_portile2 (2.3.0)
minitest (5.11.3)
mustermann (1.0.3)
nokogiri (1.8.5)
mini_portile2 (~> 2.3.0)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
public_suffix (3.0.3)
rack (2.0.6)
rack-protection (2.0.4)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rake (12.3.2)
regexp_parser (1.3.0)
require_all (2.0.0)
ripl (0.7.1)
bond (~> 0.5.1)
ripl-multi_line (0.3.1)
ripl (>= 0.3.6)
ripl-rack (0.2.0)
rack (>= 1.0)
rack-test (>= 0.5)
ripl (>= 0.3.5)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
shotgun (0.9.2)
rack (>= 1.0)
sinatra (2.0.4)
mustermann (~> 1.0)
rack (~> 2.0)
rack-protection (= 2.0.4)
tilt (~> 2.0)
sinatra-activerecord (2.0.13)
activerecord (>= 3.2)
sinatra (>= 1.0)
sqlite3 (1.3.13)
thin (1.7.2)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
thread_safe (0.3.6)
tilt (2.0.9)
tux (0.3.0)
ripl (>= 0.3.5)
ripl-multi_line (>= 0.2.4)
ripl-rack (>= 0.2.0)
sinatra (>= 1.2.1)
tzinfo (1.2.5)
thread_safe (~> 0.1)
xpath (3.2.0)
nokogiri (~> 1.8)

PLATFORMS
ruby

DEPENDENCIES
activerecord (~> 4.2, >= 4.2.6)
bcrypt
capybara
database_cleaner!
pry
rack-test
rake
require_all
rspec
shotgun
sinatra
sinatra-activerecord
sqlite3
thin
tux

BUNDLED WITH
1.16.4
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

4 changes: 4 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ENV["SINATRA_ENV"] ||= "development"

require_relative './config/environment'
require 'sinatra/activerecord/rake'
14 changes: 14 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require './config/environment'

class ApplicationController < Sinatra::Base

configure do
set :public_folder, 'public'
set :views, 'app/views'
end

get "/" do
erb :welcome
end

end
Empty file added app/models/.gitkeep
Empty file.
32 changes: 32 additions & 0 deletions app/views/layout.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />

<title>Conferences</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link rel="stylesheet" href="/stylesheets/main.css" />
</head>
<body>
<div class="wrapper">

<%= yield %>

<footer class="branding">
<small>&copy; 2018 <strong>Conferences</strong></small>
</footer>
</div>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<!--[if lt IE 7]>
<script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.2/CFInstall.min.js"></script>
<script>window.attachEvent("onload",function(){CFInstall.check({mode:"overlay"})})</script>
<![endif]-->
</body>
</html>
23 changes: 23 additions & 0 deletions app/views/welcome.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<div class="container">
<header><img src="images/corneal-small.png" class="img-responsive main-image"></header>
<div class="col-md-8 col-md-offset-2">
<h2>Sinatra Template Default Page</h2>

<div class="content">
<p>Welcome to the Sinatra Template! If you're seeing this page, then everything is working
as expected. To get started, delete this file (<code>app/views/welcome.erb)</code> and begin adding
your own actions to <code>application_controller.rb</code>. For more information, see the <a href="https://github.com/thebrianemory/corneal">README</a>.</p>
</div>

<div class="sidebar">
<h3>Environment</h3>
<ul>
<li><b>Ruby:</b> <%= RUBY_VERSION %></li>
<li><b>Environment:</b> <%= ENV["RACK_ENV"] %></li>
<li><b>Server:</b> <%= @env["SERVER_SOFTWARE"] %></li>
<li><b>Port:</b> <%= @env["SERVER_PORT"] %></li>
</ul>
</div>

</div>
</div>
8 changes: 8 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require './config/environment'

if ActiveRecord::Migrator.needs_migration?
raise 'Migrations are pending. Run `rake db:migrate` to resolve the issue.'
end
use Rack::MethodOverride

run ApplicationController
12 changes: 12 additions & 0 deletions config/environment.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ENV['SINATRA_ENV'] ||= "development"

require 'bundler/setup'
Bundler.require(:default, ENV['SINATRA_ENV'])

ActiveRecord::Base.establish_connection(
:adapter => "sqlite3",
:database => "db/#{ENV['SINATRA_ENV']}.sqlite"
)

require './app/controllers/application_controller'
require_all 'app'
Empty file added lib/.gitkeep
Empty file.
Binary file added public/favicon.ico
Binary file not shown.
Empty file added public/images/.gitkeep
Empty file.
Binary file added public/images/corneal-small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added public/javascripts/.gitkeep
Empty file.
115 changes: 115 additions & 0 deletions public/stylesheets/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
@media screen {
/* --- Reset Styles --- */
* {
list-style: none;
margin: 0;
padding: 0;
}

html, body {
height: 100%;
width: 100%;
}

/* --- Welcome Page Styles --- */
body {
background-color: lightblue;
color: #333;
font-family: Sans-Serif;
line-height: 18px;
}

.wrapper {
background: #fff;
-moz-box-shadow: 0 0 10px rgba(0,0,0,.3);
-webkit-box-shadow: 0 0 10px rgba(0,0,0,.3);
box-shadow: 0 0 10px rgba(0,0,0,.3);
margin: 16px auto;
max-width: 960px;
padding: 2.25%; /* 18px / 800px */
width: 85%;
}

h1 {
font-size: 36px;
line-height: 54px;
}

h2 {
border-bottom: 2px solid #ccc;
font-size: 24px;
line-height: 36px;
margin-bottom: 16px;
}

h3 {
font-size: 18px;
line-height: 36px;
}

p {
margin-bottom: 18px;
}

.main {
overflow: hidden;
}

.content {
float: left;
width: 60%; /* 480px / 800px */
}

.sidebar {
background: #eee;
border: 1px solid #ccc;
float: right;
padding: 2.08333333333%; /* 5px / 240px */
width: 30%; /* 240px / 800px */
}

.sidebar ul {
font-size: 14px;
}

.branding {
clear: both;
}

footer.branding {
border-top: 2px solid #ccc;
margin-top: 20px;
padding-top: 20px;
}
}

@media screen and (max-width: 600px) {
.wrapper {
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
width: auto;
}

.content, .sidebar {
float: none;
width: 100%;
}

.sidebar {
background: transparent;
border: none;
border-top: 2px solid #ccc;
padding: 0;
}

h1 {
font-size: 24px;
line-height: 36px;
}

h2 {
font-size: 18px;
line-height: 24px;
}
}
13 changes: 13 additions & 0 deletions spec/application_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require_relative "spec_helper"

def app
ApplicationController
end

describe ApplicationController do
it "responds with a welcome message" do
get '/'
expect(last_response.status).to eq(200)
expect(last_response.body).to include("Welcome to the Sinatra Template!")
end
end
Loading

0 comments on commit 972e229

Please sign in to comment.