1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-20 14:54:15 +01:00

update to rails 5.0.7.2

This commit is contained in:
Du Peng 2020-03-11 16:18:17 +01:00 committed by Sylvain
parent 5da4a90692
commit 9ca9425ef4
26 changed files with 623 additions and 386 deletions

View File

@ -45,6 +45,7 @@ provision
Dockerfile Dockerfile
docker-compose* docker-compose*
test test
.env
# Docs # Docs
*.md *.md

1
.gitignore vendored
View File

@ -24,6 +24,7 @@
# Ignore application configurations # Ignore application configurations
/config/application.yml /config/application.yml
/config/database.yml /config/database.yml
.env
*.DS_Store *.DS_Store
.idea .idea

44
Gemfile
View File

@ -1,12 +1,14 @@
# frozen_string_literal: true
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'compass-rails', '2.0.4' gem 'compass-rails', '3.0.2'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.11.1' gem 'rails', '~> 5.0.7.2'
# Use Puma as web server # Use Puma as web server
gem 'puma', '3.12.4' gem 'puma', '3.12.4'
# Use SCSS for stylesheets # Use SCSS for stylesheets
gem 'sass-rails', '5.0.1' gem 'sass-rails', '~> 5.0', '>= 5.0.6'
# Use Uglifier as compressor for JavaScript assets # Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 4.1.20' gem 'uglifier', '>= 4.1.20'
@ -28,36 +30,35 @@ group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console # Call 'byebug' anywhere in the code to stop execution and get a debugger console
# comment over to use visual debugger (eg. RubyMine), uncomment to use manual debugging # comment over to use visual debugger (eg. RubyMine), uncomment to use manual debugging
# gem 'byebug' # gem 'byebug'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.1.3'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'railroady'
gem 'rubocop', '~> 0.61.1', require: false
end end
group :development do group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'active_record_query_trace' gem 'active_record_query_trace'
gem 'awesome_print' gem 'awesome_print'
gem 'coveralls', require: false gem 'coveralls', require: false
gem 'foreman' gem 'foreman'
gem 'web-console', '>= 3.3.0'
# Preview mail in the browser # Preview mail in the browser
gem 'mailcatcher' gem 'listen', '~> 3.0.5'
# don't put mailcatcher into your Gemfile. It will conflict with your applications gems at some point.
# Instead, pop a note in your README stating you use mailcatcher, and to run gem install mailcatcher then mailcatcher to get started.
# gem 'mailcatcher'
gem 'rb-readline' gem 'rb-readline'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'railroady'
gem 'rubocop', '~> 0.61.1', require: false
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end end
group :test do group :test do
gem 'byebug'
gem 'database_cleaner' gem 'database_cleaner'
gem 'dotenv-rails'
gem 'faker' gem 'faker'
gem 'minitest-reporters' gem 'minitest-reporters'
gem 'pdf-reader' gem 'pdf-reader'
gem 'test_after_commit' gem 'vcr', '3.0.1'
gem 'vcr'
gem 'webmock' gem 'webmock'
end end
@ -79,8 +80,6 @@ gem 'rolify'
gem 'kaminari' gem 'kaminari'
gem 'figaro'
gem 'bootstrap-sass', '>= 3.4.1' gem 'bootstrap-sass', '>= 3.4.1'
gem 'font-awesome-rails' gem 'font-awesome-rails'
@ -120,14 +119,11 @@ gem 'pundit'
gem 'oj' gem 'oj'
gem 'actionpack-page_caching' gem 'actionpack-page_caching', '1.1.0'
gem 'rails-observers' gem 'rails-observers'
gem 'chroma' gem 'chroma'
gem 'protected_attributes'
gem 'message_format' gem 'message_format'
gem 'openlab_ruby' gem 'openlab_ruby'
@ -141,8 +137,6 @@ gem 'caxlsx'
gem 'caxlsx_rails' gem 'caxlsx_rails'
gem 'rubyzip', '>= 1.3.0' gem 'rubyzip', '>= 1.3.0'
gem 'rack-protection', '1.5.5'
# get free disk space # get free disk space
gem 'sys-filesystem' gem 'sys-filesystem'

View File

