Skip to content

Commit 926ad51

Browse files
committed
Initial commit: Rails base
0 parents  commit 926ad51

Some content is hidden

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

78 files changed

+1015
-0
lines changed

.gitignore

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
2+
#
3+
# If you find yourself ignoring temporary files generated by your text editor
4+
# or operating system, you probably want to add a global ignore instead:
5+
# git config --global core.excludesfile '~/.gitignore_global'
6+
7+
# Ignore bundler config.
8+
/.bundle
9+
10+
# Ignore the default SQLite database.
11+
/db/*.sqlite3
12+
/db/*.sqlite3-journal
13+
14+
# Ignore all logfiles and tempfiles.
15+
/log/*
16+
/tmp/*
17+
!/log/.keep
18+
!/tmp/.keep
19+
20+
# Ignore uploaded files in development
21+
/storage/*
22+
!/storage/.keep
23+
24+
/node_modules
25+
/yarn-error.log
26+
27+
/public/assets
28+
.byebug_history
29+
30+
# Ignore master key for decrypting credentials and more.
31+
/config/master.key

.ruby-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.3.1

Gemfile

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
source 'https://rubygems.org'
2+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3+
4+
ruby '2.3.1'
5+
6+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
7+
gem 'rails', '~> 5.2.2', '>= 5.2.2.1'
8+
# Use sqlite3 as the database for Active Record
9+
gem 'sqlite3'
10+
# Use Puma as the app server
11+
gem 'puma', '~> 3.11'
12+
# Use SCSS for stylesheets
13+
gem 'sass-rails', '~> 5.0'
14+
# Use Uglifier as compressor for JavaScript assets
15+
gem 'uglifier', '>= 1.3.0'
16+
# See https://github.com/rails/execjs#readme for more supported runtimes
17+
# gem 'mini_racer', platforms: :ruby
18+
19+
# Use CoffeeScript for .coffee assets and views
20+
gem 'coffee-rails', '~> 4.2'
21+
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
22+
gem 'turbolinks', '~> 5'
23+
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
24+
gem 'jbuilder', '~> 2.5'
25+
# Use Redis adapter to run Action Cable in production
26+
# gem 'redis', '~> 4.0'
27+
# Use ActiveModel has_secure_password
28+
# gem 'bcrypt', '~> 3.1.7'
29+
30+
# Use ActiveStorage variant
31+
# gem 'mini_magick', '~> 4.8'
32+
33+
# Use Capistrano for deployment
34+
# gem 'capistrano-rails', group: :development
35+
36+
# Reduces boot times through caching; required in config/boot.rb
37+
gem 'bootsnap', '>= 1.1.0', require: false
38+
39+
group :development, :test do
40+
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
41+
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
42+
end
43+
44+
group :development do
45+
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
46+
gem 'web-console', '>= 3.3.0'
47+
gem 'listen', '>= 3.0.5', '< 3.2'
48+
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
49+
gem 'spring'
50+
gem 'spring-watcher-listen', '~> 2.0.0'
51+
end
52+
53+
group :test do
54+
# Adds support for Capybara system testing and selenium driver
55+
gem 'capybara', '>= 2.15'
56+
gem 'selenium-webdriver'
57+
# Easy installation and use of chromedriver to run system tests with Chrome
58+
gem 'chromedriver-helper'
59+
end
60+
61+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
62+
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# README
2+
3+
This README would normally document whatever steps are necessary to get the
4+
application up and running.
5+
6+
Things you may want to cover:
7+
8+
* Ruby version
9+
10+
* System dependencies
11+
12+
* Configuration
13+
14+
* Database creation
15+
16+
* Database initialization
17+
18+
* How to run the test suite
19+
20+
* Services (job queues, cache servers, search engines, etc.)
21+
22+
* Deployment instructions
23+
24+
* ...

Rakefile

+6
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

app/assets/config/manifest.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//= link_tree ../images
2+
//= link_directory ../javascripts .js
3+
//= link_directory ../stylesheets .css

app/assets/images/.keep

Whitespace-only changes.

app/assets/javascripts/application.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This is a manifest file that'll be compiled into application.js, which will include all the files
2+
// listed below.
3+
//
4+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's
5+
// vendor/assets/javascripts directory can be referenced here using a relative path.
6+
//
7+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
9+
//
10+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11+
// about supported directives.
12+
//
13+
//= require rails-ujs
14+
//= require activestorage
15+
//= require turbolinks
16+
//= require_tree .

app/assets/javascripts/cable.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Action Cable provides the framework to deal with WebSockets in Rails.
2+
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
3+
//
4+
//= require action_cable
5+
//= require_self
6+
//= require_tree ./channels
7+
8+
(function() {
9+
this.App || (this.App = {});
10+
11+
App.cable = ActionCable.createConsumer();
12+
13+
}).call(this);

app/assets/javascripts/channels/.keep

Whitespace-only changes.
+15
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+
*/
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
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class ApplicationController < ActionController::Base
2+
end

app/controllers/concerns/.keep

Whitespace-only changes.

app/helpers/application_helper.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module ApplicationHelper
2+
end

app/jobs/application_job.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class ApplicationJob < ActiveJob::Base
2+
end

app/mailers/application_mailer.rb

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class ApplicationMailer < ActionMailer::Base
2+
default from: '[email protected]'
3+
layout 'mailer'
4+
end

app/models/application_record.rb

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class ApplicationRecord < ActiveRecord::Base
2+
self.abstract_class = true
3+
end

app/models/concerns/.keep

Whitespace-only changes.
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>BlankGitPod</title>
5+
<%= csrf_meta_tags %>
6+
<%= csp_meta_tag %>
7+
8+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
9+
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
10+
</head>
11+
12+
<body>
13+
<%= yield %>
14+
</body>
15+
</html>

app/views/layouts/mailer.html.erb

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5+
<style>
6+
/* Email styles need to be inline */
7+
</style>
8+
</head>
9+
10+
<body>
11+
<%= yield %>
12+
</body>
13+
</html>

app/views/layouts/mailer.text.erb

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%= yield %>

bin/bundle

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env ruby
2+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
3+
load Gem.bin_path('bundler', 'bundle')

bin/rails

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env ruby
2+
APP_PATH = File.expand_path('../config/application', __dir__)
3+
require_relative '../config/boot'
4+
require 'rails/commands'

bin/rake

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env ruby
2+
require_relative '../config/boot'
3+
require 'rake'
4+
Rake.application.run

bin/setup

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env ruby
2+
require 'fileutils'
3+
include FileUtils
4+
5+
# path to your application root.
6+
APP_ROOT = File.expand_path('..', __dir__)
7+
8+
def system!(*args)
9+
system(*args) || abort("\n== Command #{args} failed ==")
10+
end
11+
12+
chdir APP_ROOT do
13+
# This script is a starting point to setup your application.
14+
# Add necessary setup steps to this file.
15+
16+
puts '== Installing dependencies =='
17+
system! 'gem install bundler --conservative'
18+
system('bundle check') || system!('bundle install')
19+
20+
# Install JavaScript dependencies if using Yarn
21+
# system('bin/yarn')
22+
23+
# puts "\n== Copying sample files =="
24+
# unless File.exist?('config/database.yml')
25+
# cp 'config/database.yml.sample', 'config/database.yml'
26+
# end
27+
28+
puts "\n== Preparing database =="
29+
system! 'bin/rails db:setup'
30+
31+
puts "\n== Removing old logs and tempfiles =="
32+
system! 'bin/rails log:clear tmp:clear'
33+
34+
puts "\n== Restarting application server =="
35+
system! 'bin/rails restart'
36+
end

bin/update

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env ruby
2+
require 'fileutils'
3+
include FileUtils
4+
5+
# path to your application root.
6+
APP_ROOT = File.expand_path('..', __dir__)
7+
8+
def system!(*args)
9+
system(*args) || abort("\n== Command #{args} failed ==")
10+
end
11+
12+
chdir APP_ROOT do
13+
# This script is a way to update your development environment automatically.
14+
# Add necessary update steps to this file.
15+
16+
puts '== Installing dependencies =='
17+
system! 'gem install bundler --conservative'
18+
system('bundle check') || system!('bundle install')
19+
20+
# Install JavaScript dependencies if using Yarn
21+
# system('bin/yarn')
22+
23+
puts "\n== Updating database =="
24+
system! 'bin/rails db:migrate'
25+
26+
puts "\n== Removing old logs and tempfiles =="
27+
system! 'bin/rails log:clear tmp:clear'
28+
29+
puts "\n== Restarting application server =="
30+
system! 'bin/rails restart'
31+
end

bin/yarn

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env ruby
2+
APP_ROOT = File.expand_path('..', __dir__)
3+
Dir.chdir(APP_ROOT) do
4+
begin
5+
exec "yarnpkg", *ARGV
6+
rescue Errno::ENOENT
7+
$stderr.puts "Yarn executable was not detected in the system."
8+
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
9+
exit 1
10+
end
11+
end

config.ru

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# This file is used by Rack-based servers to start the application.
2+
3+
require_relative 'config/environment'
4+
5+
run Rails.application

config/application.rb

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
require_relative 'boot'
2+
3+
require 'rails/all'
4+
5+
# Require the gems listed in Gemfile, including any gems
6+
# you've limited to :test, :development, or :production.
7+
Bundler.require(*Rails.groups)
8+
9+
module BlankGitPod
10+
class Application < Rails::Application
11+
# Initialize configuration defaults for originally generated Rails version.
12+
config.load_defaults 5.2
13+
14+
# Settings in config/environments/* take precedence over those specified here.
15+
# Application configuration can go into files in config/initializers
16+
# -- all .rb files in that directory are automatically loaded after loading
17+
# the framework and any gems in your application.
18+
end
19+
end

config/boot.rb

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
2+
3+
require 'bundler/setup' # Set up gems listed in the Gemfile.
4+
require 'bootsnap/setup' # Speed up boot time by caching expensive operations.

config/cable.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
development:
2+
adapter: async
3+
4+
test:
5+
adapter: async
6+
7+
production:
8+
adapter: redis
9+
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10+
channel_prefix: BlankGitPod_production

config/credentials.yml.enc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
KVxvVuzZJLYrv+S5lW7flttNly/eAUmaa1h2AvOYTx3IZs8+iJXrJSS/OhZ8FotDGbzS2+U2LQNvSRmaWWEiQ3CHAnKARSvSVOxoFCfSzD3Ykt0a+tZOJH41w6wbHxd4jAgULfpzUYBG+vn/ego+9Q4fOP7Sn/U3oop3ij0zqB55HiMw60qNZ3fqjJPPGlbEWWUW1mHclGmeI5qDFCJ6aew3euUwSLnyYahQiiHoxElokFsIjCwH2ELmEjWyjtAlyY/Z6LV+B8Rlc+Hx/dBz+yBxCVy+tXvULdr5paAXUw3QjKKpwiBzg9NsHGij8FvXDeY+yGuT/i8j0zO3I3lurudxAYeGtXIBn/p4wHjPVVix8+lKz49CZZ9Ru5fkHfcISqGQuXPzfvNdlYgH0KeCqy3YK4rMxELerPwU--uJu5gUMUh81Bj1wU--k/4t/Diw3uOoab0ZFQ1ZsQ==

0 commit comments

Comments
 (0)