Skip to content

Commit bdad045

Browse files
committed
generate new rails app
$ rails new . --skip-yarn --skip-action-mailer --skip-action-cable --skip-sprockets --skip-listen --skip-coffee --skip-javascript --skip-turbolinks --skip-system-test --api
1 parent 7fa38c5 commit bdad045

Some content is hidden

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

47 files changed

+729
-0
lines changed

Diff for: .gitignore

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
.byebug_history

Diff for: Gemfile

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
source 'https://rubygems.org'
2+
3+
git_source(:github) do |repo_name|
4+
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
5+
"https://github.com/#{repo_name}.git"
6+
end
7+
8+
9+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
10+
gem 'rails', '~> 5.1.1'
11+
# Use sqlite3 as the database for Active Record
12+
gem 'sqlite3'
13+
# Use Puma as the app server
14+
gem 'puma', '~> 3.7'
15+
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
16+
# gem 'jbuilder', '~> 2.5'
17+
# Use ActiveModel has_secure_password
18+
# gem 'bcrypt', '~> 3.1.7'
19+
20+
# Use Capistrano for deployment
21+
# gem 'capistrano-rails', group: :development
22+
23+
# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
24+
# gem 'rack-cors'
25+
26+
group :development, :test do
27+
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
28+
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
29+
end
30+
31+
group :development do
32+
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
33+
gem 'spring'
34+
end
35+
36+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
37+
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Diff for: Gemfile.lock

+120
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
actioncable (5.1.1)
5+
actionpack (= 5.1.1)
6+
nio4r (~> 2.0)
7+
websocket-driver (~> 0.6.1)
8+
actionmailer (5.1.1)
9+
actionpack (= 5.1.1)
10+
actionview (= 5.1.1)
11+
activejob (= 5.1.1)
12+
mail (~> 2.5, >= 2.5.4)
13+
rails-dom-testing (~> 2.0)
14+
actionpack (5.1.1)
15+
actionview (= 5.1.1)
16+
activesupport (= 5.1.1)
17+
rack (~> 2.0)
18+
rack-test (~> 0.6.3)
19+
rails-dom-testing (~> 2.0)
20+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
21+
actionview (5.1.1)
22+
activesupport (= 5.1.1)
23+
builder (~> 3.1)
24+
erubi (~> 1.4)
25+
rails-dom-testing (~> 2.0)
26+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
27+
activejob (5.1.1)
28+
activesupport (= 5.1.1)
29+
globalid (>= 0.3.6)
30+
activemodel (5.1.1)
31+
activesupport (= 5.1.1)
32+
activerecord (5.1.1)
33+
activemodel (= 5.1.1)
34+
activesupport (= 5.1.1)
35+
arel (~> 8.0)
36+
activesupport (5.1.1)
37+
concurrent-ruby (~> 1.0, >= 1.0.2)
38+
i18n (~> 0.7)
39+
minitest (~> 5.1)
40+
tzinfo (~> 1.1)
41+
arel (8.0.0)
42+
builder (3.2.3)
43+
byebug (9.0.6)
44+
concurrent-ruby (1.0.5)
45+
erubi (1.6.0)
46+
globalid (0.4.0)
47+
activesupport (>= 4.2.0)
48+
i18n (0.8.4)
49+
loofah (2.0.3)
50+
nokogiri (>= 1.5.9)
51+
mail (2.6.5)
52+
mime-types (>= 1.16, < 4)
53+
method_source (0.8.2)
54+
mime-types (3.1)
55+
mime-types-data (~> 3.2015)
56+
mime-types-data (3.2016.0521)
57+
mini_portile2 (2.1.0)
58+
minitest (5.10.2)
59+
nio4r (2.1.0)
60+
nokogiri (1.7.2)
61+
mini_portile2 (~> 2.1.0)
62+
puma (3.8.2)
63+
rack (2.0.3)
64+
rack-test (0.6.3)
65+
rack (>= 1.0)
66+
rails (5.1.1)
67+
actioncable (= 5.1.1)
68+
actionmailer (= 5.1.1)
69+
actionpack (= 5.1.1)
70+
actionview (= 5.1.1)
71+
activejob (= 5.1.1)
72+
activemodel (= 5.1.1)
73+
activerecord (= 5.1.1)
74+
activesupport (= 5.1.1)
75+
bundler (>= 1.3.0, < 2.0)
76+
railties (= 5.1.1)
77+
sprockets-rails (>= 2.0.0)
78+
rails-dom-testing (2.0.3)
79+
activesupport (>= 4.2.0)
80+
nokogiri (>= 1.6)
81+
rails-html-sanitizer (1.0.3)
82+
loofah (~> 2.0)
83+
railties (5.1.1)
84+
actionpack (= 5.1.1)
85+
activesupport (= 5.1.1)
86+
method_source
87+
rake (>= 0.8.7)
88+
thor (>= 0.18.1, < 2.0)
89+
rake (12.0.0)
90+
spring (2.0.2)
91+
activesupport (>= 4.2)
92+
sprockets (3.7.1)
93+
concurrent-ruby (~> 1.0)
94+
rack (> 1, < 3)
95+
sprockets-rails (3.2.0)
96+
actionpack (>= 4.0)
97+
activesupport (>= 4.0)
98+
sprockets (>= 3.0.0)
99+
sqlite3 (1.3.13)
100+
thor (0.19.4)
101+
thread_safe (0.3.6)
102+
tzinfo (1.2.3)
103+
thread_safe (~> 0.1)
104+
websocket-driver (0.6.5)
105+
websocket-extensions (>= 0.1.0)
106+
websocket-extensions (0.1.2)
107+
108+
PLATFORMS
109+
ruby
110+
111+
DEPENDENCIES
112+
byebug
113+
puma (~> 3.7)
114+
rails (~> 5.1.1)
115+
spring
116+
sqlite3
117+
tzinfo-data
118+
119+
BUNDLED WITH
120+
1.15.0