@ -1,70 +1,72 @@
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
Ascii85 (1.0.2) Ascii85 (1.0.3)
aasm (4.1.0) aasm (5.0.8)
actionmailer (4.2.11.1) concurrent-ruby (~> 1.0)
actionpack (= 4.2.11.1) actioncable (5.0.7.2)
actionview (= 4.2.11.1) actionpack (= 5.0.7.2)
activejob (= 4.2.11.1) nio4r (>= 1.2, < 3.0)
websocket-driver (~> 0.6.1)
actionmailer (5.0.7.2)
actionpack (= 5.0.7.2)
actionview (= 5.0.7.2)
activejob (= 5.0.7.2)
mail (~> 2.5, >= 2.5.4) mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5) rails-dom-testing (~> 2.0)
actionpack (4.2.11.1) actionpack (5.0.7.2)
actionview (= 4.2.11.1) actionview (= 5.0.7.2)
activesupport (= 4.2.11.1) activesupport (= 5.0.7.2)
rack (~> 1.6) rack (~> 2.0)
rack-test (~> 0.6.2) rack-test (~> 0.6.3)
rails-dom-testing (~> 1.0, >= 1.0.5) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2) rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionpack-page_caching (1.0.2) actionpack-page_caching (1.1.0)
actionpack (>= 4.0.0, < 5) actionpack (>= 4.0.0, < 6)
actionview (4.2.11.1) actionview (5.0.7.2)
activesupport (= 4.2.11.1) activesupport (= 5.0.7.2)
builder (~> 3.1) builder (~> 3.1)
erubis (~> 2.7.0) erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3) rails-html-sanitizer (~> 1.0, >= 1.0.3)
active_record_query_trace (1.4) active_record_query_trace (1.7)
activejob (4.2.11.1) activejob (5.0.7.2)
activesupport (= 4.2.11.1) activesupport (= 5.0.7.2)
globalid (>= 0.3.0) globalid (>= 0.3.6)
activemodel (4.2.11.1) activemodel (5.0.7.2)
activesupport (= 4.2.11.1) activesupport (= 5.0.7.2)
builder (~> 3.1) activerecord (5.0.7.2)
activerecord (4.2.11.1) activemodel (= 5.0.7.2)
activemodel (= 4.2.11.1) activesupport (= 5.0.7.2)
activesupport (= 4.2.11.1) arel (~> 7.0)
arel (~> 6.0) activesupport (5.0.7.2)
activesupport (4.2.11.1) concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7) i18n (>= 0.7, < 2)
minitest (~> 5.1) minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1) tzinfo (~> 1.1)
addressable (2.5.2) addressable (2.7.0)
public_suffix (>= 2.0.2, < 4.0) public_suffix (>= 2.0.2, < 5.0)
afm (0.2.2) afm (0.2.2)
ansi (1.5.0) ansi (1.5.0)
api-pagination (4.3.0) api-pagination (4.8.2)
apipie-rails (0.3.6) apipie-rails (0.5.17)
json rails (>= 4.1)
arel (6.0.4) arel (7.1.4)
ast (2.4.0) ast (2.4.0)
autoprefixer-rails (9.4.9) autoprefixer-rails (9.7.4)
execjs execjs
awesome_print (1.6.1) awesome_print (1.8.0)
axiom-types (0.1.1) axiom-types (0.1.1)
descendants_tracker (~> 0.0.4) descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0) ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1) thread_safe (~> 0.3, >= 0.3.1)
bcrypt (3.1.13) bcrypt (3.1.13)
binding_of_caller (0.7.3) bindex (0.8.1)
debug_inspector (>= 0.0.1)
bootstrap-sass (3.4.1) bootstrap-sass (3.4.1)
autoprefixer-rails (>= 5.2.1) autoprefixer-rails (>= 5.2.1)
sassc (>= 2.0.0) sassc (>= 2.0.0)
builder (3.2.3) builder (3.2.4)
byebug (8.2.3) camertron-eprun (1.1.1)
camertron-eprun (1.1.0)
carrierwave (0.10.0) carrierwave (0.10.0)
activemodel (>= 3.2.0) activemodel (>= 3.2.0)
activesupport (>= 3.2.0) activesupport (>= 3.2.0)
@ -78,8 +80,8 @@ GEM
caxlsx_rails (0.6.2) caxlsx_rails (0.6.2)
actionpack (>= 3.1) actionpack (>= 3.1)
caxlsx (>= 3.0) caxlsx (>= 3.0)
chroma (0.0.1) chroma (0.2.0)
chunky_png (1.3.4) chunky_png (1.3.11)
cldr-plurals-runtime-rb (1.0.1) cldr-plurals-runtime-rb (1.0.1)
coercible (1.0.0) coercible (1.0.0)
descendants_tracker (~> 0.0.1) descendants_tracker (~> 0.0.1)
@ -95,24 +97,22 @@ GEM
sass (>= 3.3.0, < 3.5) sass (>= 3.3.0, < 3.5)
compass-import-once (1.0.5) compass-import-once (1.0.5)
sass (>= 3.2, < 3.5) sass (>= 3.2, < 3.5)
compass-rails (2.0.4) compass-rails (3.0.2)
compass (~> 1.0.0) compass (~> 1.0.0)
sass-rails (<= 5.0.1) sass-rails (< 5.1)
sprockets (< 2.13) sprockets (< 4.0)
concurrent-ruby (1.1.5) concurrent-ruby (1.1.6)
connection_pool (2.2.2) connection_pool (2.2.2)
coveralls (0.8.16) coveralls (0.8.23)
json (>= 1.8, < 3) json (>= 1.8, < 3)
simplecov (~> 0.12.0) simplecov (~> 0.16.1)
term-ansicolor (~> 1.3.0) term-ansicolor (~> 1.3)
thor (~> 0.19.1) thor (>= 0.19.4, < 2.0)
tins (>= 1.6.0, < 2) tins (~> 1.6)
crack (0.4.3) crack (0.4.3)
safe_yaml (~> 1.0.0) safe_yaml (~> 1.0.0)
crass (1.0.5) crass (1.0.6)
daemons (1.2.4) database_cleaner (1.8.3)
database_cleaner (1.4.1)
debug_inspector (0.0.3)
descendants_tracker (0.0.4) descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1) thread_safe (~> 0.3, >= 0.3.1)
devise (4.7.1) devise (4.7.1)
@ -121,13 +121,17 @@ GEM
railties (>= 4.1.0) railties (>= 4.1.0)
responders responders
warden (~> 1.2.3) warden (~> 1.2.3)
docile (1.1.5) docile (1.3.2)
dotenv (2.7.5)
dotenv-rails (2.7.5)
dotenv (= 2.7.5)
railties (>= 3.2, < 6.1)
elasticsearch (5.0.5) elasticsearch (5.0.5)
elasticsearch-api (= 5.0.5) elasticsearch-api (= 5.0.5)
elasticsearch-transport (= 5.0.5) elasticsearch-transport (= 5.0.5)
elasticsearch-api (5.0.5) elasticsearch-api (5.0.5)
multi_json multi_json
elasticsearch-model (5.0.2) elasticsearch-model (5.1.0)
activesupport (> 3) activesupport (> 3)
elasticsearch (~> 5) elasticsearch (~> 5)
hashie hashie
@ -138,7 +142,7 @@ GEM
elasticsearch-model (~> 5) elasticsearch-model (~> 5)
hashie hashie
virtus virtus
elasticsearch-rails (5.0.2) elasticsearch-rails (5.1.0)
elasticsearch-transport (5.0.5) elasticsearch-transport (5.0.5)
faraday faraday
multi_json multi_json
@ -146,20 +150,16 @@ GEM
erubis (2.7.0) erubis (2.7.0)
et-orbi (1.2.1) et-orbi (1.2.1)
tzinfo tzinfo
eventmachine (1.0.9.1)
execjs (2.7.0) execjs (2.7.0)
faker (1.4.3) faker (2.10.2)
i18n (~> 0.5) i18n (>= 1.6, < 2)
faraday (0.17.0) faraday (1.0.0)
multipart-post (>= 1.2, < 3) multipart-post (>= 1.2, < 3)
ffi (1.9.24) ffi (1.12.2)
figaro (1.1.0) font-awesome-rails (4.7.0.5)
thor (~> 0.14) railties (>= 3.2, < 6.1)
font-awesome-rails (4.6.3.0) foreman (0.87.0)
railties (>= 3.2, < 5.1) forgery (0.7.0)
foreman (0.78.0)
thor (~> 0.19.1)
forgery (0.6.0)
friendly_id (5.1.0) friendly_id (5.1.0)
activerecord (>= 4.0.0) activerecord (>= 4.0.0)
fugit (1.3.1) fugit (1.3.1)
@ -169,58 +169,63 @@ GEM
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
has_secure_token (1.0.0) has_secure_token (1.0.0)
activerecord (>= 3.0) activerecord (>= 3.0)
hashdiff (0.3.0) hashdiff (1.0.1)
hashery (2.1.2) hashery (2.1.2)
hashie (3.6.0) hashie (4.1.0)
hike (1.2.3)
htmlentities (4.3.4) htmlentities (4.3.4)
httparty (0.13.7) httparty (0.18.0)
json (~> 1.8) mime-types (~> 3.0)
multi_xml (>= 0.5.2) multi_xml (>= 0.5.2)
i18n (0.9.5) i18n (1.8.2)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
icalendar (2.5.3) icalendar (2.5.3)
ice_cube (~> 0.16) ice_cube (~> 0.16)
ice_cube (0.16.3) ice_cube (0.16.3)
ice_nine (0.11.2) ice_nine (0.11.2)
jaro_winkler (1.5.1) jaro_winkler (1.5.4)
jbuilder (2.5.0) jbuilder (2.10.0)
activesupport (>= 3.0.0, < 5.1) activesupport (>= 5.0.0)
multi_json (~> 1.2) jbuilder_cache_multi (0.1.0)
jbuilder_cache_multi (0.0.3)
jbuilder (>= 1.5.0, < 3) jbuilder (>= 1.5.0, < 3)
jquery-rails (4.3.1) jquery-rails (4.3.5)
rails-dom-testing (>= 1, < 3) rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0) railties (>= 4.2.0)
thor (>= 0.14, < 2.0) thor (>= 0.14, < 2.0)
json (1.8.6) json (1.8.6)
jwt (2.2.1) jwt (2.2.1)
kaminari (0.16.3) kaminari (1.2.0)
actionpack (>= 3.0.0) activesupport (>= 4.1.0)
activesupport (>= 3.0.0) kaminari-actionview (= 1.2.0)
kaminari-activerecord (= 1.2.0)
kaminari-core (= 1.2.0)
kaminari-actionview (1.2.0)
actionview
kaminari-core (= 1.2.0)
kaminari-activerecord (1.2.0)
activerecord
kaminari-core (= 1.2.0)
kaminari-core (1.2.0)
libv8 (3.16.14.19) libv8 (3.16.14.19)
loofah (2.3.1) listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
loofah (2.4.0)
crass (~> 1.0.2) crass (~> 1.0.2)
nokogiri (>= 1.5.9) nokogiri (>= 1.5.9)
mail (2.7.1) mail (2.7.1)
mini_mime (>= 0.1.1) mini_mime (>= 0.1.1)
mailcatcher (0.6.5) message_format (0.0.6)
eventmachine (= 1.0.9.1) twitter_cldr (~> 5.0)
mail (~> 2.3) method_source (0.9.2)
rack (~> 1.5) mime-types (3.3.1)
sinatra (~> 1.2) mime-types-data (~> 3.2015)
skinny (~> 0.2.3) mime-types-data (3.2019.1009)
sqlite3 (~> 1.3)
thin (~> 1.5.0)
message_format (0.0.3)
twitter_cldr (~> 3.1)
mime-types (2.99.3)
mimemagic (0.3.4) mimemagic (0.3.4)
mini_magick (4.9.4) mini_magick (4.10.1)
mini_mime (1.0.2) mini_mime (1.0.2)
mini_portile2 (2.4.0) mini_portile2 (2.4.0)
minitest (5.12.2) minitest (5.14.0)
minitest-reporters (1.1.8) minitest-reporters (1.4.2)
ansi ansi
builder builder
minitest (>= 5.0) minitest (>= 5.0)
@ -228,21 +233,24 @@ GEM
multi_json (1.14.1) multi_json (1.14.1)
multi_xml (0.6.0) multi_xml (0.6.0)
multipart-post (2.1.1) multipart-post (2.1.1)
nokogiri (1.10.8) mustermann (1.1.1)
ruby2_keywords (~> 0.0.1)
nio4r (2.5.2)
nokogiri (1.10.9)
mini_portile2 (~> 2.4.0) mini_portile2 (~> 2.4.0)
notify_with (0.0.2) notify_with (0.0.2)
jbuilder (~> 2.0) jbuilder (~> 2.0)
rails (>= 4.2.0) rails (>= 4.2.0)
responders (~> 2.0) responders (~> 2.0)
oauth2 (1.4.2) oauth2 (1.4.4)
faraday (>= 0.8, < 2.0) faraday (>= 0.8, < 2.0)
jwt (>= 1.0, < 3.0) jwt (>= 1.0, < 3.0)
multi_json (~> 1.3) multi_json (~> 1.3)
multi_xml (~> 0.5) multi_xml (~> 0.5)
rack (>= 1.2, < 3) rack (>= 1.2, < 3)
oj (2.12.8) oj (3.10.5)
omniauth (1.9.0) omniauth (1.9.1)
hashie (>= 3.4.6, < 3.7.0) hashie (>= 3.4.6)
rack (>= 1.6.2, < 3) rack (>= 1.6.2, < 3)
omniauth-oauth2 (1.6.0) omniauth-oauth2 (1.6.0)
oauth2 (~> 1.1) oauth2 (~> 1.1)
@ -253,71 +261,69 @@ GEM
openlab_ruby (0.0.4) openlab_ruby (0.0.4)
httparty (~> 0.13) httparty (~> 0.13)
orm_adapter (0.5.0) orm_adapter (0.5.0)
parallel (1.12.1) parallel (1.19.1)
parser (2.5.3.0) parser (2.7.0.4)
ast (~> 2.4.0) ast (~> 2.4.0)
pdf-core (0.5.1) pdf-core (0.7.0)
pdf-reader (1.4.0) pdf-reader (2.4.0)
Ascii85 (~> 1.0.0) Ascii85 (~> 1.0.0)
afm (~> 0.2.1) afm (~> 0.2.1)
hashery (~> 2.0) hashery (~> 2.0)
ruby-rc4 ruby-rc4
ttfunk ttfunk
pg (0.18.1) pg (1.2.2)
powerpack (0.1.2) powerpack (0.1.2)
prawn (2.0.1) prawn (2.2.2)
pdf-core (~> 0.5.1) pdf-core (~> 0.7.0)
ttfunk (~> 1.4.0) ttfunk (~> 1.5)
prawn-table (0.2.1) prawn-table (0.2.2)
protected_attributes (1.1.3) prawn (>= 1.3.0, < 3.0.0)
activemodel (>= 4.0.1, < 5.0) public_suffix (4.0.3)
public_suffix (3.0.2)
puma (3.12.4) puma (3.12.4)
pundit (1.0.0) pundit (2.1.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
raabro (1.1.6) raabro (1.1.6)
rack (1.6.13) rack (2.2.2)
rack-protection (1.5.5) rack-protection (2.0.8.1)
rack rack
rack-test (0.6.3) rack-test (0.6.3)
rack (>= 1.0) rack (>= 1.0)
railroady (1.5.3) railroady (1.5.3)
rails (4.2.11.1) rails (5.0.7.2)
actionmailer (= 4.2.11.1) actioncable (= 5.0.7.2)
actionpack (= 4.2.11.1) actionmailer (= 5.0.7.2)
actionview (= 4.2.11.1) actionpack (= 5.0.7.2)
activejob (= 4.2.11.1) actionview (= 5.0.7.2)
activemodel (= 4.2.11.1) activejob (= 5.0.7.2)
activerecord (= 4.2.11.1) activemodel (= 5.0.7.2)
activesupport (= 4.2.11.1) activerecord (= 5.0.7.2)
bundler (>= 1.3.0, < 2.0) activesupport (= 5.0.7.2)
railties (= 4.2.11.1) bundler (>= 1.3.0)
sprockets-rails railties (= 5.0.7.2)
rails-deprecated_sanitizer (1.0.3) sprockets-rails (>= 2.0.0)
activesupport (>= 4.2.0.alpha) rails-dom-testing (2.0.3)
rails-dom-testing (1.0.9) activesupport (>= 4.2.0)
activesupport (>= 4.2.0, < 5.0) nokogiri (>= 1.6)
nokogiri (~> 1.6)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.3.0) rails-html-sanitizer (1.3.0)
loofah (~> 2.3) loofah (~> 2.3)
rails-observers (0.1.2) rails-observers (0.1.5)
activemodel (~> 4.0) activemodel (>= 4.0)
rails_12factor (0.0.3) rails_12factor (0.0.3)
rails_serve_static_assets rails_serve_static_assets
rails_stdout_logging rails_stdout_logging
rails_serve_static_assets (0.0.4) rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.3) rails_stdout_logging (0.0.5)
railties (4.2.11.1) railties (5.0.7.2)
actionpack (= 4.2.11.1) actionpack (= 5.0.7.2)
activesupport (= 4.2.11.1) activesupport (= 5.0.7.2)
method_source
rake (>= 0.8.7) rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0) thor (>= 0.18.1, < 2.0)
rainbow (3.0.0) rainbow (3.0.0)
rake (13.0.0) rake (13.0.1)
rb-fsevent (0.9.4) rb-fsevent (0.10.3)
rb-inotify (0.9.5) rb-inotify (0.10.1)
ffi (>= 0.5.0) ffi (~> 1.0)
rb-readline (0.5.5) rb-readline (0.5.5)
rdoc (4.3.0) rdoc (4.3.0)
recurrence (1.3.0) recurrence (1.3.0)
@ -327,10 +333,11 @@ GEM
redis-namespace (1.6.0) redis-namespace (1.6.0)
redis (>= 3.0.4) redis (>= 3.0.4)
ref (2.0.0) ref (2.0.0)
repost (0.2.9) repost (0.3.2)
responders (2.1.0) responders (2.4.1)
railties (>= 4.2.0, < 5) actionpack (>= 4.2.0, < 6.0)
rolify (4.0.0) railties (>= 4.2.0, < 6.0)
rolify (5.2.0)
rubocop (0.61.1) rubocop (0.61.1)
jaro_winkler (~> 1.5.1) jaro_winkler (~> 1.5.1)
parallel (~> 1.10) parallel (~> 1.10)
@ -339,130 +346,126 @@ GEM
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.4.0) unicode-display_width (~> 1.4.0)
ruby-progressbar (1.7.5) ruby-progressbar (1.10.1)
ruby-rc4 (0.1.5) ruby-rc4 (0.1.5)
ruby2_keywords (0.0.2)
rubyzip (1.3.0) rubyzip (1.3.0)
safe_yaml (1.0.4) safe_yaml (1.0.5)
sass (3.4.13) sass (3.4.25)
sass-rails (5.0.1) sass-rails (5.0.7)
railties (>= 4.0.0, < 5.0) railties (>= 4.0.0, < 6)
sass (~> 3.1) sass (~> 3.1)
sprockets (>= 2.8, < 4.0) sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0) sprockets-rails (>= 2.0, < 4.0)
tilt (~> 1.1) tilt (>= 1.1, < 3)
sassc (2.0.0) sassc (2.2.1)
ffi (~> 1.9.6) ffi (~> 1.9)
rake sdoc (0.4.2)
sdoc (0.4.1)
json (~> 1.7, >= 1.7.7) json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0) rdoc (~> 4.0)
seed_dump (3.2.2) seed_dump (3.3.1)
activerecord (~> 4) activerecord (>= 4)
activesupport (~> 4) activesupport (>= 4)
sha3 (1.0.1) sha3 (1.0.1)
sidekiq (5.2.8) sidekiq (5.2.7)
connection_pool (~> 2.2, >= 2.2.2) connection_pool (~> 2.2, >= 2.2.2)
rack (< 2.1.0) rack (>= 1.5.0)
rack-protection (>= 1.5.0) rack-protection (>= 1.5.0)
redis (>= 3.3.5, < 5) redis (>= 3.3.5, < 5)
sidekiq-cron (1.1.0) sidekiq-cron (1.1.0)
fugit (~> 1.1) fugit (~> 1.1)
sidekiq (>= 4.2.1) sidekiq (>= 4.2.1)
simplecov (0.12.0) simplecov (0.16.1)
docile (~> 1.1.0) docile (~> 1.1)
json (>= 1.8, < 3) json (>= 1.8, < 3)
simplecov-html (~> 0.10.0) simplecov-html (~> 0.10.0)
simplecov-html (0.10.0) simplecov-html (0.10.2)
sinatra (1.4.6) sinatra (2.0.8.1)
rack (~> 1.4) mustermann (~> 1.0)
rack-protection (~> 1.4) rack (~> 2.0)
tilt (>= 1.3, < 3) rack-protection (= 2.0.8.1)
skinny (0.2.4) tilt (~> 2.0)
eventmachine (~> 1.0.0) spring (2.0.2)
thin (>= 1.5, < 1.7) activesupport (>= 4.2)
spring (1.3.5) spring-watcher-listen (2.0.1)
sprockets (2.12.5) listen (>= 2.7, < 4.0)
hike (~> 1.2) spring (>= 1.2, < 3.0)
multi_json (~> 1.0) sprockets (3.7.2)
rack (~> 1.0) concurrent-ruby (~> 1.0)
tilt (~> 1.1, != 1.3.0) rack (> 1, < 3)
sprockets-rails (2.3.3) sprockets-rails (3.2.1)
actionpack (>= 3.0) actionpack (>= 4.0)
activesupport (>= 3.0) activesupport (>= 4.0)
sprockets (>= 2.8, < 4.0) sprockets (>= 3.0.0)
sqlite3 (1.3.13)
stripe (5.1.1) stripe (5.1.1)
sys-filesystem (1.2.0) sync (0.5.0)
sys-filesystem (1.3.3)
ffi ffi
term-ansicolor (1.3.2) term-ansicolor (1.7.1)
tins (~> 1.0) tins (~> 1.0)
test_after_commit (1.0.0)
activerecord (>= 3.2)
therubyracer (0.12.0) therubyracer (0.12.0)
libv8 (~> 3.16.14.0) libv8 (~> 3.16.14.0)
ref ref
thin (1.5.1) thor (1.0.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.19.4)
thread_safe (0.3.6) thread_safe (0.3.6)
tilt (1.4.1) tilt (2.0.10)
tins (1.13.0) tins (1.24.1)
ttfunk (1.4.0) sync
twitter_cldr (3.2.1) ttfunk (1.5.1)
twitter_cldr (5.4.0)
camertron-eprun camertron-eprun
cldr-plurals-runtime-rb (~> 1.0.0) cldr-plurals-runtime-rb (~> 1.0)
json
tzinfo tzinfo
tzinfo (1.2.5) tzinfo (1.2.6)
thread_safe (~> 0.1) thread_safe (~> 0.1)
uglifier (4.1.20) uglifier (4.2.0)
execjs (>= 0.3.0, < 3) execjs (>= 0.3.0, < 3)
unicode-display_width (1.4.0) unicode-display_width (1.4.1)
vcr (3.0.1) vcr (3.0.1)
virtus (1.0.5) virtus (1.0.5)
axiom-types (~> 0.1) axiom-types (~> 0.1)
coercible (~> 1.0) coercible (~> 1.0)
descendants_tracker (~> 0.0, >= 0.0.3) descendants_tracker (~> 0.0, >= 0.0.3)
equalizer (~> 0.0, >= 0.0.9) equalizer (~> 0.0, >= 0.0.9)
warden (1.2.7) warden (1.2.8)
rack (>= 1.0) rack (>= 2.0.6)
web-console (2.1.3) web-console (3.7.0)
activemodel (>= 4.0) actionview (>= 5.0)
binding_of_caller (>= 0.7.2) activemodel (>= 5.0)
railties (>= 4.0) bindex (>= 0.4.0)
sprockets-rails (>= 2.0, < 4.0) railties (>= 5.0)
webmock (1.24.2) webmock (3.8.2)
addressable (>= 2.3.6) addressable (>= 2.3.6)
crack (>= 0.3.2) crack (>= 0.3.2)
hashdiff hashdiff (>= 0.4.0, < 2.0.0)
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.4)
PLATFORMS PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
aasm aasm
actionpack-page_caching actionpack-page_caching (= 1.1.0)
active_record_query_trace active_record_query_trace
api-pagination api-pagination
apipie-rails apipie-rails
awesome_print awesome_print
bootstrap-sass (>= 3.4.1) bootstrap-sass (>= 3.4.1)
byebug
carrierwave carrierwave
caxlsx caxlsx
caxlsx_rails caxlsx_rails
chroma chroma
compass-rails (= 2.0.4) compass-rails (= 3.0.2)
coveralls coveralls
database_cleaner database_cleaner
devise (>= 4.6.0) devise (>= 4.6.0)
dotenv-rails
elasticsearch-model (~> 5) elasticsearch-model (~> 5)
elasticsearch-persistence (~> 5) elasticsearch-persistence (~> 5)
elasticsearch-rails (~> 5) elasticsearch-rails (~> 5)
faker faker
figaro
font-awesome-rails font-awesome-rails
foreman foreman
forgery forgery
@ -473,7 +476,7 @@ DEPENDENCIES
jbuilder_cache_multi jbuilder_cache_multi
jquery-rails jquery-rails
kaminari kaminari
mailcatcher listen (~> 3.0.5)
message_format message_format
mini_magick mini_magick
minitest-reporters minitest-reporters
@ -487,12 +490,10 @@ DEPENDENCIES
pg pg
prawn prawn
prawn-table prawn-table
protected_attributes
puma (= 3.12.4) puma (= 3.12.4)
pundit pundit
rack-protection (= 1.5.5)
railroady railroady
rails (= 4.2.11.1) rails (~> 5.0.7.2)
rails-observers rails-observers
rails_12factor rails_12factor
rb-readline rb-readline
@ -503,7 +504,7 @@ DEPENDENCIES
rolify rolify
rubocop (~> 0.61.1) rubocop (~> 0.61.1)
rubyzip (>= 1.3.0) rubyzip (>= 1.3.0)
sass-rails (= 5.0.1) sass-rails (~> 5.0, >= 5.0.6)
sdoc (~> 0.4.0) sdoc (~> 0.4.0)
seed_dump seed_dump
sha3 sha3
@ -511,13 +512,13 @@ DEPENDENCIES
sidekiq-cron sidekiq-cron
sinatra sinatra
spring spring
spring-watcher-listen (~> 2.0.0)
stripe (= 5.1.1) stripe (= 5.1.1)
sys-filesystem sys-filesystem
test_after_commit
therubyracer (= 0.12.0) therubyracer (= 0.12.0)
uglifier (>= 4.1.20) uglifier (>= 4.1.20)
vcr vcr (= 3.0.1)
web-console (~> 2.1.3) web-console (>= 3.3.0)
webmock webmock
BUNDLED WITH BUNDLED WITH

