Skip to content

Commit 0ad12c6

Browse files
author
Matt Swanson
committed
initial commit
0 parents  commit 0ad12c6

13 files changed

Lines changed: 3605 additions & 0 deletions

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
*.gem
2+
*.rbc
3+
.bundle
4+
.config
5+
coverage
6+
InstalledFiles
7+
lib/bundler/man
8+
pkg
9+
rdoc
10+
spec/reports
11+
test/tmp
12+
test/version_tmp
13+
tmp
14+
15+
# YARD artifacts
16+
.yardoc
17+
_yardoc
18+
doc/
19+
20+
db/*.sqlite
21+
.DS_Store

Gemfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
source 'https://rubygems.org'
2+
3+
gem "sinatra"
4+
gem "sinatra-activerecord"
5+
gem "sinatra-flash"
6+
gem "sinatra-contrib", github: "sinatra/sinatra-contrib"
7+
8+
gem "rake"
9+
gem "delayed_job_active_record"
10+
11+
group :production do
12+
gem "unicorn"
13+
gem "pg"
14+
end
15+
16+
group :development do
17+
gem "sqlite3"
18+
end
19+
20+
group(:development, :testing) do
21+
gem "pry"
22+
gem "rspec"
23+
gem "rack-test"
24+
gem "shotgun"
25+
gem "racksh"
26+
end

Gemfile.lock

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
GIT
2+
remote: git://github.com/sinatra/sinatra-contrib.git
3+
revision: 639acf8e8aec660cae5e4bfb5ed3d03132ed98e5
4+
specs:
5+
sinatra-contrib (1.4.0)
6+
backports (>= 2.0)
7+
eventmachine
8+
rack-protection
9+
rack-test
10+
sinatra (~> 1.4.0)
11+
tilt (~> 1.3)
12+
13+
GEM
14+
remote: https://rubygems.org/
15+
specs:
16+
activemodel (3.2.13)
17+
activesupport (= 3.2.13)
18+
builder (~> 3.0.0)
19+
activerecord (3.2.13)
20+
activemodel (= 3.2.13)
21+
activesupport (= 3.2.13)
22+
arel (~> 3.0.2)
23+
tzinfo (~> 0.3.29)
24+
activesupport (3.2.13)
25+
i18n (= 0.6.1)
26+
multi_json (~> 1.0)
27+
arel (3.0.2)
28+
backports (3.3.0)
29+
builder (3.0.4)
30+
coderay (1.0.9)
31+
delayed_job (3.0.5)
32+
activesupport (~> 3.0)
33+
delayed_job_active_record (0.4.4)
34+
activerecord (>= 2.1.0, < 4)
35+
delayed_job (~> 3.0)
36+
diff-lcs (1.2.2)
37+
eventmachine (1.0.3)
38+
i18n (0.6.1)
39+
kgio (2.8.0)
40+
method_source (0.8.1)
41+
multi_json (1.7.2)
42+
pg (0.15.0)
43+
pry (0.9.12)
44+
coderay (~> 1.0.5)
45+
method_source (~> 0.8)
46+
slop (~> 3.4)
47+
rack (1.5.2)
48+
rack-protection (1.5.0)
49+
rack
50+
rack-test (0.6.2)
51+
rack (>= 1.0)
52+
racksh (1.0.0)
53+
rack (>= 1.0)
54+
rack-test (>= 0.5)
55+
raindrops (0.10.0)
56+
rake (10.0.4)
57+
rspec (2.13.0)
58+
rspec-core (~> 2.13.0)
59+
rspec-expectations (~> 2.13.0)
60+
rspec-mocks (~> 2.13.0)
61+
rspec-core (2.13.1)
62+
rspec-expectations (2.13.0)
63+
diff-lcs (>= 1.1.3, < 2.0)
64+
rspec-mocks (2.13.0)
65+
shotgun (0.9)
66+
rack (>= 1.0)
67+
sinatra (1.4.2)
68+
rack (~> 1.5, >= 1.5.2)
69+
rack-protection (~> 1.4)
70+
tilt (~> 1.3, >= 1.3.4)
71+
sinatra-activerecord (1.2.2)
72+
activerecord (~> 3.0)
73+
sinatra (~> 1.0)
74+
sinatra-flash (0.3.0)
75+
sinatra (>= 1.0.0)
76+
slop (3.4.4)
77+
sqlite3 (1.3.7)
78+
tilt (1.3.6)
79+
tzinfo (0.3.37)
80+
unicorn (4.6.2)
81+
kgio (~> 2.6)
82+
rack
83+
raindrops (~> 0.7)
84+
85+
PLATFORMS
86+
ruby
87+
88+
DEPENDENCIES
89+
delayed_job_active_record
90+
pg
91+
pry
92+
rack-test
93+
racksh
94+
rake
95+
rspec
96+
shotgun
97+
sinatra
98+
sinatra-activerecord
99+
sinatra-contrib!
100+
sinatra-flash
101+
sqlite3
102+
unicorn

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
A work-in-progress, self-hosted, anti-social RSS reader.
2+
3+
It looks something like this at the moment:
4+
5+
![](http://i.imgur.com/CmiINVG.png)

app.rb

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
require "sinatra/base"
2+
require "sinatra/activerecord"
3+
require "sinatra/flash"
4+
require "sinatra/contrib/all"
5+
6+
class Stringer < Sinatra::Base
7+
configure do
8+
set :database_file, "config/database.yml"
9+
set :views, "app/views"
10+
set :public_dir, "app/public"
11+
12+
enable :sessions
13+
set :session_secret, "secret!"
14+
15+
register Sinatra::ActiveRecordExtension
16+
register Sinatra::Flash
17+
register Sinatra::Contrib
18+
end
19+
20+
helpers do
21+
# allow for partials using this syntax
22+
# = render partial: :foo
23+
def render(*args)
24+
if args.first.is_a?(Hash) && args.first.keys.include?(:partial)
25+
return haml "partials/_#{args.first[:partial]}".to_sym, :layout => false
26+
else
27+
super
28+
end
29+
end
30+
end
31+
32+
get "/" do
33+
@stories = []
34+
@stories << Story.new("The GitHub Blog", "New GitHub Pages domain: github.io", "Beginning today all GitHub pages...")
35+
@stories << Story.new("Quantified Self", "Eric Boyd: Learning from my Nike FuelBand Data", "We've been getting some...")
36+
@stories << Story.new("Atomic Spin", "Why Mou Is My New Note-Taking App", "Taking notes has been a part...")
37+
@stories << Story.new("FlowingData", "Introducing Data Points", "Whoa, that was fast. Data...")
38+
39+
erb :index
40+
end
41+
42+
class Story < Struct.new(:source, :headline, :lead); end;
43+
end

0 commit comments

Comments
 (0)