Skip to content

Commit b93a724

Browse files
committed
first passing spec
1 parent 88c9a85 commit b93a724

File tree

13 files changed

+102
-31
lines changed

13 files changed

+102
-31
lines changed

Gemfile

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,21 @@ gem "turbolinks", "~> 5" # Turbolinks makes navigating your web application fast
4141
gem "hamlit" # Faster haml templates
4242
gem "bootstrap" # Internet Style
4343

44+
gem "commonmarker" # Rendering markdown. Used to render readme on homepage
45+
4446
# Reduces boot times through caching; required in config/boot.rb
4547
gem "bootsnap", ">= 1.1.0", require: false
4648

49+
group :production do
50+
# Make logging - more useful and ingestible
51+
gem "lograge" # Structure log data, put it in single lines to improve the functionality
52+
gem "logstash-event" # Use logstash format for logging data
53+
end
54+
4755
group :development, :test do
48-
# Call "byebug" anywhere in the code to stop execution and get a debugger console
49-
gem "rspec-rails"
50-
gem "factory_bot_rails"
56+
gem "foreman" # Process runner for local work
57+
gem "rspec-rails" # Test framework
58+
gem "factory_bot_rails" # mocking/stubbing
5159
end
5260

5361
group :development do
@@ -60,21 +68,13 @@ group :development do
6068
end
6169

6270
group :test do
63-
gem "database_cleaner"
6471
gem "guard", "~> 2.13.0", require: false
6572
gem "guard-rspec", "~> 4.6.4", require: false
6673
gem "guard-rubocop", require: false
74+
gem "rails-controller-testing" # Assert testing views
6775
end
6876

69-
# Logging - more useful and fun
70-
gem "lograge" # Structure log data, put it in single lines to improve the functionality
71-
gem "logstash-event" # Use logstash format for logging data
72-
7377
# Performance Stuff
74-
75-
# this is an optional gem, it provides a high performance replacement
76-
# to String#blank? a method that is called quite frequently in current
77-
# ActiveRecord, this may change in the future
78-
gem "fast_blank"
78+
gem "fast_blank" # high performance replacement String#blank? a method that is called quite frequently in ActiveRecord
7979
gem "flamegraph", require: false
8080
gem "rack-mini-profiler", require: false # If you can't see it you can't make it better

Gemfile.lock

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,11 @@ GEM
6565
coderay (1.1.2)
6666
coercible (1.0.0)
6767
descendants_tracker (~> 0.0.1)
68+
commonmarker (0.17.11)
69+
ruby-enum (~> 0.5)
6870
concurrent-ruby (1.0.5)
6971
connection_pool (2.2.2)
7072
crass (1.0.4)
71-
database_cleaner (1.7.0)
7273
descendants_tracker (0.0.4)
7374
thread_safe (~> 0.3, >= 0.3.1)
7475
devise (4.5.0)
@@ -79,6 +80,7 @@ GEM
7980
warden (~> 1.2.3)
8081
devise-bootstrap-views (1.1.0)
8182
diff-lcs (1.3)
83+
dotenv (0.7.0)
8284
equalizer (0.0.11)
8385
erubi (1.7.1)
8486
execjs (2.7.0)
@@ -92,6 +94,9 @@ GEM
9294
fast_blank (1.0.0)
9395
ffi (1.9.25)
9496
flamegraph (0.9.5)
97+
foreman (0.64.0)
98+
dotenv (~> 0.7.0)
99+
thor (>= 0.13.6)
95100
formatador (0.2.5)
96101
globalid (0.4.1)
97102
activesupport (>= 4.2.0)
@@ -235,6 +240,10 @@ GEM
235240
bundler (>= 1.3.0)
236241
railties (= 5.2.1)
237242
sprockets-rails (>= 2.0.0)
243+
rails-controller-testing (1.0.2)
244+
actionpack (~> 5.x, >= 5.0.1)
245+
actionview (~> 5.x, >= 5.0.1)
246+
activesupport (~> 5.x)
238247
rails-dom-testing (2.0.3)
239248
activesupport (>= 4.2.0)
240249
nokogiri (>= 1.6)
@@ -289,6 +298,8 @@ GEM
289298
rainbow (>= 2.2.2, < 4.0)
290299
ruby-progressbar (~> 1.7)
291300
unicode-display_width (~> 1.0, >= 1.0.1)
301+
ruby-enum (0.7.2)
302+
i18n
292303
ruby-progressbar (1.10.0)
293304
ruby_dep (1.5.0)
294305
sass (3.5.7)
@@ -366,12 +377,13 @@ DEPENDENCIES
366377
api-pagination
367378
bootsnap (>= 1.1.0)
368379
bootstrap
369-
database_cleaner
380+
commonmarker
370381
devise
371382
devise-bootstrap-views
372383
factory_bot_rails
373384
fast_blank
374385
flamegraph
386+
foreman
375387
grape (~> 1.0.3)
376388
grape-swagger
377389
grape_logging
@@ -391,6 +403,7 @@ DEPENDENCIES
391403
rack-cors
392404
rack-mini-profiler
393405
rails (~> 5.2.1)
406+
rails-controller-testing
394407
readthis
395408
redis
396409
rspec-rails