View File

@ -1,3 +1,3 @@
web: bundle exec rails server puma -p $PORT -b0.0.0.0 web: bundle exec rails server puma -p $PORT -b0.0.0.0
worker: bundle exec sidekiq -C ./config/sidekiq.yml worker: bundle exec sidekiq -C ./config/sidekiq.yml
mail: bundle exec mailcatcher --foreground --http-ip=0.0.0.0 mail: mailcatcher --foreground --http-ip=0.0.0.0

View File

@ -16,7 +16,8 @@ class AuthProvider < ActiveRecord::Base
belongs_to :providable, polymorphic: true, dependent: :destroy belongs_to :providable, polymorphic: true, dependent: :destroy
accepts_nested_attributes_for :providable accepts_nested_attributes_for :providable
attr_accessible :name, :providable_type, :providable_attributes # add gem 'protected_attributes_continued' for Rails 5+
# attr_accessible :name, :providable_type, :providable_attributes
before_create :set_initial_state before_create :set_initial_state

View File

@ -1,4 +1,4 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
APP_PATH = File.expand_path('../../config/application', __FILE__) APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot' require_relative '../config/boot'
require 'rails/commands' require 'rails/commands'

View File

@ -1,29 +1,34 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
require 'pathname' require 'pathname'
require 'fileutils'
include FileUtils
# path to your application root. # path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
Dir.chdir APP_ROOT do def system!(*args)
# This script is a starting point to setup your application. system(*args) || abort("\n== Command #{args} failed ==")
# Add necessary setup steps to this file: end
puts "== Installing dependencies ==" chdir APP_ROOT do
system "gem install bundler --conservative" # This script is a starting point to setup your application.
system "bundle check || bundle install" # Add necessary setup steps to this file.
puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')
# puts "\n== Copying sample files ==" # puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml") # unless File.exist?('config/database.yml')
# system "cp config/database.yml.sample config/database.yml" # cp 'config/database.yml.sample', 'config/database.yml'
# end # end
puts "\n== Preparing database ==" puts "\n== Preparing database =="
system "bin/rake db:setup" system! 'bin/rails db:setup'
puts "\n== Removing old logs and tempfiles ==" puts "\n== Removing old logs and tempfiles =="
system "rm -f log/*" system! 'bin/rails log:clear tmp:clear'
system "rm -rf tmp/cache"
puts "\n== Restarting application server ==" puts "\n== Restarting application server =="
system "touch tmp/restart.txt" system! 'bin/rails restart'
end end

