Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sinatra #4

Merged
merged 17 commits into from
Feb 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.env
.DS_Store
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color
--require spec_helper
27 changes: 27 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
source 'https://rubygems.org'
ruby '2.2.4'

# Server
gem 'sinatra'
gem 'honeybadger', '~> 2.0'
gem 'pony'

# Database
gem 'sequel'
gem 'pg'

# Frontend
gem 'slim'

# Rack gems
gem 'rack'
gem 'rake'
gem 'rack-cors'
gem 'rack-contrib'

gem 'dotenv'

group :development, :test do
gem 'rspec'
gem 'rack-test'
end
72 changes: 72 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.2.5)
dotenv (2.1.1)
git-version-bump (0.15.1)
honeybadger (2.7.2)
mail (2.6.4)
mime-types (>= 1.16, < 4)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
pg (0.19.0)
pony (1.11)
mail (>= 2.0)
rack (1.6.5)
rack-contrib (1.4.0)
git-version-bump (~> 0.15)
rack (~> 1.4)
rack-cors (0.4.1)
rack-protection (1.5.3)
rack
rack-test (0.6.3)
rack (>= 1.0)
rake (12.0.0)
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-core (3.5.4)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-mocks (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
sequel (4.43.0)
sinatra (1.4.8)
rack (~> 1.5)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
slim (3.0.7)
temple (~> 0.7.6)
tilt (>= 1.3.3, < 2.1)
temple (0.7.7)
tilt (2.0.6)

PLATFORMS
ruby

DEPENDENCIES
dotenv
honeybadger (~> 2.0)
pg
pony
rack
rack-contrib
rack-cors
rack-test
rake
rspec
sequel
sinatra
slim

RUBY VERSION
ruby 2.2.4p230

BUNDLED WITH
1.14.3
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: bundle exec rackup config.ru --host 0.0.0.0 -p $PORT
32 changes: 32 additions & 0 deletions app.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
require 'sinatra/base'
require 'slim'

class URWelcome < Sinatra::Base
set :root, File.dirname(__FILE__)
set :public_folder, 'public'

get '/' do
slim :index
end

post '/signup' do
Member.create(name: params[:name], email: params[:email])
Pony.mail to: params[:email],
from: 'hello@saberespoder.com',
subject: 'Welcome to URWelcome!',
body: 'Thank you for joining! We will email you more information shortly.'
200
end

get '/images/:file' do
send_file('./public/assets/images/'+params[:file], :disposition => 'inline')
end

get '/assets/stylesheets/:file' do
send_file('./public/assets/stylesheets'+params[:file], :disposition => 'inline')
end

get '/assets/javascripts/:file' do
send_file('./public/assets/javascripts'+params[:file], :disposition => 'inline')
end
end
103 changes: 0 additions & 103 deletions blank.html

This file was deleted.

10 changes: 10 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
machine:
ruby:
version:
2.2.4
services:
- postgresql

database:
override:
- createdb urwelcome_development
4 changes: 4 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require './app'
require './rack_config'

run URWelcome.new
Loading