Procfile_development

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
web: bundle exec puma -t 5:5 -p 3003 -e ${RACK_ENV:-development}
2+
log: tail -f log/development.log

README.md renamed to README.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Updates - need to be integrated into the documentation
1313
TODO:
1414

1515
- Add doorkeeper back in
16-
- make a decision re: winebouncer or built in doorkeeper bidness
16+
- make a decision re: winebouncer or built in doorkeeper shizzam
1717

1818
---
1919

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
class LandingController < ApplicationController
22
def index
3+
require "commonmarker"
34
end
45
end

app/views/landing/index.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111

1212
.container.rendered-markdown
1313
:plain
14-
#{simple_format render file: "#{Rails.root}/README.markdown"}
14+
#{CommonMarker.render_html(File.read("#{Rails.root}/README.markdown"))}

config/environments/development.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
# Don't care if the mailer can't send.
3636
config.action_mailer.raise_delivery_errors = false
37+
config.action_mailer.default_url_options = { host: "localhost", port: 3003 }
3738

3839
config.action_mailer.perform_caching = false
3940

config/environments/production.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@
5555
# when problems arise.
5656
config.log_level = :debug
5757

58+
# Use lograge in production to make logging better
59+
config.lograge.enabled = true
60+
config.lograge.formatter = Lograge::Formatters::Logstash.new
61+
config.lograge.custom_options = lambda do |event|
62+
{
63+
remote_ip: event.payload[:ip],
64+
params: event.payload[:params].except("controller", "action", "format", "id")
65+
}
66+
end
5867
# Prepend all log lines with the following tags.
5968
config.log_tags = [ :request_id ]
6069

config/routes.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1+
require "sidekiq/web"
2+
13
Rails.application.routes.draw do
24
devise_for :users
35

6+
root "landing#index"
7+
8+
resources :documentation, only: [:index] do
9+
collection do
10+
get :api_v1
11+
get :o2c
12+
get :authorize
13+
end
14+
end
15+
16+
# Authenticate sidekiq interface - probably update to verify users are admins or something: https://github.com/mperham/sidekiq/wiki/Monitoring
17+
authenticate :user do
18+
mount Sidekiq::Web, at: "/sidekiq"
19+
end
20+
421
# Grape API - must be below routes so it doesn't override
522
mount API::Base => "/api"
623
end

db/schema.rb

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This file is auto-generated from the current state of the database. Instead
2+
# of editing this file, please use the migrations feature of Active Record to
3+
# incrementally modify your database, and then regenerate this schema definition.
4+
#
5+
# Note that this schema.rb definition is the authoritative source for your
6+
# database schema. If you need to create the application database on another
7+
# system, you should be using db:schema:load, not running all the migrations
8+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
9+
# you'll amass, the slower it'll run and the greater likelihood for issues).
10+
#
11+
# It's strongly recommended that you check this file into your version control system.
12+
13+
ActiveRecord::Schema.define(version: 2018_09_02_201811) do
14+
15+
# These are extensions that must be enabled in order to support this database
16+
enable_extension "plpgsql"
17+
18+
create_table "users", force: :cascade do |t|
19+
t.string "email", default: "", null: false
20+
t.string "encrypted_password", default: "", null: false
21+
t.string "reset_password_token"
22+
t.datetime "reset_password_sent_at"
23+
t.datetime "remember_created_at"
24+
t.string "provider"
25+
t.datetime "created_at", null: false
26+
t.datetime "updated_at", null: false
27+
t.index ["email"], name: "index_users_on_email", unique: true
28+
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
29+
end
30+
31+
end

0 commit comments

Comments
 (0)