Skip to content

Commit f0117cc

Browse files
committed
fixing micro-reddit folder
1 parent 9e0eb5b commit f0117cc

File tree

18,123 files changed

+1665194
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

18,123 files changed

+1665194
-1
lines changed

.DS_Store

-2 KB
Binary file not shown.

micro-reddit

Lines changed: 0 additions & 1 deletion
This file was deleted.

micro-reddit/.DS_Store

10 KB
Binary file not shown.

micro-reddit/.browserslistrc

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

micro-reddit/.ruby-version

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

micro-reddit/Gemfile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
source 'https://rubygems.org'
2+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3+
4+
ruby '2.7.0'
5+
6+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
7+
gem 'rails', '~> 6.1.0'
8+
# Use sqlite3 as the database for Active Record
9+
gem 'sqlite3', '~> 1.4'
10+
# Use Puma as the app server
11+
gem 'puma', '~> 5.0'
12+
# Use SCSS for stylesheets
13+
gem 'sass-rails', '>= 6'
14+
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
15+
gem 'webpacker', '~> 5.0'
16+
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
17+
gem 'turbolinks', '~> 5'
18+
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
19+
gem 'jbuilder', '~> 2.7'
20+
# Use Redis adapter to run Action Cable in production
21+
# gem 'redis', '~> 4.0'
22+
# Use Active Model has_secure_password
23+
# gem 'bcrypt', '~> 3.1.7'
24+
25+
# Use Active Storage variant
26+
# gem 'image_processing', '~> 1.2'
27+
28+
# Reduces boot times through caching; required in config/boot.rb
29+
gem 'bootsnap', '>= 1.4.4', require: false
30+
31+
group :development, :test do
32+
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
33+
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
34+
end
35+
36+
group :development do
37+
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
38+
gem 'web-console', '>= 4.1.0'
39+
# Display performance information such as SQL time and flame graphs for each request in your browser.
40+
# Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
41+
gem 'rack-mini-profiler', '~> 2.0'
42+
gem 'listen', '~> 3.3'
43+
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
44+
gem 'spring'
45+
end
46+
47+
group :test do
48+
# Adds support for Capybara system testing and selenium driver
49+
gem 'capybara', '>= 3.26'
50+
gem 'selenium-webdriver'
51+
# Easy installation and use of web drivers to run system tests with browsers
52+
gem 'webdrivers'
53+
end
54+
55+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
56+
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