Diff for: 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

Diff for: app/controllers/application_controller.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class ApplicationController < ActionController::API
2+
end

Diff for: app/controllers/concerns/.keep

Whitespace-only changes.

Diff for: 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

Diff for: 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

Diff for: app/models/concerns/.keep

Whitespace-only changes.

Diff for: 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', __FILE__)
3+
load Gem.bin_path('bundler', 'bundle')

Diff for: bin/rails

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env ruby
2+
begin
3+
load File.expand_path('../spring', __FILE__)
4+
rescue LoadError => e
5+
raise unless e.message.include?('spring')
6+
end
7+
APP_PATH = File.expand_path('../config/application', __dir__)
8+
require_relative '../config/boot'
9+
require 'rails/commands'

Diff for: bin/rake

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env ruby
2+
begin
3+
load File.expand_path('../spring', __FILE__)
4+
rescue LoadError => e
5+
raise unless e.message.include?('spring')
6+
end
7+
require_relative '../config/boot'
8+
require 'rake'
9+
Rake.application.run

Diff for: bin/setup

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

Diff for: bin/spring

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env ruby
2+
3+
# This file loads spring without using Bundler, in order to be fast.
4+
# It gets overwritten when you run the `spring binstub` command.
5+
6+
unless defined?(Spring)
7+
require 'rubygems'
8+
require 'bundler'
9+
10+
lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
11+
spring = lockfile.specs.detect { |spec| spec.name == "spring" }
12+
if spring
13+
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
14+
gem 'spring', spring.version
15+
require 'spring/binstub'
16+
end
17+
end

Diff for: bin/update

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

Diff for: 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

Diff for: config/application.rb

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
require_relative 'boot'
2+
3+
require "rails"
4+
# Pick the frameworks you want:
5+
require "active_model/railtie"
6+
require "active_job/railtie"
7+
require "active_record/railtie"
8+
require "action_controller/railtie"
9+
# require "action_mailer/railtie"
10+
require "action_view/railtie"
11+
# require "action_cable/engine"
12+
# require "sprockets/railtie"
13+
require "rails/test_unit/railtie"
14+
15+
# Require the gems listed in Gemfile, including any gems
16+
# you've limited to :test, :development, or :production.
17+
Bundler.require(*Rails.groups)
18+
19+
module Zync
20+
class Application < Rails::Application
21+
# Initialize configuration defaults for originally generated Rails version.
22+
config.load_defaults 5.1
23+
24+
# Settings in config/environments/* take precedence over those specified here.
25+
# Application configuration should go into files in config/initializers
26+
# -- all .rb files in that directory are automatically loaded.
27+
28+
# Only loads a smaller set of middleware suitable for API only apps.
29+
# Middleware like session, flash, cookies can be added back manually.
30+
# Skip views, helpers and assets when generating a new resource.
31+
config.api_only = true
32+
end
33+
end

Diff for: config/boot.rb

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

Diff for: config/database.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# SQLite version 3.x
2+
# gem install sqlite3
3+
#
4+
# Ensure the SQLite 3 gem is defined in your Gemfile
5+
# gem 'sqlite3'
6+
#
7+
default: &default
8+
adapter: sqlite3
9+
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10+
timeout: 5000
11+
12+
development:
13+
<<: *default
14+
database: db/development.sqlite3
15+
16+
# Warning: The database defined as "test" will be erased and
17+
# re-generated from your development database when you run "rake".
18+
# Do not set this db to the same as development or production.
19+
test:
20+
<<: *default
21+
database: db/test.sqlite3
22+
23+
production:
24+
<<: *default
25+
database: db/production.sqlite3

Diff for: config/environment.rb

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Load the Rails application.
2+
require_relative 'application'
3+
4+
# Initialize the Rails application.
5+
Rails.application.initialize!

0 commit comments

Comments
 (0)