Skip to content

Commit 86934f2

Browse files
committed
Add the source code for the demo application
[refs #28500babc311]
1 parent d456bd8 commit 86934f2

21 files changed

+551
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tmp/

.rspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--require spec_helper

Gemfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'activerecord'
4+
gem 'pg'
5+
gem 'rake'
6+
gem 'sinatra', require: 'sinatra/base'
7+
gem 'sinatra-activerecord', '~> 2.0'
8+
9+
group :development, :test do
10+
gem 'rack-test'
11+
gem 'rspec'
12+
gem 'rspec-core'
13+
gem 'rspec_junit_formatter'
14+
end

Gemfile.lock

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
activemodel (5.1.4)
5+
activesupport (= 5.1.4)
6+
activerecord (5.1.4)
7+
activemodel (= 5.1.4)
8+
activesupport (= 5.1.4)
9+
arel (~> 8.0)
10+
activesupport (5.1.4)
11+
concurrent-ruby (~> 1.0, >= 1.0.2)
12+
i18n (~> 0.7)
13+
minitest (~> 5.1)
14+
tzinfo (~> 1.1)
15+
arel (8.0.0)
16+
concurrent-ruby (1.0.5)
17+
diff-lcs (1.3)
18+
i18n (0.9.1)
19+
concurrent-ruby (~> 1.0)
20+
minitest (5.10.3)
21+
mustermann (1.0.2)
22+
pg (0.21.0)
23+
rack (2.0.4)
24+
rack-protection (2.0.1)
25+
rack
26+
rack-test (0.6.3)
27+
rack (>= 1.0)
28+
rake (12.3.0)
29+
rspec (3.7.0)
30+
rspec-core (~> 3.7.0)
31+
rspec-expectations (~> 3.7.0)
32+
rspec-mocks (~> 3.7.0)
33+
rspec-core (3.7.1)
34+
rspec-support (~> 3.7.0)
35+
rspec-expectations (3.7.0)
36+
diff-lcs (>= 1.2.0, < 2.0)
37+
rspec-support (~> 3.7.0)
38+
rspec-mocks (3.7.0)
39+
diff-lcs (>= 1.2.0, < 2.0)
40+
rspec-support (~> 3.7.0)
41+
rspec-support (3.7.1)
42+
sinatra (2.0.1)
43+
mustermann (~> 1.0)
44+
rack (~> 2.0)
45+
rack-protection (= 2.0.1)
46+
tilt (~> 2.0)
47+
sinatra-activerecord (2.0.13)
48+
activerecord (>= 3.2)
49+
sinatra (>= 1.0)
50+
thread_safe (0.3.6)
51+
tilt (2.0.8)
52+
tzinfo (1.2.4)
53+
thread_safe (~> 0.1)
54+
55+
PLATFORMS
56+
ruby
57+
58+
DEPENDENCIES
59+
activerecord
60+
pg
61+
rack-test
62+
rake
63+
rspec
64+
rspec-core
65+
sinatra
66+
sinatra-activerecord (~> 2.0)
67+
68+
BUNDLED WITH
69+
1.15.4

Rakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require File.expand_path('../config/environment', __FILE__)
2+
require 'sinatra/activerecord/rake'

app/app.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class App < Sinatra::Base
2+
get '/' do
3+
Request.create!(ip: request.ip, host: Socket.gethostname, path: request.path, timestamp: Time.now)
4+
erb :index, locals: { requests: Request.all.order(timestamp: :desc).limit(25) }
5+
end
6+
end

app/models/request.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class Request < ActiveRecord::Base
2+
3+
end

app/public/css/bootstrap.min.css

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

app/public/fonts/glyphicons-halflings-regular.svg

Lines changed: 288 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)