micro-reddit/Gemfile.lock

Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
actioncable (6.1.3)
5+
actionpack (= 6.1.3)
6+
activesupport (= 6.1.3)
7+
nio4r (~> 2.0)
8+
websocket-driver (>= 0.6.1)
9+
actionmailbox (6.1.3)
10+
actionpack (= 6.1.3)
11+
activejob (= 6.1.3)
12+
activerecord (= 6.1.3)
13+
activestorage (= 6.1.3)
14+
activesupport (= 6.1.3)
15+
mail (>= 2.7.1)
16+
actionmailer (6.1.3)
17+
actionpack (= 6.1.3)
18+
actionview (= 6.1.3)
19+
activejob (= 6.1.3)
20+
activesupport (= 6.1.3)
21+
mail (~> 2.5, >= 2.5.4)
22+
rails-dom-testing (~> 2.0)
23+
actionpack (6.1.3)
24+
actionview (= 6.1.3)
25+
activesupport (= 6.1.3)
26+
rack (~> 2.0, >= 2.0.9)
27+
rack-test (>= 0.6.3)
28+
rails-dom-testing (~> 2.0)
29+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
30+
actiontext (6.1.3)
31+
actionpack (= 6.1.3)
32+
activerecord (= 6.1.3)
33+
activestorage (= 6.1.3)
34+
activesupport (= 6.1.3)
35+
nokogiri (>= 1.8.5)
36+
actionview (6.1.3)
37+
activesupport (= 6.1.3)
38+
builder (~> 3.1)
39+
erubi (~> 1.4)
40+
rails-dom-testing (~> 2.0)
41+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
42+
activejob (6.1.3)
43+
activesupport (= 6.1.3)
44+
globalid (>= 0.3.6)
45+
activemodel (6.1.3)
46+
activesupport (= 6.1.3)
47+
activerecord (6.1.3)
48+
activemodel (= 6.1.3)
49+
activesupport (= 6.1.3)
50+
activestorage (6.1.3)
51+
actionpack (= 6.1.3)
52+
activejob (= 6.1.3)
53+
activerecord (= 6.1.3)
54+
activesupport (= 6.1.3)
55+
marcel (~> 0.3.1)
56+
mimemagic (~> 0.3.2)
57+
activesupport (6.1.3)
58+
concurrent-ruby (~> 1.0, >= 1.0.2)
59+
i18n (>= 1.6, < 2)
60+
minitest (>= 5.1)
61+
tzinfo (~> 2.0)
62+
zeitwerk (~> 2.3)
63+
addressable (2.7.0)
64+
public_suffix (>= 2.0.2, < 5.0)
65+
bindex (0.8.1)
66+
bootsnap (1.7.2)
67+
msgpack (~> 1.0)
68+
builder (3.2.4)
69+
byebug (11.1.3)
70+
capybara (3.35.3)
71+
addressable
72+
mini_mime (>= 0.1.3)
73+
nokogiri (~> 1.8)
74+
rack (>= 1.6.0)
75+
rack-test (>= 0.6.3)
76+
regexp_parser (>= 1.5, < 3.0)
77+
xpath (~> 3.2)
78+
childprocess (3.0.0)
79+
concurrent-ruby (1.1.8)
80+
crass (1.0.6)
81+
erubi (1.10.0)
82+
ffi (1.15.0)
83+
globalid (0.4.2)
84+
activesupport (>= 4.2.0)
85+
i18n (1.8.9)
86+
concurrent-ruby (~> 1.0)
87+
jbuilder (2.11.2)
88+
activesupport (>= 5.0.0)
89+
listen (3.4.1)
90+
rb-fsevent (~> 0.10, >= 0.10.3)
91+
rb-inotify (~> 0.9, >= 0.9.10)
92+
loofah (2.9.0)
93+
crass (~> 1.0.2)
94+
nokogiri (>= 1.5.9)
95+
mail (2.7.1)
96+
mini_mime (>= 0.1.1)
97+
marcel (0.3.3)
98+
mimemagic (~> 0.3.2)
99+
method_source (1.0.0)
100+
mimemagic (0.3.5)
101+
mini_mime (1.0.2)
102+
mini_portile2 (2.5.0)
103+
minitest (5.14.4)
104+
msgpack (1.4.2)
105+
nio4r (2.5.7)
106+
nokogiri (1.11.1)
107+
mini_portile2 (~> 2.5.0)
108+
racc (~> 1.4)
109+
public_suffix (4.0.6)
110+
puma (5.2.2)
111+
nio4r (~> 2.0)
112+
racc (1.5.2)
113+
rack (2.2.3)
114+
rack-mini-profiler (2.3.1)
115+
rack (>= 1.2.0)
116+
rack-proxy (0.6.5)
117+
rack
118+
rack-test (1.1.0)
119+
rack (>= 1.0, < 3)
120+
rails (6.1.3)
121+
actioncable (= 6.1.3)
122+
actionmailbox (= 6.1.3)
123+
actionmailer (= 6.1.3)
124+
actionpack (= 6.1.3)
125+
actiontext (= 6.1.3)
126+
actionview (= 6.1.3)
127+
activejob (= 6.1.3)
128+
activemodel (= 6.1.3)
129+
activerecord (= 6.1.3)
130+
activestorage (= 6.1.3)
131+
activesupport (= 6.1.3)
132+
bundler (>= 1.15.0)
133+
railties (= 6.1.3)
134+
sprockets-rails (>= 2.0.0)
135+
rails-dom-testing (2.0.3)
136+
activesupport (>= 4.2.0)
137+
nokogiri (>= 1.6)
138+
rails-html-sanitizer (1.3.0)
139+
loofah (~> 2.3)
140+
railties (6.1.3)
141+
actionpack (= 6.1.3)
142+
activesupport (= 6.1.3)
143+
method_source
144+
rake (>= 0.8.7)
145+
thor (~> 1.0)
146+
rake (13.0.3)
147+
rb-fsevent (0.10.4)
148+
rb-inotify (0.10.1)
149+
ffi (~> 1.0)
150+
regexp_parser (2.1.1)
151+
rubyzip (2.3.0)
152+
sass-rails (6.0.0)
153+
sassc-rails (~> 2.1, >= 2.1.1)
154+
sassc (2.4.0)
155+
ffi (~> 1.9)
156+
sassc-rails (2.1.2)
157+
railties (>= 4.0.0)
158+
sassc (>= 2.0)
159+
sprockets (> 3.0)
160+
sprockets-rails
161+
tilt
162+
selenium-webdriver (3.142.7)
163+
childprocess (>= 0.5, < 4.0)
164+
rubyzip (>= 1.2.2)
165+
semantic_range (3.0.0)
166+
spring (2.1.1)
167+
sprockets (4.0.2)
168+
concurrent-ruby (~> 1.0)
169+
rack (> 1, < 3)
170+
sprockets-rails (3.2.2)
171+
actionpack (>= 4.0)
172+
activesupport (>= 4.0)
173+
sprockets (>= 3.0.0)
174+
sqlite3 (1.4.2)
175+
thor (1.1.0)
176+
tilt (2.0.10)
177+
turbolinks (5.2.1)
178+
turbolinks-source (~> 5.2)
179+
turbolinks-source (5.2.0)
180+
tzinfo (2.0.4)
181+
concurrent-ruby (~> 1.0)
182+
web-console (4.1.0)
183+
actionview (>= 6.0.0)
184+
activemodel (>= 6.0.0)
185+
bindex (>= 0.4.0)
186+
railties (>= 6.0.0)
187+
webdrivers (4.6.0)
188+
nokogiri (~> 1.6)
189+
rubyzip (>= 1.3.0)
190+
selenium-webdriver (>= 3.0, < 4.0)
191+
webpacker (5.2.1)
192+
activesupport (>= 5.2)
193+
rack-proxy (>= 0.6.1)
194+
railties (>= 5.2)
195+
semantic_range (>= 2.3.0)
196+
websocket-driver (0.7.3)
197+
websocket-extensions (>= 0.1.0)
198+
websocket-extensions (0.1.5)
199+
xpath (3.2.0)
200+
nokogiri (~> 1.8)
201+
zeitwerk (2.4.2)
202+
203+
PLATFORMS
204+
ruby
205+
206+
DEPENDENCIES
207+
bootsnap (>= 1.4.4)
208+
byebug
209+
capybara (>= 3.26)
210+
jbuilder (~> 2.7)
211+
listen (~> 3.3)
212+
puma (~> 5.0)
213+
rack-mini-profiler (~> 2.0)
214+
rails (~> 6.1.0)
215+
sass-rails (>= 6)
216+
selenium-webdriver
217+
spring
218+
sqlite3 (~> 1.4)
219+
turbolinks (~> 5)
220+
tzinfo-data
221+
web-console (>= 4.1.0)
222+
webdrivers
223+
webpacker (~> 5.0)
224+
225+
RUBY VERSION
226+
ruby 2.7.0p0
227+
228+
BUNDLED WITH
229+
2.1.2

micro-reddit/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# micro-reddit
2+
3+
A junior version of reddit called micro-reddit with the data structures necessary to support link submissions and commenting.
4+

micro-reddit/Rakefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Add your own tasks in files placed in lib/tasks ending in .rake,
2+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3+
4+
require_relative "config/application"
5+
6+
Rails.application.load_tasks

micro-reddit/app/.DS_Store

8 KB
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
//= link_tree ../images
2+
//= link_directory ../stylesheets .css

micro-reddit/app/assets/images/.keep

Whitespace-only changes.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* This is a manifest file that'll be compiled into application.css, which will include all the files
3+
* listed below.
4+
*
5+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
6+
* vendor/assets/stylesheets directory can be referenced here using a relative path.
7+
*
8+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
9+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10+
* files in this directory. Styles in this file should be added after the last require_* statement.
11+
* It is generally better to create a new file per style scope.
12+
*
13+
*= require_tree .
14+
*= require_self
15+
*/
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module ApplicationCable
2+
class Channel < ActionCable::Channel::Base
3+
end
4+
end
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module ApplicationCable
2+
class Connection < ActionCable::Connection::Base
3+
end
4+
end
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class ApplicationController < ActionController::Base
2+
end

micro-reddit/app/controllers/concerns/.keep

Whitespace-only changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module ApplicationHelper
2+
end
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Action Cable provides the framework to deal with WebSockets in Rails.
2+
// You can generate new channels where WebSocket features live using the `bin/rails generate channel` command.
3+
4+
import { createConsumer } from "@rails/actioncable"
5+
6+
export default createConsumer()
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Load all the channels within this directory and all subdirectories.
2+
// Channel files must be named *_channel.js.
3+
4+
const channels = require.context('.', true, /_channel\.js$/)
5+
channels.keys().forEach(channels)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// This file is automatically compiled by Webpack, along with any other files
2+
// present in this directory. You're encouraged to place your actual application logic in
3+
// a relevant structure within app/javascript and only use these pack files to reference
4+
// that code so it'll be compiled.
5+
6+
import Rails from "@rails/ujs"
7+
import Turbolinks from "turbolinks"
8+
import * as ActiveStorage from "@rails/activestorage"
9+
import "channels"
10+
11+
Rails.start()
12+
Turbolinks.start()
13+
ActiveStorage.start()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class ApplicationJob < ActiveJob::Base
2+
# Automatically retry jobs that encountered a deadlock
3+
# retry_on ActiveRecord::Deadlocked
4+
5+
# Most jobs are safe to ignore if the underlying records are no longer available
6+
# discard_on ActiveJob::DeserializationError
7+
end
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class ApplicationMailer < ActionMailer::Base
2+
default from: 'from@example.com'
3+
layout 'mailer'
4+
end
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class ApplicationRecord < ActiveRecord::Base
2+
self.abstract_class = true
3+
end

micro-reddit/app/models/comment.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Comment < ApplicationRecord
2+
validates :body, :user_id, :post_id, presence: true
3+
4+
belongs_to :user
5+
belongs_to :post
6+
end

micro-reddit/app/models/concerns/.keep

Whitespace-only changes.

micro-reddit/app/models/post.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Post < ApplicationRecord
2+
validates :title, :body, :user_id, presence: true
3+
4+
belongs_to :user
5+
has_many :comments
6+
end

0 commit comments

Comments
 (0)