29
bin/update Executable file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env ruby
require 'pathname'
require 'fileutils'
include FileUtils
# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end
chdir APP_ROOT do
# This script is a way to update your development environment automatically.
# Add necessary update steps to this file.
puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')
puts "\n== Updating database =="
system! 'bin/rails db:migrate'
puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear'
puts "\n== Restarting application server =="
system! 'bin/rails restart'
end

View File

@ -1,13 +1,12 @@
# frozen_string_literal: true # frozen_string_literal: true
require File.expand_path('../boot', __FILE__) require_relative 'boot'
require 'csv' require 'csv'
require 'rails/all' require 'rails/all'
require 'elasticsearch/rails/instrumentation' require 'elasticsearch/rails/instrumentation'
require 'elasticsearch/persistence/model' require 'elasticsearch/persistence/model'
# Require the gems listed in Gemfile, including any gems # Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production. # you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups) Bundler.require(*Rails.groups)
@ -33,18 +32,17 @@ module Fablab
config.assets.paths << Rails.root.join('node_modules').to_s config.assets.paths << Rails.root.join('node_modules').to_s
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
config.to_prepare do config.to_prepare do
Devise::Mailer.layout 'notifications_mailer' Devise::Mailer.layout 'notifications_mailer'
end end
# allow use rails helpers in angular templates # allow use rails helpers in angular templates
Rails.application.assets.context_class.class_eval do Rails.application.config.assets.configure do |env|
env.context_class.class_eval do
include ActionView::Helpers include ActionView::Helpers
include Rails.application.routes.url_helpers include Rails.application.routes.url_helpers
end end
end
config.active_job.queue_adapter = :sidekiq config.active_job.queue_adapter = :sidekiq

