Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
Datababes
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Royce Matthew Chan
Datababes
Commits
4504f9bf
Commit
4504f9bf
authored
Jul 05, 2016
by
George Nicole Balmaceda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
re-created initial ruby files
parent
6272a01b
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
269 additions
and
235 deletions
+269
-235
.gitignore
parkinglot/.gitignore
+1
-5
Gemfile
parkinglot/Gemfile
+15
-19
Gemfile.lock
parkinglot/Gemfile.lock
+80
-94
README.rdoc
parkinglot/README.rdoc
+28
-0
Rakefile
parkinglot/Rakefile
+1
-1
application.js
parkinglot/app/assets/javascripts/application.js
+2
-2
application.css
parkinglot/app/assets/stylesheets/application.css
+3
-3
application_controller.rb
parkinglot/app/controllers/application_controller.rb
+2
-0
.keep
parkinglot/app/mailers/.keep
+0
-0
.keep
parkinglot/app/models/.keep
+0
-0
application.html.erb
parkinglot/app/views/layouts/application.html.erb
+9
-9
bundle
parkinglot/bin/bundle
+1
-1
rails
parkinglot/bin/rails
+2
-7
rake
parkinglot/bin/rake
+1
-6
setup
parkinglot/bin/setup
+13
-18
config.ru
parkinglot/config.ru
+1
-2
application.rb
parkinglot/config/application.rb
+12
-1
boot.rb
parkinglot/config/boot.rb
+1
-1
environment.rb
parkinglot/config/environment.rb
+1
-1
development.rb
parkinglot/config/environments/development.rb
+11
-24
production.rb
parkinglot/config/environments/production.rb
+17
-24
test.rb
parkinglot/config/environments/test.rb
+6
-6
cookies_serializer.rb
parkinglot/config/initializers/cookies_serializer.rb
+0
-2
wrap_parameters.rb
parkinglot/config/initializers/wrap_parameters.rb
+2
-2
routes.rb
parkinglot/config/routes.rb
+54
-1
secrets.yml
parkinglot/config/secrets.yml
+3
-3
seeds.rb
parkinglot/db/seeds.rb
+3
-3
No files found.
parkinglot/.gitignore
View file @
4504f9bf
...
...
@@ -13,9 +13,5 @@
# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep
# Ignore Byebug command history file.
.byebug_history
/tmp
parkinglot/Gemfile
View file @
4504f9bf
...
...
@@ -2,46 +2,42 @@ source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem
'rails'
,
'
~> 5.0
.0'
gem
'rails'
,
'
4.2
.0'
# Use sqlite3 as the database for Active Record
gem
'sqlite3'
# Use Puma as the app server
gem
'puma'
,
'~> 3.0'
# Use SCSS for stylesheets
gem
'sass-rails'
,
'~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem
'uglifier'
,
'>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem
'coffee-rails'
,
'~> 4.
2
'
# See https://github.com/
rails
/execjs#readme for more supported runtimes
gem
'coffee-rails'
,
'~> 4.
1.0
'
# See https://github.com/
sstephenson
/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem
'jquery-rails'
# Turbolinks makes
navigating your web application faster. Read more: https://github.com/turbolink
s/turbolinks
gem
'turbolinks'
,
'~> 5'
# Turbolinks makes
following links in your web application faster. Read more: https://github.com/rail
s/turbolinks
gem
'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem
'jbuilder'
,
'~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
gem
'jbuilder'
,
'~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem
'sdoc'
,
'~> 0.4.0'
,
group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group
:development
,
:test
do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem
'byebug'
,
platform: :mri
end
gem
'byebug'
group
:development
do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem
'web-console'
gem
'listen'
,
'~> 3.0.5'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem
'spring'
gem
'spring-watcher-listen'
,
'~> 2.0.0'
# Access an IRB console on exception pages or by using <%= console %> in views
gem
'web-console'
,
'~> 2.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
...
...
parkinglot/Gemfile.lock
View file @
4504f9bf
GEM
remote: https://rubygems.org/
specs:
actioncable (5.0.0)
actionpack (= 5.0.0)
nio4r (~> 1.2)
websocket-driver (~> 0.6.1)
actionmailer (5.0.0)
actionpack (= 5.0.0)
actionview (= 5.0.0)
activejob (= 5.0.0)
actionmailer (4.2.0)
actionpack (= 4.2.0)
actionview (= 4.2.0)
activejob (= 4.2.0)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~>
2.0
)
actionpack (
5.0
.0)
actionview (=
5.0
.0)
activesupport (=
5.0
.0)
rack (~>
2
.0)
rack-test (~> 0.6.
3
)
rails-dom-testing (~>
2.0
)
rails-html-sanitizer (~> 1.0, >= 1.0.
2
)
actionview (
5.0
.0)
activesupport (=
5.0
.0)
rails-dom-testing (~>
1.0, >= 1.0.5
)
actionpack (
4.2
.0)
actionview (=
4.2
.0)
activesupport (=
4.2
.0)
rack (~>
1.6
.0)
rack-test (~> 0.6.
2
)
rails-dom-testing (~>
1.0, >= 1.0.5
)
rails-html-sanitizer (~> 1.0, >= 1.0.
1
)
actionview (
4.2
.0)
activesupport (=
4.2
.0)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~>
2.0
)
rails-html-sanitizer (~> 1.0, >= 1.0.
2
)
activejob (
5.0
.0)
activesupport (=
5.0
.0)
globalid (>= 0.3.
6
)
activemodel (
5.0
.0)
activesupport (=
5.0
.0)
activerecord (5.0.0
)
activemodel (= 5.0
.0)
active
support (= 5.0
.0)
a
rel (~> 7
.0)
activesupport (5.0
.0)
concurrent-ruby (~> 1.0, >= 1.0.2
)
rails-dom-testing (~>
1.0, >= 1.0.5
)
rails-html-sanitizer (~> 1.0, >= 1.0.
1
)
activejob (
4.2
.0)
activesupport (=
4.2
.0)
globalid (>= 0.3.
0
)
activemodel (
4.2
.0)
activesupport (=
4.2
.0)
builder (~> 3.1
)
activerecord (4.2
.0)
active
model (= 4.2
.0)
a
ctivesupport (= 4.2
.0)
arel (~> 6
.0)
activesupport (4.2.0
)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
arel (7.0.0)
arel (6.0.3)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
builder (3.2.2)
byebug (9.0.5)
coffee-rails (4.
2
.1)
coffee-rails (4.
1
.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.
2
.x)
railties (>= 4.0.0, < 5.
1
.x)
coffee-script (2.4.1)
coffee-script-source
execjs
...
...
@@ -52,7 +52,6 @@ GEM
debug_inspector (0.0.2)
erubis (2.7.0)
execjs (2.7.0)
ffi (1.9.10)
globalid (0.3.6)
activesupport (>= 4.1.0)
i18n (0.7.0)
...
...
@@ -63,112 +62,99 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
json (1.8.3)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.4)
mime-types (>= 1.16, < 4)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (5.9.0)
multi_json (1.12.1)
nio4r (1.2.1)
nokogiri (1.6.8)
nokogiri (1.6.8-x86-mingw32)
mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7)
pkg-config (1.1.7)
puma (3.4.0)
rack (2.0.1)
rack (1.6.4)
rack-test (0.6.3)
rack (>= 1.0)
rails (5.0.0)
actioncable (= 5.0.0)
actionmailer (= 5.0.0)
actionpack (= 5.0.0)
actionview (= 5.0.0)
activejob (= 5.0.0)
activemodel (= 5.0.0)
activerecord (= 5.0.0)
activesupport (= 5.0.0)
rails (4.2.0)
actionmailer (= 4.2.0)
actionpack (= 4.2.0)
actionview (= 4.2.0)
activejob (= 4.2.0)
activemodel (= 4.2.0)
activerecord (= 4.2.0)
activesupport (= 4.2.0)
bundler (>= 1.3.0, < 2.0)
railties (= 5.0.0)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.1)
activesupport (>= 4.2.0, < 6.0)
railties (= 4.2.0)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.7)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
railties (5.0.0)
actionpack (= 5.0.0)
activesupport (= 5.0.0)
method_source
railties (4.2.0)
actionpack (= 4.2.0)
activesupport (= 4.2.0)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (11.2.2)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
rdoc (4.2.2)
json (~> 1.4)
sass (3.4.22)
sass-rails (5.0.
5
)
railties (>= 4.0.0, <
6
)
sass-rails (5.0.
4
)
railties (>= 4.0.0, <
5.0
)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
spring (1.7.2)
spring-watcher-listen (2.0.0)
listen (>= 2.7, < 4.0)
spring (~> 1.2)
sprockets (3.6.3)
sdoc (0.4.1)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
sprockets (3.6.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.1.1)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.11)
sqlite3 (1.3.11
-x86-mingw32
)
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.5)
turbolinks (5.0.0)
turbolinks-source (~> 5)
turbolinks-source (5.0.0)
turbolinks (2.5.3)
coffee-rails
tzinfo (1.2.2)
thread_safe (~> 0.1)
tzinfo-data (1.2016.5)
tzinfo (>= 1.0.0)
uglifier (3.0.0)
execjs (>= 0.3.0, < 3)
web-console (3.3.0)
activemodel (>= 4.2)
debug_inspector
railties (>= 4.2)
websocket-driver (0.6.4)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
web-console (2.3.0)
activemodel (>= 4.0)
binding_of_caller (>= 0.7.2)
railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0)
PLATFORMS
ruby
x86-mingw32
DEPENDENCIES
byebug
coffee-rails (~> 4.
2
)
jbuilder (~> 2.
5
)
coffee-rails (~> 4.
1.0
)
jbuilder (~> 2.
0
)
jquery-rails
listen (~> 3.0.5)
puma (~> 3.0)
rails (~> 5.0.0)
rails (= 4.2.0)
sass-rails (~> 5.0)
spring
spring-watcher-listen (~> 2.0.0)
sdoc (~> 0.4.0)
sqlite3
turbolinks
(~> 5)
turbolinks
tzinfo-data
uglifier (>= 1.3.0)
web-console
BUNDLED WITH
1.12.5
web-console (~> 2.0)
parkinglot/README.rdoc
0 → 100644
View file @
4504f9bf
== README
This README would normally document whatever steps are necessary to get the
application up and running.
Things you may want to cover:
* Ruby version
* System dependencies
* Configuration
* Database creation
* Database initialization
* How to run the test suite
* Services (job queues, cache servers, search engines, etc.)
* Deployment instructions
* ...
Please feel free to use a different markup language if you do not plan to run
<tt>rake doc:app</tt>.
parkinglot/Rakefile
View file @
4504f9bf
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require
_relative
'config/application'
require
File
.
expand_path
(
'../config/application'
,
__FILE__
)
Rails
.
application
.
load_tasks
parkinglot/app/assets/javascripts/application.js
View file @
4504f9bf
...
...
@@ -5,9 +5,9 @@
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
JavaScript code in this file should be added after the last require_* statement.
// compiled file.
//
// Read Sprockets README (https://github.com/
rails
/sprockets#sprockets-directives) for details
// Read Sprockets README (https://github.com/
sstephenson
/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
...
...
parkinglot/app/assets/stylesheets/application.css
View file @
4504f9bf
...
...
@@ -6,9 +6,9 @@
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any
other CSS/SCSS
*
files in this directory. Styles in this file should be added after the last require_* statement.
*
It is generally better to create a new
file per style scope.
* compiled file so the styles you add here take precedence over styles defined in any
styles
*
defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require_tree .
*= require_self
...
...
parkinglot/app/controllers/application_controller.rb
View file @
4504f9bf
class
ApplicationController
<
ActionController
::
Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery
with: :exception
end
parkinglot/app/mailers/.keep
0 → 100644
View file @
4504f9bf
parkinglot/app/models/.keep
0 → 100644
View file @
4504f9bf
parkinglot/app/views/layouts/application.html.erb
View file @
4504f9bf
<!DOCTYPE html>
<html>
<head>
<title>
Parkinglot
</title>
<%=
csrf_meta_tags
%>
<head>
<title>
Parkinglot
</title>
<%=
stylesheet_link_tag
'application'
,
media:
'all'
,
'data-turbolinks-track'
=>
true
%>
<%=
javascript_include_tag
'application'
,
'data-turbolinks-track'
=>
true
%>
<%=
csrf_meta_tags
%>
</head>
<body>
<%=
stylesheet_link_tag
'application'
,
media:
'all'
,
'data-turbolinks-track'
:
'reload'
%>
<%=
javascript_include_tag
'application'
,
'data-turbolinks-track'
:
'reload'
%>
</head>
<%=
yield
%>
<body>
<%=
yield
%>
</body>
</body>
</html>
parkinglot/bin/bundle
View file @
4504f9bf
#!/usr/bin/env ruby
#!/usr/bin/env ruby
.exe
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
load Gem.bin_path('bundler', 'bundle')
parkinglot/bin/rails
View file @
4504f9bf
#!/usr/bin/env ruby
begin
load
File
.
expand_path
(
'../spring'
,
__FILE__
)
rescue
LoadError
=>
e
raise
unless
e
.
message
.
include?
(
'spring'
)
end
APP_PATH
=
File
.
expand_path
(
'../config/application'
,
__dir__
)
#!/usr/bin/env ruby.exe
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rails/commands'
parkinglot/bin/rake
View file @
4504f9bf
#!/usr/bin/env ruby
begin
load
File
.
expand_path
(
'../spring'
,
__FILE__
)
rescue
LoadError
=>
e
raise
unless
e
.
message
.
include?
(
'spring'
)
end
#!/usr/bin/env ruby.exe
require_relative '../config/boot'
require 'rake'
Rake.application.run
parkinglot/bin/setup
View file @
4504f9bf
#!/usr/bin/env ruby
#!/usr/bin/env ruby
.exe
require 'pathname'
require
'fileutils'
include
FileUtils
# path to your application root.
APP_ROOT
=
Pathname
.
new
File
.
expand_path
(
'../../'
,
__FILE__
)
APP_ROOT = Pathname.new File.expand_path('../../',
__FILE__)
def
system!
(
*
args
)
system
(
*
args
)
||
abort
(
"
\n
== Command
#{
args
}
failed =="
)
end
chdir
APP_ROOT
do
Dir.chdir APP_ROOT do
# This script is a starting point to setup your application.
# Add necessary setup steps to this file
.
# Add necessary setup steps to this file
:
puts
'== Installing dependencies =='
system
!
'gem install bundler --conservative'
system
(
'bundle check'
)
||
system
!
(
'bundle install'
)
puts
"== Installing dependencies =="
system
"gem install bundler --conservative"
system
"bundle check || bundle install"
# puts "\n== Copying sample files =="
# unless File.exist?(
'config/database.yml'
)
#
cp 'config/database.yml.sample', 'config/database.yml'
# unless File.exist?(
"config/database.yml"
)
#
system "cp config/database.yml.sample config/database.yml"
# end
puts "\n== Preparing database =="
system
!
'bin/rails db:setup'
system
"bin/rake db:setup"
puts "\n== Removing old logs and tempfiles =="
system
!
'bin/rails log:clear tmp:clear'
system "rm -f log/*"
system "rm -rf tmp/cache"
puts "\n== Restarting application server =="
system
!
'bin/rails restart'
system
"touch tmp/restart.txt"
end
parkinglot/config.ru
View file @
4504f9bf
# This file is used by Rack-based servers to start the application.
require_relative
'config/environment'
require
::
File
.
expand_path
(
'../config/environment'
,
__FILE__
)
run
Rails
.
application
parkinglot/config/application.rb
View file @
4504f9bf
require
_relative
'boot'
require
File
.
expand_path
(
'../boot'
,
__FILE__
)
require
'rails/all'
...
...
@@ -11,5 +11,16 @@ module Parkinglot
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# Do not swallow errors in after_commit/after_rollback callbacks.
config
.
active_record
.
raise_in_transactional_callbacks
=
true
end
end
parkinglot/config/boot.rb
View file @
4504f9bf
ENV
[
'BUNDLE_GEMFILE'
]
||=
File
.
expand_path
(
'../
Gemfile'
,
__dir
__
)
ENV
[
'BUNDLE_GEMFILE'
]
||=
File
.
expand_path
(
'../
../Gemfile'
,
__FILE
__
)
require
'bundler/setup'
# Set up gems listed in the Gemfile.
parkinglot/config/environment.rb
View file @
4504f9bf
# Load the Rails application.
require
_relative
'application'
require
File
.
expand_path
(
'../application'
,
__FILE__
)
# Initialize the Rails application.
Rails
.
application
.
initialize!
parkinglot/config/environments/development.rb
View file @
4504f9bf
...
...
@@ -9,28 +9,13 @@ Rails.application.configure do
# Do not eager load code on boot.
config
.
eager_load
=
false
# Show full error reports.
config
.
consider_all_requests_local
=
true
# Enable/disable caching. By default caching is disabled.
if
Rails
.
root
.
join
(
'tmp/caching-dev.txt'
).
exist?
config
.
action_controller
.
perform_caching
=
true
config
.
cache_store
=
:memory_store
config
.
public_file_server
.
headers
=
{
'Cache-Control'
=>
'public, max-age=172800'
}
else
config
.
action_controller
.
perform_caching
=
false
config
.
cache_store
=
:null_store
end
# Show full error reports and disable caching.
config
.
consider_all_requests_local
=
true
config
.
action_controller
.
perform_caching
=
false
# Don't care if the mailer can't send.
config
.
action_mailer
.
raise_delivery_errors
=
false
config
.
action_mailer
.
perform_caching
=
false
# Print deprecation notices to the Rails logger.
config
.
active_support
.
deprecation
=
:log
...
...
@@ -42,13 +27,15 @@ Rails.application.configure do
# number of complex assets.
config
.
assets
.
debug
=
true
# Suppress logger output for asset requests.
config
.
assets
.
quiet
=
true
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config
.
assets
.
digest
=
true
# Adds additional error checking when serving assets at runtime.
# Checks for improperly declared sprockets dependencies.
# Raises helpful error messages.
config
.
assets
.
raise_runtime_errors
=
true
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
config
.
file_watcher
=
ActiveSupport
::
EventedFileUpdateChecker
end
parkinglot/config/environments/production.rb
View file @
4504f9bf
...
...
@@ -14,9 +14,15 @@ Rails.application.configure do
config
.
consider_all_requests_local
=
false
config
.
action_controller
.
perform_caching
=
true
# Enable Rack::Cache to put a simple HTTP cache in front of your application
# Add `rack-cache` to your Gemfile before enabling this.
# For large-scale production use, consider using a caching reverse proxy like
# NGINX, varnish or squid.
# config.action_dispatch.rack_cache = true
# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config
.
public_file_server
.
enabled
=
ENV
[
'RAILS_SERVE_STATIC_FILES'
].
present?
config
.
serve_static_files
=
ENV
[
'RAILS_SERVE_STATIC_FILES'
].
present?
# Compress JavaScripts and CSS.
config
.
assets
.
js_compressor
=
:uglifier
...
...
@@ -25,20 +31,16 @@ Rails.application.configure do
# Do not fallback to assets pipeline if a precompiled asset is missed.
config
.
assets
.
compile
=
false
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config
.
assets
.
digest
=
true
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
# Mount Action Cable outside main process or domain
# config.action_cable.mount_path = nil
# config.action_cable.url = 'wss://example.com/cable'
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
...
...
@@ -47,15 +49,16 @@ Rails.application.configure do
config
.
log_level
=
:debug
# Prepend all log lines with the following tags.
config
.
log_tags
=
[
:request_id
]
# config.log_tags = [ :subdomain, :uuid ]
# Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
# Use a real queuing backend for Active Job (and separate queues per environment)
# config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "parkinglot_#{Rails.env}"
config
.
action_mailer
.
perform_caching
=
false
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
...
...
@@ -71,16 +74,6 @@ Rails.application.configure do
# Use default logging formatter so that PID and timestamp are not suppressed.
config
.
log_formatter
=
::
Logger
::
Formatter
.
new
# Use a different logger for distributed setups.
# require 'syslog/logger'
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
if
ENV
[
"RAILS_LOG_TO_STDOUT"
].
present?
logger
=
ActiveSupport
::
Logger
.
new
(
STDOUT
)
logger
.
formatter
=
config
.
log_formatter
config
.
logger
=
ActiveSupport
::
TaggedLogging
.
new
(
logger
)
end
# Do not dump schema after migrations.
config
.
active_record
.
dump_schema_after_migration
=
false
end
parkinglot/config/environments/test.rb
View file @
4504f9bf
...
...
@@ -12,11 +12,9 @@ Rails.application.configure do
# preloads Rails for running tests, you may have to set it to true.
config
.
eager_load
=
false
# Configure public file server for tests with Cache-Control for performance.
config
.
public_file_server
.
enabled
=
true
config
.
public_file_server
.
headers
=
{
'Cache-Control'
=>
'public, max-age=3600'
}
# Configure static file server for tests with Cache-Control for performance.
config
.
serve_static_files
=
true
config
.
static_cache_control
=
'public, max-age=3600'
# Show full error reports and disable caching.
config
.
consider_all_requests_local
=
true
...
...
@@ -27,13 +25,15 @@ Rails.application.configure do
# Disable request forgery protection in test environment.
config
.
action_controller
.
allow_forgery_protection
=
false
config
.
action_mailer
.
perform_caching
=
false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config
.
action_mailer
.
delivery_method
=
:test
# Randomize the order test cases are executed.
config
.
active_support
.
test_order
=
:random
# Print deprecation notices to the stderr.
config
.
active_support
.
deprecation
=
:stderr
...
...
parkinglot/config/initializers/cookies_serializer.rb
View file @
4504f9bf
# Be sure to restart your server when you modify this file.
# Specify a serializer for the signed and encrypted cookie jars.
# Valid options are :json, :marshal, and :hybrid.
Rails
.
application
.
config
.
action_dispatch
.
cookies_serializer
=
:json
parkinglot/config/initializers/wrap_parameters.rb
View file @
4504f9bf
...
...
@@ -5,10 +5,10 @@
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport
.
on_load
(
:action_controller
)
do
wrap_parameters
format:
[
:json
]
wrap_parameters
format:
[
:json
]
if
respond_to?
(
:wrap_parameters
)
end
# To enable root element in JSON for ActiveRecord objects.
# ActiveSupport.on_load(:active_record) do
#
self.include_root_in_json = true
# self.include_root_in_json = true
# end
parkinglot/config/routes.rb
View file @
4504f9bf
Rails
.
application
.
routes
.
draw
do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
# You can have the root of your site routed with "root"
# root 'welcome#index'
# Example of regular route:
# get 'products/:id' => 'catalog#view'
# Example of named route that can be invoked with purchase_url(id: product.id)
# get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
# Example resource route (maps HTTP verbs to controller actions automatically):
# resources :products
# Example resource route with options:
# resources :products do
# member do
# get 'short'
# post 'toggle'
# end
#
# collection do
# get 'sold'
# end
# end
# Example resource route with sub-resources:
# resources :products do
# resources :comments, :sales
# resource :seller
# end
# Example resource route with more complex sub-resources:
# resources :products do
# resources :comments
# resources :sales do
# get 'recent', on: :collection
# end
# end
# Example resource route with concerns:
# concern :toggleable do
# post 'toggle'
# end
# resources :posts, concerns: :toggleable
# resources :photos, concerns: :toggleable
# Example resource route within a namespace:
# namespace :admin do
# # Directs /admin/products/* to Admin::ProductsController
# # (app/controllers/admin/products_controller.rb)
# resources :products
# end
end
parkinglot/config/secrets.yml
View file @
4504f9bf
...
...
@@ -5,16 +5,16 @@
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
# You can use `ra
ils
secret` to generate a secure secret key.
# You can use `ra
ke
secret` to generate a secure secret key.
# Make sure the secrets in this file are kept private
# if you're sharing your code publicly.
development
:
secret_key_base
:
15c868e40d33b41e52b5d5f7daf42a4f58ddf0e6d9e189f879d901c9ce818a3db63360635b25361d3be2cd9d3f46d3f1620fc4daea7ac21b80da5c8eb99af921
secret_key_base
:
6af929f14c9f4cfe1fa979bfd1b01adc8c6068a047258c78f538c64619ef6bd650fdf5cee65adf1d464bd019e47885a8d7348b7cd5f69ca6b63cdbe9d266a708
test
:
secret_key_base
:
944d232bac9a1d3bf8e076e443f037e107df923ff34da2620f32a0cbc5839cb4be0bcf44e9ba62261eb9bd675741a51ca3532f25fab4ff08862c194c73b6bfc2
secret_key_base
:
7bc9ef09f4a0a020654f6ad4f66102e7a7250151132ac5f19cf986a2d0e4565ba4fe6cf1bd14d1903ac34d428b2a84448313debfd3e1fa8f155cc5c2db8cd903
# Do not keep production secrets in the repository,
# instead read values from the environment.
...
...
parkinglot/db/seeds.rb
View file @
4504f9bf
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the ra
ils db:seed command (or created alongside the database
with db:setup).
# The data can then be loaded with the ra
ke db:seed (or created alongside the db
with db:setup).
#
# Examples:
#
#
movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings
' }])
#
Character.create(name: 'Luke', movie: mov
ies.first)
#
cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen
' }])
#
Mayor.create(name: 'Emanuel', city: cit
ies.first)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment