stack up & tweaked
This commit is contained in:
parent
ef47334853
commit
0fc8ec99b3
49
.rubocop.yml
Normal file
49
.rubocop.yml
Normal file
@ -0,0 +1,49 @@
|
||||
AllCops:
|
||||
Exclude:
|
||||
- db/schema.rb
|
||||
- db/seeds.rb
|
||||
- bin/**/*
|
||||
|
||||
Style/ClassAndModuleChildren:
|
||||
Exclude:
|
||||
- test/test_helper.rb
|
||||
|
||||
Style/Documentation:
|
||||
Enabled: false
|
||||
|
||||
Style/EmptyLines:
|
||||
Exclude:
|
||||
- config/initializers/sorcery.rb
|
||||
|
||||
Style/ExtraSpacing:
|
||||
Exclude:
|
||||
- db/migrate/**/*
|
||||
|
||||
Style/IndentationConsistency:
|
||||
EnforcedStyle: rails
|
||||
|
||||
Style/MethodDefParentheses:
|
||||
Enabled: false
|
||||
|
||||
Style/SpaceBeforeFirstArg:
|
||||
Exclude:
|
||||
- config/routes.rb
|
||||
|
||||
Style/StringLiterals:
|
||||
Enabled: false
|
||||
|
||||
Metrics/AbcSize:
|
||||
Exclude:
|
||||
- db/migrate/**/*
|
||||
|
||||
Metrics/LineLength:
|
||||
Max: 110
|
||||
Exclude:
|
||||
- Rakefile
|
||||
- config/**/*
|
||||
- lib/tasks/**/*
|
||||
- test/test_helper.rb
|
||||
|
||||
Metrics/MethodLength:
|
||||
Exclude:
|
||||
- db/migrate/*
|
11
.scss-lint.yml
Normal file
11
.scss-lint.yml
Normal file
@ -0,0 +1,11 @@
|
||||
scss_files: 'app/assets/stylesheets/**/*.scss'
|
||||
|
||||
linters:
|
||||
StringQuotes:
|
||||
enabled: false
|
||||
LeadingZero:
|
||||
style: 'include_zero'
|
||||
SelectorFormat:
|
||||
ignored_names:
|
||||
QualifyingElement:
|
||||
allow_element_with_attribute: true
|
@ -10,6 +10,7 @@ ENV BUILD_PACKAGES="build-essential libmysqlclient-dev openssl graphviz nodejs c
|
||||
RUN apt-get update \
|
||||
&& apt-get install --fix-missing -y $BUILD_PACKAGES \
|
||||
&& /usr/sbin/mysqld --initialize --user=mysql \
|
||||
&& service mysql start \
|
||||
&& echo 'gem: --no-document' >> ~/.gemrc \
|
||||
&& cp ~/.gemrc /etc/gemrc \
|
||||
&& chmod uog+r /etc/gemrc \
|
||||
@ -33,7 +34,7 @@ RUN cd /root \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
EXPOSE 3000 3306
|
||||
EXPOSE 3000 3306 35729
|
||||
WORKDIR /usr/app
|
||||
CMD ["mysqld"]
|
||||
|
||||
|
19
Gemfile
19
Gemfile
@ -5,15 +5,21 @@ gem 'bcrypt', '~> 3.1.7'
|
||||
gem 'mysql2', '>= 0.3.18', '< 0.5'
|
||||
gem 'rails', '~> 5.0.0'
|
||||
|
||||
gem 'autoprefixer-rails'
|
||||
gem 'jbuilder', '~> 2.5'
|
||||
# gem 'autoprefixer-rails'
|
||||
gem 'jbuilder', '~> 2.6'
|
||||
gem 'jquery-rails'
|
||||
gem 'json', '~> 2.0.1'
|
||||
gem 'json', '~> 2.0.2'
|
||||
gem 'puma', '~> 3.0'
|
||||
gem 'sass-rails', '~> 5.0'
|
||||
gem 'turbolinks', '~> 5'
|
||||
gem 'uglifier', '>= 1.3.0'
|
||||
|
||||
group :development do
|
||||
gem 'rack-livereload'
|
||||
gem 'rails-erd'
|
||||
gem 'web-console'
|
||||
end
|
||||
|
||||
group :development, :test do
|
||||
gem 'awesome_print'
|
||||
gem 'binding_of_caller'
|
||||
@ -23,16 +29,13 @@ group :development, :test do
|
||||
gem 'guard-minitest'
|
||||
gem 'guard-rubocop'
|
||||
gem 'guard-shell'
|
||||
gem 'listen', '~> 3.0.5'
|
||||
gem 'listen', '~> 3.0'
|
||||
gem 'minitest-reporters'
|
||||
gem 'pry-byebug'
|
||||
gem 'pry-rails'
|
||||
gem 'rack-livereload'
|
||||
gem 'rails-erd'
|
||||
gem 'rubocop'
|
||||
gem 'rubocop', '~> 0.42.0'
|
||||
gem 'spring'
|
||||
gem 'spring-watcher-listen', '~> 2.0.0'
|
||||
gem 'web-console'
|
||||
end
|
||||
|
||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
|
29
Gemfile.lock
29
Gemfile.lock
@ -39,10 +39,8 @@ GEM
|
||||
minitest (~> 5.1)
|
||||
tzinfo (~> 1.1)
|
||||
ansi (1.5.0)
|
||||
arel (7.0.0)
|
||||
arel (7.1.0)
|
||||
ast (2.3.0)
|
||||
autoprefixer-rails (6.3.7)
|
||||
execjs
|
||||
awesome_print (1.7.0)
|
||||
bcrypt (3.1.11)
|
||||
binding_of_caller (0.7.2)
|
||||
@ -91,17 +89,18 @@ GEM
|
||||
guard-compat (~> 1.0)
|
||||
http_parser.rb (0.6.0)
|
||||
i18n (0.7.0)
|
||||
jbuilder (2.5.0)
|
||||
jbuilder (2.6.0)
|
||||
activesupport (>= 3.0.0, < 5.1)
|
||||
multi_json (~> 1.2)
|
||||
jquery-rails (4.1.1)
|
||||
rails-dom-testing (>= 1, < 3)
|
||||
railties (>= 4.2.0)
|
||||
thor (>= 0.14, < 2.0)
|
||||
json (2.0.1)
|
||||
listen (3.0.8)
|
||||
json (2.0.2)
|
||||
listen (3.1.5)
|
||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||
rb-inotify (~> 0.9, >= 0.9.7)
|
||||
ruby_dep (~> 1.2)
|
||||
loofah (2.0.3)
|
||||
nokogiri (>= 1.5.9)
|
||||
lumberjack (1.0.10)
|
||||
@ -141,7 +140,7 @@ GEM
|
||||
pry (~> 0.10)
|
||||
pry-rails (0.3.4)
|
||||
pry (>= 0.9.10)
|
||||
puma (3.4.0)
|
||||
puma (3.6.0)
|
||||
rack (2.0.1)
|
||||
rack-livereload (0.3.16)
|
||||
rack
|
||||
@ -180,7 +179,7 @@ GEM
|
||||
rb-fsevent (0.9.7)
|
||||
rb-inotify (0.9.7)
|
||||
ffi (>= 0.5.0)
|
||||
rubocop (0.41.2)
|
||||
rubocop (0.42.0)
|
||||
parser (>= 2.3.1.1, < 3.0)
|
||||
powerpack (~> 0.1)
|
||||
rainbow (>= 1.99.1, < 3.0)
|
||||
@ -188,8 +187,9 @@ GEM
|
||||
unicode-display_width (~> 1.0, >= 1.0.1)
|
||||
ruby-graphviz (1.2.2)
|
||||
ruby-progressbar (1.8.1)
|
||||
ruby_dep (1.3.1)
|
||||
sass (3.4.22)
|
||||
sass-rails (5.0.5)
|
||||
sass-rails (5.0.6)
|
||||
railties (>= 4.0.0, < 6)
|
||||
sass (~> 3.1)
|
||||
sprockets (>= 2.8, < 4.0)
|
||||
@ -201,7 +201,7 @@ GEM
|
||||
spring-watcher-listen (2.0.0)
|
||||
listen (>= 2.7, < 4.0)
|
||||
spring (~> 1.2)
|
||||
sprockets (3.6.3)
|
||||
sprockets (3.7.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
rack (> 1, < 3)
|
||||
sprockets-rails (3.1.1)
|
||||
@ -232,7 +232,6 @@ PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
autoprefixer-rails
|
||||
awesome_print
|
||||
bcrypt (~> 3.1.7)
|
||||
binding_of_caller
|
||||
@ -243,10 +242,10 @@ DEPENDENCIES
|
||||
guard-minitest
|
||||
guard-rubocop
|
||||
guard-shell
|
||||
jbuilder (~> 2.5)
|
||||
jbuilder (~> 2.6)
|
||||
jquery-rails
|
||||
json (~> 2.0.1)
|
||||
listen (~> 3.0.5)
|
||||
json (~> 2.0.2)
|
||||
listen (~> 3.0)
|
||||
minitest-reporters
|
||||
mysql2 (>= 0.3.18, < 0.5)
|
||||
pry-byebug
|
||||
@ -255,7 +254,7 @@ DEPENDENCIES
|
||||
rack-livereload
|
||||
rails (~> 5.0.0)
|
||||
rails-erd
|
||||
rubocop
|
||||
rubocop (~> 0.42.0)
|
||||
sass-rails (~> 5.0)
|
||||
spring
|
||||
spring-watcher-listen (~> 2.0.0)
|
||||
|
34
README.md
34
README.md
@ -1,24 +1,26 @@
|
||||
# README
|
||||
# Skill Assessment Quiz
|
||||
|
||||
This README would normally document whatever steps are necessary to get the
|
||||
application up and running.
|
||||
This application manages quizzes intended to be used as pre-interview skill assessments.
|
||||
|
||||
Things you may want to cover:
|
||||
|
||||
* Ruby version
|
||||
|
||||
* System dependencies
|
||||
# dev
|
||||
* you can dev native, or in docker
|
||||
* use guard
|
||||
* honor RuboCop
|
||||
* keep tests green
|
||||
* pull --rebase !always `git config --global pull.rebase true`
|
||||
|
||||
* Configuration
|
||||
# Docker
|
||||
|
||||
* Database creation
|
||||
* ./start-docker.sh
|
||||
- will build source image, it not exist
|
||||
- created contaier and starts
|
||||
* ./start-dev.sh
|
||||
- after connected to container, run this to spin up a dev session
|
||||
- edit files from host in favorite editor
|
||||
* ./start-server.sh
|
||||
- starts up simple server for viewing/demo sans guard
|
||||
|
||||
* Database initialization
|
||||
visit http://localhost:3000
|
||||
|
||||
* How to run the test suite
|
||||
|
||||
* Services (job queues, cache servers, search engines, etc.)
|
||||
|
||||
* Deployment instructions
|
||||
|
||||
* ...
|
||||
|
@ -1,3 +1,4 @@
|
||||
if [ -d '/usr/app' ]; then
|
||||
cd /usr/app
|
||||
bundle
|
||||
|
||||
@ -7,6 +8,9 @@ rails db:migrate
|
||||
rails db:fixtures:load
|
||||
|
||||
tmux new-session -d -s 'rails-dev' 'rails s -b 0.0.0.0'
|
||||
tmux split-window -p 80 -v guard
|
||||
tmux split-window -p 25 -v
|
||||
tmux split-window -p 85 -v 'bundle exec guard'
|
||||
tmux split-window -p 20 -v
|
||||
tmux attach -t rails-dev
|
||||
else
|
||||
echo "Are you in docker container?"
|
||||
fi
|
||||
|
@ -10,7 +10,7 @@ fi
|
||||
STATUS=$(docker inspect --format="{{ .State.Running }}" $CONTAINER 2> /dev/null)
|
||||
|
||||
if [ $? -eq 1 ]; then
|
||||
docker run --name $CONTAINER -it -p 3000:3000 -p 3306:3306 -v ${PWD}:/usr/app $IMAGE /bin/bash
|
||||
docker run --name $CONTAINER -it -p 3000:3000 -p 35729:35729 -p 3306:3306 -v ${PWD}:/usr/app $IMAGE /bin/bash
|
||||
exit
|
||||
fi
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
if [ -d '/usr/app' ]; then
|
||||
cd /usr/app
|
||||
bundle
|
||||
|
||||
@ -7,4 +8,6 @@ rails db:migrate
|
||||
rails db:fixtures:load
|
||||
|
||||
rails s -b 0.0.0.0
|
||||
|
||||
else
|
||||
echo "Are you in docker container?"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user