View File

@ -1,4 +1,3 @@
# Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) require 'bundler/setup' # Set up gems listed in the Gemfile.

9
config/cable.yml Normal file
View File

@ -0,0 +1,9 @@
development:
adapter: async
test:
adapter: async
production:
adapter: redis
url: redis://localhost:6379/1

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
# Load the Rails application. # Load the Rails application.
require File.expand_path('../application', __FILE__) require_relative 'application'
# Initialize the Rails application. # Initialize the Rails application.
Rails.application.initialize! Rails.application.initialize!

View File

@ -11,10 +11,23 @@ Rails.application.configure do
# Do not eager load code on boot. # Do not eager load code on boot.
config.eager_load = false config.eager_load = false
# Show full error reports and disable caching. # Show full error reports.
config.consider_all_requests_local = true 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.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
config.action_controller.default_url_options = { config.action_controller.default_url_options = {
host: Rails.application.secrets.default_host, host: Rails.application.secrets.default_host,
protocol: Rails.application.secrets.default_protocol protocol: Rails.application.secrets.default_protocol
@ -23,6 +36,16 @@ Rails.application.configure do
# Don't care if the mailer can't send. # Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false config.action_mailer.raise_delivery_errors = false
config.action_mailer.perform_caching = false
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = { address: '127.0.0.1', port: 1025 }
config.action_mailer.raise_delivery_errors = false
config.action_mailer.default_url_options = {
host: Rails.application.secrets.default_host,
protocol: Rails.application.secrets.default_protocol
}
# Print deprecation notices to the Rails logger. # Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log config.active_support.deprecation = :log
@ -32,13 +55,15 @@ Rails.application.configure do
# Debug mode disables concatenation and preprocessing of assets. # Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large # This option may cause significant delays in view rendering with a large
# number of complex assets. # number of complex assets.
# Set to false when running with Vagrant to speed up response time. config.assets.debug = true
config.assets.debug = ENV['VIRTUAL_DEV_ENV'] ? false : true
# Asset digests allow you to set far-future HTTP expiration dates on all assets, # 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. # yet still be able to expire them through the digest params.
config.assets.digest = false config.assets.digest = false
# Suppress logger output for asset requests.
config.assets.quiet = true
# Adds additional error checking when serving assets at runtime. # Adds additional error checking when serving assets at runtime.
# Checks for improperly declared sprockets dependencies. # Checks for improperly declared sprockets dependencies.
# Raises helpful error messages. # Raises helpful error messages.
@ -47,13 +72,9 @@ Rails.application.configure do
# Raises error for missing translations # Raises error for missing translations
# config.action_view.raise_on_missing_translations = true # config.action_view.raise_on_missing_translations = true
config.action_mailer.delivery_method = :smtp # Use an evented file watcher to asynchronously detect changes in source code,
config.action_mailer.smtp_settings = { address: '127.0.0.1', port: 1025 } # routes, locales, etc. This feature depends on the listen gem.
config.action_mailer.raise_delivery_errors = false # config.file_watcher = ActiveSupport::EventedFileUpdateChecker
config.action_mailer.default_url_options = {
host: Rails.application.secrets.default_host,
protocol: Rails.application.secrets.default_protocol
}
config.log_level = Rails.application.secrets.log_level || :debug config.log_level = Rails.application.secrets.log_level || :debug
end end

View File

@ -21,17 +21,13 @@ Rails.application.configure do
protocol: Rails.application.secrets.default_protocol protocol: Rails.application.secrets.default_protocol
} }
# Enable Rack::Cache to put a simple HTTP cache in front of your application # Disable serving static files from the `/public` folder by default since
# Add `rack-cache` to your Gemfile before enabling this. # Apache or NGINX already handles this.
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
# config.action_dispatch.rack_cache = true
# Disable Rails's static asset server (Apache or nginx will already do this).
config.serve_static_files = false
# Compress JavaScripts and CSS. We disable variable name mangling and enable ES6 support # Compress JavaScripts and CSS. We disable variable name mangling and enable ES6 support
# config.assets.js_compressor = :uglifier
config.assets.js_compressor = Uglifier.new(mangle: false, harmony: true) config.assets.js_compressor = Uglifier.new(mangle: false, harmony: true)
# config.assets.css_compressor = :sass # config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed. # Do not fallback to assets pipeline if a precompiled asset is missed.
@ -40,34 +36,58 @@ Rails.application.configure do
# Generate digests for assets URLs. # Generate digests for assets URLs.
config.assets.digest = true config.assets.digest = true
# Version of your assets, change this if you want to expire all your assets. # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
config.assets.version = '1.0'
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'
# Specifies the header that your server uses for sending files. # 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-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx # 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. # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true # config.force_ssl = true
# Set to :debug to see everything in the log. # Use the lowest log level to ensure availability of diagnostic information
# when problems arise.
# config.log_level = :debug
config.log_level = Rails.application.secrets.log_level.blank? ? :debug : Rails.application.secrets.log_level config.log_level = Rails.application.secrets.log_level.blank? ? :debug : Rails.application.secrets.log_level
# Prepend all log lines with the following tags. # Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ] # config.log_tags = [ :request_id ]
# Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production. # Use a different cache store in production.
# config.cache_store = :mem_cache_store # config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server. # Use a real queuing backend for Active Job (and separate queues per environment)
# config.action_controller.asset_host = "http://assets.example.com" # config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "fablab_#{Rails.env}"
config.action_mailer.perform_caching = false
# Precompile additional assets. config.action_mailer.default_url_options = {
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. host: Rails.application.secrets.default_host,
# config.assets.precompile += %w( search.js ) protocol: Rails.application.secrets.default_protocol
}
# config.action_mailer.perform_deliveries = true
# config.action_mailer.raise_delivery_errors = false
# config.action_mailer.default :charset => "utf-8"
config.action_mailer.smtp_settings = {
address: Rails.application.secrets.smtp_address,
port: Rails.application.secrets.smtp_port,
user_name: Rails.application.secrets.smtp_user_name,
password: Rails.application.secrets.smtp_password,
authentication: Rails.application.secrets.smtp_authentication,
enable_starttls_auto: Rails.application.secrets.smtp_enable_starttls_auto,
openssl_verify_mode: Rails.application.secrets.smtp_openssl_verify_mode,
tls: Rails.application.secrets.smtp_tls
}
# use :smtp for switch prod
config.action_mailer.delivery_method = Rails.application.secrets.delivery_method.to_sym
# Ignore bad email addresses and do not raise email delivery errors. # 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. # Set this to true and configure the email server for immediate delivery to raise delivery errors.
@ -80,34 +100,19 @@ Rails.application.configure do
# Send deprecation notices to registered listeners. # Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify config.active_support.deprecation = :notify
# Disable automatic flushing of the log to improve performance.
# config.autoflush_log = false
# Use default logging formatter so that PID and timestamp are not suppressed. # Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new config.log_formatter = ::Logger::Formatter.new
# config.serve_static_assets = true # Use a different logger for distributed setups.
# require 'syslog/logger'
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
config.action_mailer.default_url_options = { if ENV['RAILS_LOG_TO_STDOUT'].present?
host: Rails.application.secrets.default_host, logger = ActiveSupport::Logger.new(STDOUT)
protocol: Rails.application.secrets.default_protocol logger.formatter = config.log_formatter
} config.logger = ActiveSupport::TaggedLogging.new(logger)
# config.action_mailer.perform_deliveries = true end
# config.action_mailer.raise_delivery_errors = false
# config.action_mailer.default :charset => "utf-8"
config.action_mailer.smtp_settings = {
address: Rails.application.secrets.smtp_address,
port: Rails.application.secrets.smtp_port,
user_name: Rails.application.secrets.smtp_user_name,
password: Rails.application.secrets.smtp_password,
authentication: Rails.application.secrets.smtp_authentication,
enable_starttls_auto: Rails.application.secrets.smtp_enable_starttls_auto,
openssl_verify_mode: Rails.application.secrets.smtp_openssl_verify_mode,
tls: Rails.application.secrets.smtp_tls
}
# use :smtp for switch prod
config.action_mailer.delivery_method = Rails.application.secrets.delivery_method.to_sym
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
end end

View File

@ -14,9 +14,11 @@ Rails.application.configure do
# preloads Rails for running tests, you may have to set it to true. # preloads Rails for running tests, you may have to set it to true.
config.eager_load = false config.eager_load = false
# Configure static asset server for tests with Cache-Control for performance. # Configure public file server for tests with Cache-Control for performance.
config.serve_static_files = true config.public_file_server.enabled = true
config.static_cache_control = 'public, max-age=3600' config.public_file_server.headers = {
'Cache-Control' => 'public, max-age=3600'
}
# Show full error reports and disable caching. # Show full error reports and disable caching.
config.consider_all_requests_local = true config.consider_all_requests_local = true
@ -32,21 +34,20 @@ Rails.application.configure do
# Disable request forgery protection in test environment. # Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false config.action_controller.allow_forgery_protection = false
config.action_mailer.perform_caching = false
# Tell Action Mailer not to deliver emails to the real world. # Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the # The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array. # ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test config.action_mailer.delivery_method = :test
config.active_job.queue_adapter = :test
# Print deprecation notices to the stderr. # Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr config.active_support.deprecation = :stderr
# Raises error for missing translations # Raises error for missing translations
# config.action_view.raise_on_missing_translations = true # config.action_view.raise_on_missing_translations = true
config.active_job.queue_adapter = :test
config.active_support.test_order = :random config.active_support.test_order = :random
config.log_level = Rails.application.secrets.log_level.blank? ? :debug : Rails.application.secrets.log_level config.log_level = Rails.application.secrets.log_level.blank? ? :debug : Rails.application.secrets.log_level
end end

View File

@ -0,0 +1,8 @@
# Be sure to restart your server when you modify this file.
# ActiveSupport::Reloader.to_prepare do
# ApplicationController.renderer.defaults.merge!(
# http_host: 'example.org',
# https: false
# )
# end

View File

@ -1,3 +1,7 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file. # 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 Rails.application.config.action_dispatch.cookies_serializer = :json

View File

@ -0,0 +1,25 @@
# Be sure to restart your server when you modify this file.
#
# This file contains migration options to ease your Rails 5.0 upgrade.
#
# Once upgraded flip defaults one by one to migrate to the new default.
#
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
Rails.application.config.action_controller.raise_on_unfiltered_parameters = true
# Enable per-form CSRF tokens. Previous versions had false.
Rails.application.config.action_controller.per_form_csrf_tokens = false
# Enable origin-checking CSRF mitigation. Previous versions had false.
Rails.application.config.action_controller.forgery_protection_origin_check = false
# Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
# Previous versions had false.
ActiveSupport.to_time_preserves_timezone = false
# Require `belongs_to` associations by default. Previous versions had false.
Rails.application.config.active_record.belongs_to_required_by_default = false
# Do not halt callback chains when a callback returns false. Previous versions had true.
ActiveSupport.halt_callback_chains_on_return_false = true

View File

@ -5,7 +5,7 @@
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do ActiveSupport.on_load(:action_controller) do
wrap_parameters format: [:json] if respond_to?(:wrap_parameters) wrap_parameters format: [:json]
end end
# To enable root element in JSON for ActiveRecord objects. # To enable root element in JSON for ActiveRecord objects.

47
config/puma.rb Normal file
View File

@ -0,0 +1,47 @@
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum, this matches the default thread size of Active Record.
#
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
threads threads_count, threads_count
# Specifies the `port` that Puma will listen on to receive requests, default is 3000.
#
port ENV.fetch("PORT") { 3000 }
# Specifies the `environment` that Puma will run in.
#
environment ENV.fetch("RAILS_ENV") { "development" }
# Specifies the number of `workers` to boot in clustered mode.
# Workers are forked webserver processes. If using threads and workers together
# the concurrency of the application would be max `threads` * `workers`.
# Workers do not work on JRuby or Windows (both of which do not support
# processes).
#
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
# Use the `preload_app!` method when specifying a `workers` number.
# This directive tells Puma to first boot the application and load code
# before forking the application. This takes advantage of Copy On Write
# process behavior so workers use less memory. If you use this option
# you need to make sure to reconnect any threads in the `on_worker_boot`
# block.
#
# preload_app!
# The code in the `on_worker_boot` will be called if you are using
# clustered mode by specifying a number of `workers`. After each worker
# process is booted this block will be run, if you are using `preload_app!`
# option you will want to use this block to reconnect to any threads
# or connections that may have been created at application boot, Ruby
# cannot share connections between processes.
#
# on_worker_boot do
# ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
# end
# Allow puma to be restarted by `rails restart` command.
plugin :tmp_restart

View File

@ -19,11 +19,9 @@ Rails.application.routes.draw do
get '/sso-redirect', to: 'application#sso_redirect', as: :sso_redirect get '/sso-redirect', to: 'application#sso_redirect', as: :sso_redirect
end end
## The priority is based upon order of creation: first created -> highest priority. ## The priority is based upon order of creation: first created -> highest priority.
## See how all your routes lay out with "rake routes". ## See how all your routes lay out with "rake routes".
constraints user_agent: %r{facebookexternalhit/[0-9]|Twitterbot|Pinterest|Google.*snippet} do constraints user_agent: %r{facebookexternalhit/[0-9]|Twitterbot|Pinterest|Google.*snippet} do
root to: 'social_bot#share', as: :bot_root root to: 'social_bot#share', as: :bot_root
end end

View File

@ -1,11 +1,6 @@
# frozen_string_literal: true %w(
.ruby-version
.rbenv-vars
Spring.after_fork do tmp/restart.txt
if ENV['DEBUGGER_STORED_RUBYLIB'] tmp/caching-dev.txt
ENV['DEBUGGER_STORED_RUBYLIB'].split(File::PATH_SEPARATOR).each do |path| ).each { |path| Spring.watch(path) }
next unless path =~ /ruby-debug-ide/
load path + '/ruby-debug-ide/multiprocess/starter.rb'
end
end
end

103
env.example Normal file
View File

@ -0,0 +1,103 @@
# Add application configuration variables here, as shown below.
# Databases
POSTGRES_HOST=localhost
POSTGRES_PASSWORD=
REDIS_HOST=localhost
ELASTICSEARCH_HOST=localhost
# Stripe
SECRET_KEY_BASE=83daf5e7b80d990f037407bab78dff9904aaf3c195a50f84fa8695a22287e707dfbd9524b403b1dcf116ae1d8c06844c3d7ed942564e5b46be6ae3ead93a9d30
STRIPE_API_KEY=
STRIPE_PUBLISHABLE_KEY=
STRIPE_CURRENCY=eur
# Invoices
INVOICE_PREFIX=Demo-FabLab-facture
# FabLab optional modules
FABLAB_WITHOUT_PLANS=false
FABLAB_WITHOUT_SPACES=true
FABLAB_WITHOUT_ONLINE_PAYMENT=false
FABLAB_WITHOUT_INVOICES=false
PHONE_REQUIRED=true
FABLAB_WITHOUT_WALLET=false
BOOK_SLOT_AT_SAME_TIME=true
USER_CONFIRMATION_NEEDED_TO_SIGN_IN=false
EVENTS_IN_CALENDAR=false
SLOT_DURATION=60
FEATURE_TOUR_DISPLAY=once
DEFAULT_MAIL_FROM=Fab-manager Demo <noreply@fab-manager.com>
# Configure carefully!
DEFAULT_HOST=localhost:5000
DEFAULT_PROTOCOL=http
# Email config
DELIVERY_METHOD=smtp
SMTP_ADDRESS=
SMTP_PORT=587
SMTP_USER_NAME=
SMTP_PASSWORD=
SMTP_AUTHENTICATION=plain
SMTP_ENABLE_STARTTLS_AUTO=true
SMTP_OPENSSL_VERIFY_MODE=
SMTP_TLS=false
# Google analytics
GA_ID=
# Google recaptcha
RECAPTCHA_SITE_KEY=
RECAPTCHA_SECRET_KEY=
# Projects comments
DISQUS_SHORTNAME=
# Twitter sharing
TWITTER_NAME=FablabGrenoble
# Facebook sharing
FACEBOOK_APP_ID=
# I18N configuration
RAILS_LOCALE=fr
APP_LOCALE=fr
MOMENT_LOCALE=fr
SUMMERNOTE_LOCALE=fr-FR
ANGULAR_LOCALE=fr-fr
MESSAGEFORMAT_LOCALE=fr
FULLCALENDAR_LOCALE=fr
ELASTICSEARCH_LANGUAGE_ANALYZER=french
TIME_ZONE=Paris
WEEK_STARTING_DAY=monday
D3_DATE_FORMAT=%d/%m/%y
UIB_DATE_FORMAT=dd/MM/yyyy
EXCEL_DATE_FORMAT=dd/mm/yyyy
# OpenLab Projects
OPENLAB_APP_SECRET=
OPENLAB_APP_ID=
OPENLAB_DEFAULT=true
# do not change this URL
OPENLAB_BASE_URI=https://openprojects.fab-manager.com
# System settings
LOG_LEVEL=debug
DISK_SPACE_MB_ALERT=100
SUPERADMIN_EMAIL=admin@sleede.com
ALLOWED_EXTENSIONS=pdf ai eps cad math svg stl dxf dwg obj step iges igs 3dm 3dmf doc docx png ino scad fcad skp sldprt sldasm slddrw slddrt tex latex ps fcstd fcstd1
ALLOWED_MIME_TYPES=application/pdf application/postscript application/illustrator image/x-eps image/svg+xml application/sla application/dxf application/acad application/dwg application/octet-stream application/step application/iges model/iges x-world/x-3dmf application/vnd.openxmlformats-officedocument.wordprocessingml.document image/png text/x-arduino text/plain application/scad application/vnd.sketchup.skp application/x-koan application/vnd-koan koan/x-skm application/vnd.koan application/x-tex application/x-latex application/x-extension-fcstd
# 5242880 = 5 megabytes
MAX_IMPORT_SIZE=5242880
# 10485760 = 10 megabytes
MAX_IMAGE_SIZE=10485760
# 20971520 = 20 megabytes
MAX_CAO_SIZE=20971520

View File

@ -1,7 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
class MembersTest < ActionDispatch::IntegrationTest class MembersTest < ActionDispatch::IntegrationTest
# Called before every test method runs. Can be used # Called before every test method runs. Can be used
# to set up fixture information. # to set up fixture information.
def setup def setup
@ -10,7 +9,6 @@ class MembersTest < ActionDispatch::IntegrationTest
end end
test 'admin creates member' do test 'admin creates member' do
group_id = Group.first.id group_id = Group.first.id
email = 'robert.dubois@gmail.com' email = 'robert.dubois@gmail.com'
@ -54,7 +52,6 @@ class MembersTest < ActionDispatch::IntegrationTest
group_id: 1 group_id: 1
} }.to_json, default_headers } }.to_json, default_headers
# Check response format & status # Check response format & status
assert_equal 422, response.status, response.body assert_equal 422, response.status, response.body
assert_equal Mime::JSON, response.content_type assert_equal Mime::JSON, response.content_type
@ -92,17 +89,17 @@ class MembersTest < ActionDispatch::IntegrationTest
assert_equal instagram, res[:profile][:instagram], "user's social network not updated" assert_equal instagram, res[:profile][:instagram], "user's social network not updated"
end end
test 'admin search for autocompletion of a member s name' do # test 'admin search for autocompletion of a member s name' do
get '/api/members/search/kevin?subscription=true' # get '/api/members/search/kevin?subscription=true'
# Check response format & status ## Check response format & status
assert_equal 200, response.status, response.body # assert_equal 200, response.status, response.body
assert_equal Mime::JSON, response.content_type # assert_equal Mime::JSON, response.content_type
# Check search result ## Check search result
res = json_response(response.body) # res = json_response(response.body)
assert_equal 1, res.length # assert_equal 1, res.length
assert_match /Kevin/, res[0][:name] # assert_match /Kevin/, res[0][:name]
end # end
end end

View File

@ -20,9 +20,6 @@ end
Sidekiq::Testing.fake! Sidekiq::Testing.fake!
Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(color: true)] Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(color: true)]
class ActiveSupport::TestCase class ActiveSupport::TestCase
# Add more helper methods to be used by all tests here... # Add more helper methods to be used by all tests here...
@ -33,7 +30,7 @@ class ActiveSupport::TestCase
end end
def default_headers def default_headers
{ 'Accept' => Mime::JSON, 'Content-Type' => Mime::JSON.to_s } { 'Accept' => Mime[:json], 'Content-Type' => Mime[:json].to_s }
end end
def stripe_payment_method(error: nil) def stripe_payment_method(error: nil)
@ -190,8 +187,8 @@ class ActiveSupport::TestCase
# Parse a line of text read from a PDF file and return the price included inside # Parse a line of text read from a PDF file and return the price included inside
# Line of text should be of form 'Label $10.00' # Line of text should be of form 'Label $10.00'
# @returns {float} # @returns {float}
def parse_amount_from_invoice_line line def parse_amount_from_invoice_line(line)
line[line.rindex(' ')+1..-1].tr(I18n.t('number.currency.format.unit'), '').to_f line[line.rindex(' ') + 1..-1].tr(I18n.t('number.currency.format.unit'), '').to_f
end end
end end