diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8dc4323 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +# See https://git-scm.com/docs/gitattributes for more about git attribute files. + +# Mark the database schema as having been generated. +db/schema.rb linguist-generated + +# Mark any vendored files as having been vendored. +vendor/* linguist-vendored +config/credentials/*.yml.enc diff=rails_credentials +config/credentials.yml.enc diff=rails_credentials diff --git a/.gitignore b/.gitignore index eefb08d..288c5a2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,40 @@ -# See http://help.github.com/ignore-files/ for more about ignoring files. +# See https://help.github.com/articles/ignoring-files for more about ignoring files. # # If you find yourself ignoring temporary files generated by your text editor # or operating system, you probably want to add a global ignore instead: -# git config --global core.excludesfile ~/.gitignore_global +# git config --global core.excludesfile '~/.gitignore_global' -# Ignore bundler config +# Ignore bundler config. /.bundle -# Ignore the default SQLite database. -/db/*.sqlite3 +# Ignore all environment files (except templates). +/.env* +!/.env*.erb # Ignore all logfiles and tempfiles. -/log/*.log -/tmp +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep -# allow individual configurations -config/database.yml \ No newline at end of file +# Ignore pidfiles, but keep the directory. +/tmp/pids/* +!/tmp/pids/ +!/tmp/pids/.keep + +# Ignore storage (uploaded files in development and any SQLite databases). +/storage/* +!/storage/.keep +/tmp/storage/* +!/tmp/storage/ +!/tmp/storage/.keep + +/public/assets + +# Ignore master key for decrypting credentials and more. +/config/master.key + +/app/assets/builds/* +!/app/assets/builds/.keep + +/node_modules diff --git a/.node-version b/.node-version new file mode 100644 index 0000000..7cc2069 --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +20.5.1 diff --git a/.ruby-version b/.ruby-version index 5859406..15a2799 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.2.3 +3.3.0 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c9e9b17..0000000 --- a/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: ruby -rvm: - - 2.2.2 -script: - - cp config/travis.database.yml config/database.yml - - psql -c 'create database ruvetia_test;' -U postgres - - RAILS_ENV=test bundle exec rake db:migrate --trace - - bundle exec rake db:test:prepare - - bundle exec rake diff --git a/Gemfile b/Gemfile index 725c670..4f98199 100644 --- a/Gemfile +++ b/Gemfile @@ -1,25 +1,70 @@ -source 'https://rubygems.org' +source "https://rubygems.org" -ruby '2.2.3' +ruby "3.3.0" -gem 'rails', '~> 4.2.4' +# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" +gem "rails", "~> 7.1.3.3" -gem 'oauth2' -gem 'pg' +# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] +gem "sprockets-rails" -gem 'compass-rails' -gem 'sass-rails', '~> 5.0' -gem 'coffee-rails', '~> 4.1.0' -gem 'font-awesome-rails' -gem 'rails_12factor', group: :production +# Use postgresql as the database for Active Record +gem "pg", "~> 1.1" -# See https://github.com/sstephenson/execjs#readme for more supported runtimes -gem 'therubyracer', platform: :ruby +# Use the Puma web server [https://github.com/puma/puma] +gem "puma", ">= 5.0" -gem 'uglifier', '>= 1.3.0' +# Bundle and transpile JavaScript [https://github.com/rails/jsbundling-rails] +gem "jsbundling-rails" -group :test do - gem 'capybara' +# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev] +gem "turbo-rails" + +# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev] +gem "stimulus-rails" + +# Bundle and process CSS [https://github.com/rails/cssbundling-rails] +gem "cssbundling-rails" + +# Build JSON APIs with ease [https://github.com/rails/jbuilder] +gem "jbuilder" + +# Use Redis adapter to run Action Cable in production +# gem "redis", ">= 4.0.1" + +# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] +# gem "kredis" + +# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] +# gem "bcrypt", "~> 3.1.7" + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem "tzinfo-data", platforms: %i[ windows jruby ] + +# Reduces boot times through caching; required in config/boot.rb +gem "bootsnap", require: false + +# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] +# gem "image_processing", "~> 1.2" + +group :development, :test do + # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem + gem "debug", platforms: %i[ mri windows ] +end + +group :development do + # Use console on exceptions pages [https://github.com/rails/web-console] + gem "web-console" + + # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler] + # gem "rack-mini-profiler" + + # Speed up commands on slow machines / big apps [https://github.com/rails/spring] + # gem "spring" end -gem 'jquery-rails' +group :test do + # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] + gem "capybara" + gem "selenium-webdriver" +end diff --git a/Gemfile.lock b/Gemfile.lock index 9c181a0..e932efb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,193 +1,272 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (4.2.4) - actionpack (= 4.2.4) - actionview (= 4.2.4) - activejob (= 4.2.4) + actioncable (7.1.3.3) + actionpack (= 7.1.3.3) + activesupport (= 7.1.3.3) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (7.1.3.3) + actionpack (= 7.1.3.3) + activejob (= 7.1.3.3) + activerecord (= 7.1.3.3) + activestorage (= 7.1.3.3) + activesupport (= 7.1.3.3) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.1.3.3) + actionpack (= 7.1.3.3) + actionview (= 7.1.3.3) + activejob (= 7.1.3.3) + activesupport (= 7.1.3.3) mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.4) - actionview (= 4.2.4) - activesupport (= 4.2.4) - rack (~> 1.6) - rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.4) - activesupport (= 4.2.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.2) + actionpack (7.1.3.3) + actionview (= 7.1.3.3) + activesupport (= 7.1.3.3) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.3.3) + actionpack (= 7.1.3.3) + activerecord (= 7.1.3.3) + activestorage (= 7.1.3.3) + activesupport (= 7.1.3.3) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.1.3.3) + activesupport (= 7.1.3.3) builder (~> 3.1) - erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - activejob (4.2.4) - activesupport (= 4.2.4) - globalid (>= 0.3.0) - activemodel (4.2.4) - activesupport (= 4.2.4) - builder (~> 3.1) - activerecord (4.2.4) - activemodel (= 4.2.4) - activesupport (= 4.2.4) - arel (~> 6.0) - activesupport (4.2.4) - i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - arel (6.0.3) - builder (3.2.2) - capybara (2.5.0) - mime-types (>= 1.16) - nokogiri (>= 1.3.3) - rack (>= 1.0.0) - rack-test (>= 0.5.4) - xpath (~> 2.0) - chunky_png (1.3.5) - coffee-rails (4.1.0) - coffee-script (>= 2.2.0) - railties (>= 4.0.0, < 5.0) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.9.1.1) - compass (1.0.3) - chunky_png (~> 1.2) - compass-core (~> 1.0.2) - compass-import-once (~> 1.0.5) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9) - sass (>= 3.3.13, < 3.5) - compass-core (1.0.3) - multi_json (~> 1.0) - sass (>= 3.3.0, < 3.5) - compass-import-once (1.0.5) - sass (>= 3.2, < 3.5) - compass-rails (2.0.5) - compass (~> 1.0.0) - sass-rails (< 5.1) - sprockets (< 2.13) - erubis (2.7.0) - execjs (2.6.0) - faraday (0.9.2) - multipart-post (>= 1.2, < 3) - ffi (1.9.10) - font-awesome-rails (4.4.0.0) - railties (>= 3.2, < 5.0) - globalid (0.3.6) - activesupport (>= 4.1.0) - hike (1.2.3) - i18n (0.7.0) - jquery-rails (4.0.5) - rails-dom-testing (~> 1.0) - railties (>= 4.2.0) - thor (>= 0.14, < 2.0) - json (1.8.3) - jwt (1.5.2) - libv8 (3.16.14.13) - loofah (2.0.3) - nokogiri (>= 1.5.9) - mail (2.6.3) - mime-types (>= 1.16, < 3) - mime-types (2.6.2) - mini_portile (0.6.2) - minitest (5.8.2) - multi_json (1.11.2) - multi_xml (0.5.5) - multipart-post (2.0.0) - nokogiri (1.6.6.2) - mini_portile (~> 0.6.0) - oauth2 (1.0.0) - faraday (>= 0.8, < 0.10) - jwt (~> 1.0) - multi_json (~> 1.3) - multi_xml (~> 0.5) - rack (~> 1.2) - pg (0.18.3) - rack (1.6.4) - rack-test (0.6.3) - rack (>= 1.0) - rails (4.2.4) - actionmailer (= 4.2.4) - actionpack (= 4.2.4) - actionview (= 4.2.4) - activejob (= 4.2.4) - activemodel (= 4.2.4) - activerecord (= 4.2.4) - activesupport (= 4.2.4) - bundler (>= 1.3.0, < 2.0) - railties (= 4.2.4) - 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.2) - loofah (~> 2.0) - rails_12factor (0.0.3) - rails_serve_static_assets - rails_stdout_logging - rails_serve_static_assets (0.0.4) - rails_stdout_logging (0.0.4) - railties (4.2.4) - actionpack (= 4.2.4) - activesupport (= 4.2.4) - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (10.4.2) - rb-fsevent (0.9.6) - rb-inotify (0.9.5) - ffi (>= 0.5.0) - ref (2.0.0) - sass (3.4.19) - 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) - sprockets (2.12.4) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sprockets-rails (2.3.3) - actionpack (>= 3.0) - activesupport (>= 3.0) - sprockets (>= 2.8, < 4.0) - therubyracer (0.12.2) - libv8 (~> 3.16.14.0) - ref - thor (0.19.1) - thread_safe (0.3.5) - tilt (1.4.1) - tzinfo (1.2.2) - thread_safe (~> 0.1) - uglifier (2.7.2) - execjs (>= 0.3.0) - json (>= 1.8.0) - xpath (2.0.0) - nokogiri (~> 1.3) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.3.3) + activesupport (= 7.1.3.3) + globalid (>= 0.3.6) + activemodel (7.1.3.3) + activesupport (= 7.1.3.3) + activerecord (7.1.3.3) + activemodel (= 7.1.3.3) + activesupport (= 7.1.3.3) + timeout (>= 0.4.0) + activestorage (7.1.3.3) + actionpack (= 7.1.3.3) + activejob (= 7.1.3.3) + activerecord (= 7.1.3.3) + activesupport (= 7.1.3.3) + marcel (~> 1.0) + activesupport (7.1.3.3) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + minitest (>= 5.1) + mutex_m + tzinfo (~> 2.0) + addressable (2.8.6) + public_suffix (>= 2.0.2, < 6.0) + base64 (0.2.0) + bigdecimal (3.1.8) + bindex (0.8.1) + bootsnap (1.17.0) + msgpack (~> 1.2) + builder (3.2.4) + capybara (3.39.2) + addressable + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + concurrent-ruby (1.3.1) + connection_pool (2.4.1) + crass (1.0.6) + cssbundling-rails (1.3.3) + railties (>= 6.0.0) + date (3.3.4) + debug (1.9.1) + irb (~> 1.10) + reline (>= 0.3.8) + drb (2.2.1) + erubi (1.12.0) + globalid (1.2.1) + activesupport (>= 6.1) + i18n (1.14.5) + concurrent-ruby (~> 1.0) + io-console (0.7.2) + irb (1.13.1) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + jbuilder (2.11.5) + actionview (>= 5.0.0) + activesupport (>= 5.0.0) + jsbundling-rails (1.2.1) + railties (>= 6.0.0) + loofah (2.22.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.4) + matrix (0.4.2) + mini_mime (1.1.5) + minitest (5.23.1) + msgpack (1.7.2) + mutex_m (0.2.0) + net-imap (0.4.11) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.5.0) + net-protocol + nio4r (2.7.3) + nokogiri (1.16.5-aarch64-linux) + racc (~> 1.4) + nokogiri (1.16.5-arm-linux) + racc (~> 1.4) + nokogiri (1.16.5-arm64-darwin) + racc (~> 1.4) + nokogiri (1.16.5-x86-linux) + racc (~> 1.4) + nokogiri (1.16.5-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.16.5-x86_64-linux) + racc (~> 1.4) + pg (1.5.4) + psych (5.1.2) + stringio + public_suffix (5.0.4) + puma (6.4.0) + nio4r (~> 2.0) + racc (1.8.0) + rack (3.0.11) + rack-session (2.0.0) + rack (>= 3.0.0) + rack-test (2.1.0) + rack (>= 1.3) + rackup (2.1.0) + rack (>= 3) + webrick (~> 1.8) + rails (7.1.3.3) + actioncable (= 7.1.3.3) + actionmailbox (= 7.1.3.3) + actionmailer (= 7.1.3.3) + actionpack (= 7.1.3.3) + actiontext (= 7.1.3.3) + actionview (= 7.1.3.3) + activejob (= 7.1.3.3) + activemodel (= 7.1.3.3) + activerecord (= 7.1.3.3) + activestorage (= 7.1.3.3) + activesupport (= 7.1.3.3) + bundler (>= 1.15.0) + railties (= 7.1.3.3) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (7.1.3.3) + actionpack (= 7.1.3.3) + activesupport (= 7.1.3.3) + irb + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rake (13.2.1) + rdoc (6.7.0) + psych (>= 4.0.0) + regexp_parser (2.8.3) + reline (0.5.8) + io-console (~> 0.5) + rexml (3.2.6) + rubyzip (2.3.2) + selenium-webdriver (4.16.0) + rexml (~> 3.2, >= 3.2.5) + rubyzip (>= 1.2.2, < 3.0) + websocket (~> 1.0) + sprockets (4.2.1) + concurrent-ruby (~> 1.0) + rack (>= 2.2.4, < 4) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + sprockets (>= 3.0.0) + stimulus-rails (1.3.0) + railties (>= 6.0.0) + stringio (3.1.0) + thor (1.3.1) + timeout (0.4.1) + turbo-rails (1.5.0) + actionpack (>= 6.0.0) + activejob (>= 6.0.0) + railties (>= 6.0.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + web-console (4.2.1) + actionview (>= 6.0.0) + activemodel (>= 6.0.0) + bindex (>= 0.4.0) + railties (>= 6.0.0) + webrick (1.8.1) + websocket (1.2.10) + websocket-driver (0.7.6) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.6.15) PLATFORMS - ruby + aarch64-linux + arm-linux + arm64-darwin + x86-linux + x86_64-darwin + x86_64-linux DEPENDENCIES + bootsnap capybara - coffee-rails (~> 4.1.0) - compass-rails - font-awesome-rails - jquery-rails - oauth2 - pg - rails (~> 4.2.4) - rails_12factor - sass-rails (~> 5.0) - therubyracer - uglifier (>= 1.3.0) + cssbundling-rails + debug + jbuilder + jsbundling-rails + pg (~> 1.1) + puma (>= 5.0) + rails (~> 7.1.3.3) + selenium-webdriver + sprockets-rails + stimulus-rails + turbo-rails + tzinfo-data + web-console + +RUBY VERSION + ruby 3.3.0p0 BUNDLED WITH - 1.10.6 + 2.5.3 diff --git a/Procfile.dev b/Procfile.dev new file mode 100644 index 0000000..7eaba23 --- /dev/null +++ b/Procfile.dev @@ -0,0 +1,2 @@ +web: env RUBY_DEBUG_OPEN=true bin/rails server +css: bun run build:css --watch diff --git a/Rakefile b/Rakefile index 85025f8..9a5ea73 100644 --- a/Rakefile +++ b/Rakefile @@ -1,7 +1,6 @@ -#!/usr/bin/env rake # 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 File.expand_path('../config/application', __FILE__) +require_relative "config/application" -Ruvetia::Application.load_tasks +Rails.application.load_tasks diff --git a/app/mailers/.gitkeep b/app/assets/builds/.keep similarity index 100% rename from app/mailers/.gitkeep rename to app/assets/builds/.keep diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js new file mode 100644 index 0000000..9a99757 --- /dev/null +++ b/app/assets/config/manifest.js @@ -0,0 +1,2 @@ +//= link_tree ../images +//= link_tree ../builds diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js deleted file mode 100644 index 9097d83..0000000 --- a/app/assets/javascripts/application.js +++ /dev/null @@ -1,15 +0,0 @@ -// This is a manifest file that'll be compiled into application.js, which will include all the files -// listed below. -// -// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, -// or vendor/assets/javascripts of plugins, if any, 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 -// the compiled file. -// -// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD -// GO AFTER THE REQUIRES BELOW. -// -//= require jquery -//= require jquery_ujs -//= require_tree . diff --git a/app/assets/javascripts/pages.js.coffee b/app/assets/javascripts/pages.js.coffee deleted file mode 100644 index e38094b..0000000 --- a/app/assets/javascripts/pages.js.coffee +++ /dev/null @@ -1,3 +0,0 @@ -$ -> - map_height = $(".meetups").height() - $(".map").height(map_height) diff --git a/app/assets/stylesheets/_compass.scss b/app/assets/stylesheets/_compass.scss new file mode 100644 index 0000000..309d8d3 --- /dev/null +++ b/app/assets/stylesheets/_compass.scss @@ -0,0 +1,51 @@ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font: inherit; + font-size: 100%; + vertical-align: baseline; +} + +html { + line-height: 1; +} + +ol, ul { + list-style: none; +} + +table { + border-collapse: collapse; + border-spacing: 0; +} + +caption, th, td { + text-align: left; + font-weight: normal; + vertical-align: middle; +} + +q, blockquote { + quotes: none; +} +q:before, q:after, blockquote:before, blockquote:after { + content: ""; + content: none; +} + +a img { + border: none; +} diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css deleted file mode 100644 index deb48cc..0000000 --- a/app/assets/stylesheets/application.css +++ /dev/null @@ -1,3 +0,0 @@ -/* -*= require initializer -*/ diff --git a/app/assets/stylesheets/application.sass.scss b/app/assets/stylesheets/application.sass.scss new file mode 100644 index 0000000..d1e0014 --- /dev/null +++ b/app/assets/stylesheets/application.sass.scss @@ -0,0 +1,20 @@ +@import "compass"; +@import "base/grid"; +@import "base/variables"; +@import "generic/buttons"; +@import "generic/ribbons"; +@import "generic/typography"; +@import "modules/main"; + +html { + min-height: 100%; + height: auto !important; +} + +body { + background-size: 100% 100%; + background-color: $red; + background-repeat: no-repeat; + margin: 0; + padding: 0; +} diff --git a/app/assets/stylesheets/base/grid.css.sass b/app/assets/stylesheets/base/grid.css.sass deleted file mode 100644 index f55488d..0000000 --- a/app/assets/stylesheets/base/grid.css.sass +++ /dev/null @@ -1,34 +0,0 @@ -.wrapper - width: 840px - margin: 0 auto - -.inner - padding: 0 20px - -.left - float: left - -.right - float: right - -.clear - clear: both - -.center - text-align: center - -* - position: relative - -@media (max-width: 1070px) - - .wrapper - width: 100% - - .inner - padding: 0 100px - -@media (max-width: 720px) - - .inner - padding: 0 20px diff --git a/app/assets/stylesheets/base/grid.scss b/app/assets/stylesheets/base/grid.scss new file mode 100644 index 0000000..e8365b7 --- /dev/null +++ b/app/assets/stylesheets/base/grid.scss @@ -0,0 +1,44 @@ +.wrapper { + width: 840px; + margin: 0 auto; +} + +.inner { + padding: 0 20px; +} + +.left { + float: left; +} + +.right { + float: right; +} + +.clear { + clear: both; +} + +.center { + text-align: center; +} + +* { + position: relative; +} + +@media (max-width: 1070px) { + .wrapper { + width: 100%; + } + + .inner { + padding: 0 100px; + } +} + +@media (max-width: 720px) { + .inner { + padding: 0 20px; + } +}; diff --git a/app/assets/stylesheets/base/variables.css.sass b/app/assets/stylesheets/base/variables.scss similarity index 62% rename from app/assets/stylesheets/base/variables.css.sass rename to app/assets/stylesheets/base/variables.scss index ce20552..37ae6d1 100644 --- a/app/assets/stylesheets/base/variables.css.sass +++ b/app/assets/stylesheets/base/variables.scss @@ -1,7 +1,7 @@ // Fonts -$default-font-family: "proxima-nova", "Helvetica", "Arial", sans-serif +$default-font-family: "proxima-nova", "Helvetica", "Arial", sans-serif; // Colors -$black: #444 -$red: #E42F2F -$gray: #444 +$black: #444; +$red: #E42F2F; +$gray: #444; diff --git a/app/assets/stylesheets/generic/buttons.css.sass b/app/assets/stylesheets/generic/buttons.css.sass deleted file mode 100644 index 38edc37..0000000 --- a/app/assets/stylesheets/generic/buttons.css.sass +++ /dev/null @@ -1,24 +0,0 @@ -.btn - padding: 7px 12px - color: #fff !important - background: $red - width: auto - text-decoration: none - font-weight: 600 - border-bottom: 4px solid $red - #333 - +text-shadow($red - #333 0 -1px 1px) - display: block - &:hover - background: $red + #111 - &:active - margin-top: 1px - border: 1px solid $red - #333 - border-top: 4px solid $red - #333 - border-bottom: 0 - background: $red - -.btn-join - width: 300px - text-align: center - margin-left: auto - margin-right: auto diff --git a/app/assets/stylesheets/generic/buttons.scss b/app/assets/stylesheets/generic/buttons.scss new file mode 100644 index 0000000..5aef445 --- /dev/null +++ b/app/assets/stylesheets/generic/buttons.scss @@ -0,0 +1,30 @@ +.btn { + padding: 7px 12px; + color: #fff !important; + background: $red; + width: auto; + text-decoration: none; + font-weight: 600; + border-bottom: 4px solid darken($red, 10%); + text-shadow: lighten($red, 10%) 0 -1px 1px; + display: block; + + &:hover { + background: darken($red, 3%); + } + + &:active { + margin-top: 1px; + border: 1px solid lighten($red, 10%); + border-top: 4px solid lighten($red, 10%); + border-bottom: 0; + background: $red; + } +} + +.btn-join { + width: 300px; + text-align: center; + margin-left: auto; + margin-right: auto; +} diff --git a/app/assets/stylesheets/generic/ribbons.css.sass b/app/assets/stylesheets/generic/ribbons.css.sass deleted file mode 100644 index f0e51db..0000000 --- a/app/assets/stylesheets/generic/ribbons.css.sass +++ /dev/null @@ -1,165 +0,0 @@ -.fancy-divider - font-weight: 900 - line-height: 0 - color: #f7f7f7 - width: 340px - z-index: 999999 - position: absolute - left: 50% - margin-left: -170px - margin-top: -30px - font-size: 24px - text-align: center - +text-shadow($gray - #333 0 -1px 1px) - -@media (max-width: 720px) - .fancy-divider - width: 50% - margin-left: -25% - font-size: 16px - white-space: nowrap - -/* ribbon style */ - -.ribbon-wrapper - - .ribbon-front - background: $gray - width: 300px - padding: 30px 15px - position: relative - z-index: 2 - - .ribbon-front, - .ribbon-back-left, - .ribbon-back-right - +box-shadow(rgba(0,0,0,0.5) 0 0 3px) - - .ribbon-edge-topleft, - .ribbon-edge-topright, - .ribbon-edge-bottomleft, - .ribbon-edge-bottomright - position: absolute - z-index: 1 - border-style: solid - height: 0px - width: 0px - - .ribbon-edge-topleft, - .ribbon-edge-topright - - .ribbon-edge-bottomleft, - .ribbon-edge-bottomright - top: 60px - - .ribbon-edge-bottomleft - border-color: transparent $gray - #222 transparent transparent - - .ribbon-edge-topleft - border-width: 0 - - .ribbon-edge-bottomleft - border-width: 0 10px 5px 0 - - .ribbon-edge-bottomright - left: 320px - border-color: transparent transparent transparent $gray - #222 - - .ribbon-edge-topright - border-width: 0 - - .ribbon-edge-bottomright - border-width: 0 0 5px 10px - - .ribbon-back-left, .ribbon-back-right - position: absolute - top: 15px - width: 50px - height: 50px - background-color: $gray - z-index: 0 - - .ribbon-back-left - left: -40px - - .ribbon-back-right - right: -30px - -.ribbon-mixed-1 - - .ribbon-edge-topleft - border-color: transparent $gray - #222 transparent transparent - - .ribbon-edge-topleft - top: -5px - border-width: 5px 10px 0 0 - - .ribbon-edge-bottomleft - border-width: 0 - - .ribbon-back-left - top: -5px - -.ribbon-mixed-2 - - .ribbon-edge-topright - left: 320px - border-color: transparent transparent transparent $gray - #222 - - .ribbon-edge-topright - top: -5px - border-width: 5px 0 0 10px - - .ribbon-edge-bottomright - border-width: 0 - - .ribbon-back-right - top: -5px - -.ribbon-top - margin-top: -10px - -.ribbon-bottom - margin-top: 10px - - .ribbon-edge-topleft - border-color: transparent $gray - #222 transparent transparent - - .ribbon-edge-topleft - top: -5px - border-width: 5px 10px 0 0 - - .ribbon-edge-bottomleft - border-width: 0 - - .ribbon-edge-topright - left: 320px - border-color: transparent transparent transparent $gray - #222 - - .ribbon-edge-topright - top: -5px - border-width: 5px 0 0 10px - - .ribbon-edge-bottomright - border-width: 0 - - .ribbon-back-left - top: -5px - - .ribbon-back-right - top: -5px - -@media (max-width: 720px) - - .ribbon-wrapper - .ribbon-front - width: 90% - padding: auto 5% - - .ribbon-back-right - right: -40px - - .ribbon-edge-bottomright, .ribbon-edge-topright - left: auto - right: -40px - margin-right: 40px diff --git a/app/assets/stylesheets/generic/ribbons.scss b/app/assets/stylesheets/generic/ribbons.scss new file mode 100644 index 0000000..31eb72c --- /dev/null +++ b/app/assets/stylesheets/generic/ribbons.scss @@ -0,0 +1,202 @@ +.fancy-divider { + font-weight: 900; + line-height: 0; + color: #f7f7f7; + width: 340px; + z-index: 999999; + position: absolute; + left: 50%; + margin-left: -170px; + margin-top: -30px; + font-size: 24px; + text-align: center; + text-shadow: lighten($gray, 10%) 0 -1px 1px; +} + +@media (max-width: 720px) { + .fancy-divider { + width: 50%; + margin-left: -25%; + font-size: 16px; + white-space: nowrap; + } +}; + +/* ribbon style */ + +.ribbon-wrapper { + .ribbon-front { + background: $gray; + width: 300px; + padding: 30px 15px; + position: relative; + z-index: 2; + } + + .ribbon-front, + .ribbon-back-left, + .ribbon-back-right { + box-shadow: rgba(0,0,0,0.5) 0 0 3px; + } + + .ribbon-edge-topleft, + .ribbon-edge-topright, + .ribbon-edge-bottomleft, + .ribbon-edge-bottomright { + position: absolute; + z-index: 1; + border-style: solid; + height: 0px; + width: 0px; + } + + .ribbon-edge-bottomleft, + .ribbon-edge-bottomright { + top: 60px; + } + + .ribbon-edge-bottomleft { + border-color: transparent lighten($gray, 6%) transparent transparent; + } + + .ribbon-edge-topleft { + border-width: 0; + } + + .ribbon-edge-bottomleft { + border-width: 0 10px 5px 0; + } + + .ribbon-edge-bottomright { + left: 320px; + border-color: transparent transparent transparent lighten($gray, 6%); + } + + .ribbon-edge-topright { + border-width: 0; + } + + .ribbon-edge-bottomright { + border-width: 0 0 5px 10px; + } + + .ribbon-back-left, + .ribbon-back-right { + position: absolute; + top: 15px; + width: 50px; + height: 50px; + background-color: $gray; + z-index: 0; + } + + .ribbon-back-left { + left: -40px; + } + + .ribbon-back-right { + right: -30px; + } +} + +.ribbon-mixed-1 { + .ribbon-edge-topleft { + border-color: transparent ligthen($gray, 6%) transparent transparent; + } + + .ribbon-edge-topleft { + top: -5px; + border-width: 5px 10px 0 0; + } + + .ribbon-edge-bottomleft { + border-width: 0; + } + + .ribbon-back-left { + top: -5px; + } +} + +.ribbon-mixed-2 { + .ribbon-edge-topright { + left: 320px; + border-color: transparent transparent transparent lighten($gray, 6%); + } + + .ribbon-edge-topright { + top: -5px; + border-width: 5px 0 0 10px; + } + + .ribbon-edge-bottomright { + border-width: 0; + } + + .ribbon-back-right { + top: -5px; + } +} + +.ribbon-top { + margin-top: -10px; +} + +.ribbon-bottom { + margin-top: 10px; + + .ribbon-edge-topleft { + border-color: transparent lighten($gray, 6%) transparent transparent; + } + + .ribbon-edge-topleft { + top: -5px; + border-width: 5px 10px 0 0; + } + + .ribbon-edge-bottomleft { + border-width: 0; + } + + .ribbon-edge-topright { + left: 320px; + border-color: transparent transparent transparent lighten($gray, 6%); + } + + .ribbon-edge-topright { + top: -5px; + border-width: 5px 0 0 10px; + } + + .ribbon-edge-bottomright { + border-width: 0; + } + + .ribbon-back-left { + top: -5px; + } + + .ribbon-back-right { + top: -5px; + } +} + +@media (max-width: 720px) { + .ribbon-wrapper { + .ribbon-front { + width: 90%; + padding: auto 5%; + } + + .ribbon-back-right { + right: -40px; + } + + .ribbon-edge-bottomright, + .ribbon-edge-topright { + left: auto; + right: -40px; + margin-right: 40px; + } + } +}; diff --git a/app/assets/stylesheets/generic/typography.css.sass b/app/assets/stylesheets/generic/typography.css.sass deleted file mode 100644 index c28d0d6..0000000 --- a/app/assets/stylesheets/generic/typography.css.sass +++ /dev/null @@ -1,49 +0,0 @@ -body - font-family: $default-font-family - font-size: 18px - line-height: 26px - color: #fff - -b, strong - font-weight: 600 - -i, em - font-style: italic - -a - font-weight: 300 - text-decoration: underline - -h1 - font-size: 50px - line-height: 62px - font-weight: 900 - -h2 - font-size: 18px - font-weight: 600 - -h3 - font-weight: 800 - -p - font-size: 18px - line-height: 28px - font-style: normal - font-weight: 300 - -li - font-weight: 300 - -.align-left - float: left - padding-right: 7px - -.align-right - float: right - padding-left: 7px - -@media (max-width: 720px) - body - font-size: 16px - line-height: 24px diff --git a/app/assets/stylesheets/generic/typography.scss b/app/assets/stylesheets/generic/typography.scss new file mode 100644 index 0000000..062636e --- /dev/null +++ b/app/assets/stylesheets/generic/typography.scss @@ -0,0 +1,64 @@ +body { + font-family: $default-font-family; + font-size: 18px; + line-height: 26px; + color: #fff; +} + +b, +strong { + font-weight: 600; +} + +i, +em { + font-style: italic; +} + +a { + font-weight: 300; + text-decoration: underline; +} + +h1 { + font-size: 50px; + line-height: 62px; + font-weight: 900; +} + +h2 { + font-size: 18px; + font-weight: 600; +} + +h3 { + font-weight: 800; +} + +p { + font-size: 18px; + line-height: 28px; + font-style: normal; + font-weight: 300; +} + +li { + font-weight: 300; +} + +.align-left { + float: left; + padding-right: 7px; +} + +.align-right { + float: right; + padding-left: 7px; +} + +@media (max-width: 720px) { + body { + font-size: 16px; + line-height: 24px; + } +}; diff --git a/app/assets/stylesheets/initializer.css.sass b/app/assets/stylesheets/initializer.css.sass deleted file mode 100644 index e5ff6ff..0000000 --- a/app/assets/stylesheets/initializer.css.sass +++ /dev/null @@ -1,17 +0,0 @@ -@import "compass/reset" -@import "compass" -@import "font-awesome" -@import "base/*" -@import "generic/*" -@import "modules/*" - -html - min-height: 100% - height: auto !important - -body - background-size: 100% 100% - background-color: $red - background-repeat: no-repeat - margin: 0 - padding: 0 diff --git a/app/assets/stylesheets/modules/main.css.sass b/app/assets/stylesheets/modules/main.css.sass deleted file mode 100644 index 660301b..0000000 --- a/app/assets/stylesheets/modules/main.css.sass +++ /dev/null @@ -1,205 +0,0 @@ -section.section - padding: 180px 0 - -section.red - background: $red - color: #fff - a - color: #fff - &:hover - color: #000 - i - color: #fff - &:hover - color: #000 - -section.white - background: #fff - color: #000 - a - color: #000 - &:hover - color: $red - i - color: #000 - &:hover - color: $red - -section.logo - text-align: center - padding-bottom: 225px - .logo-big - width: 250px - -section.intro-text - .signature - padding-bottom: 40px - -section.meetups - - height: 700px - - a - color: white - - .map - vertical-align: sub - width: 100% - height: 100% - - h3 - font-size: 27px - .meetup-info - width: 300px - padding: 50px - z-index: 1000 - position: absolute - background: #000 /* fallback */ - top: 100px - left: 10% - text-align: center - +background(rgba(0,0,0,0.8)) - .meetup-signup - margin: 20px 0 - -section.team - - li - padding: 0 0 40px 0 - - img.avatar - +border-radius(100%) - height: 130px - width: 130px - - .member-image - text-align: center - position: relative - display: inline-block - width: 130px - padding-top: 5px - vertical-align: top - - .member-info - display: inline-block - padding-left: 40px - width: 625px - position: relative - - .member-social-links - li - display: inline - - a - text-decoration: none - - &:last-child - padding-bottom: 0 - -section.more-info - ul - text-align: center - li - display: inline - padding: 0 10px 0 10px - - a - text-decoration: none - font-size: 44px - line-height: 52px - - ul.pseudo-footer - margin-top: 40px - - li - font-size: 16px - line-height: 26px - display: block - padding: 0 10px 0 10px - - a - font-size: 16px - line-height: 26px - text-decoration: underline - - -.social-media-links - +horizontal-list - a - text-decoration: none - -@media (max-width: 1070px) - - section.section - padding: 135px 0 - - section.logo - padding-bottom: 180px - - section.team - - img.avatar - width: 100% - height: auto - - .member-image - width: 20% - - .member-info - padding-left: 9% - width: 70% - -@media (max-width: 720px) - - h1 - font-size: 28px - - section.section - padding: 90px 0 - - section.logo - padding-bottom: 135px - .logo-big - width: 120px - - section.meetups - - height: 500px - - .meetup-info - width: 76% - left: 10% - padding: 20px 2% - top: auto - bottom: 80px - .btn - width: 50% - margin: 0 auto - - section.team - - img.avatar - width: 130px - - .member-image - width: 100% - margin-bottom: 20px - - .member-info - width: 100% - padding: 0 0 - - section.more-info - ul - li - a - font-size: 24px - line-height: 32px - - ul.pseudo-footer - li - font-size: 14px - line-height: 22px - a - font-size: 14px - line-height: 22px diff --git a/app/assets/stylesheets/modules/main.scss b/app/assets/stylesheets/modules/main.scss new file mode 100644 index 0000000..cdfd6b5 --- /dev/null +++ b/app/assets/stylesheets/modules/main.scss @@ -0,0 +1,270 @@ +section.section { + padding: 180px 0; +} +section.red { + background: $red; + color: #fff; + + a { + color: #fff; + + &:hover { + color: #000; + } + } + + i { + color: #fff; + + &:hover { + color: #000; + } + } +} +section.white { + background: #fff; + color: #000; + + a { + color: #000; + + &:hover { + color: $red; + } + } + + i { + color: #000; + + &:hover { + color: $red; + } + } +} +section.logo { + text-align: center; + padding-bottom: 225px; + + .logo-big { + width: 250px; + } +} +section.intro-text { + .signature { + padding-bottom: 40px; + } +} + +section.meetups { + height: 700px; + + a { + color: white; + } + + .map { + vertical-align: sub; + width: 100%; + height: 100%; + } + + h3 { + font-size: 27px; + } + + .meetup-info { + width: 300px; + padding: 50px; + z-index: 1000; + position: absolute; + background: #000; + top: 100px; + left: 10%; + text-align: center; + background: rgba(0,0,0,0.8); + } + + .meetup-signup { + margin: 20px 0; + } +} + +section.team { + li { + padding: 0 0 40px 0; + } + + img.avatar { + border-radius: 100%; + height: 130px; + width: 130px; + } + + .member-image { + text-align: center; + position: relative; + display: inline-block; + width: 130px; + padding-top: 5px; + vertical-align: top; + } + + .member-info { + display: inline-block; + padding-left: 40px; + width: 625px; + position: relative; + } + + .member-social-links { + li { + display: inline; + + a { + text-decoration: none; + } + } + } + + &:last-child { + padding-bottom: 0; + } +} + +section.more-info { + ul { + text-align: center; + + li { + display: inline; + padding: 0 10px 0 10px; + + a { + text-decoration: none; + font-size: 44px; + line-height: 52px; + } + } + } + + ul.pseudo-footer { + margin-top: 40px; + + li { + font-size: 16px; + line-height: 26px; + display: block; + padding: 0 10px 0 10px; + + a { + font-size: 16px; + line-height: 26px; + text-decoration: underline; + } + } + } +} + +.social-media-links { + a { + text-decoration: none; + } +} + +@media (max-width: 1070px) { + section.section { + padding: 135px 0; + } + + section.logo { + padding-bottom: 180px; + } + + section.team { + img.avatar { + width: 100%; + height: auto; + } + + .member-image { + width: 20%; + } + + .member-info { + padding-left: 9%; + width: 70%; + } + } +} + +@media (max-width: 720px) { + h1 { + font-size: 28px; + } + + section.section { + padding: 90px 0; + } + + section.logo { + padding-bottom: 135px; + .logo-big { + width: 120px; + } + } + + section.meetups { + height: 500px; + + .meetup-info { + width: 76%; + left: 10%; + padding: 20px 2%; + top: auto; + bottom: 80px; + .btn { + width: 50%; + margin: 0 auto; + } + } + } + + section.team { + img.avatar { + width: 130px; + } + + .member-image { + width: 100%; + margin-bottom: 20px; + } + + .member-info { + width: 100%; + padding: 0 0; + } + } + + section.more-info { + ul { + li { + a { + font-size: 24px; + line-height: 32px; + } + } + } + + ul.pseudo-footer { + li { + font-size: 14px; + line-height: 22px; + + a { + font-size: 14px; + line-height: 22px; + } + } + } + } +}; diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb new file mode 100644 index 0000000..d672697 --- /dev/null +++ b/app/channels/application_cable/channel.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Channel < ActionCable::Channel::Base + end +end diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb new file mode 100644 index 0000000..0ff5442 --- /dev/null +++ b/app/channels/application_cable/connection.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Connection < ActionCable::Connection::Base + end +end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 76f78fe..3ab874f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -19,13 +19,13 @@ def current_user helper_method :current_user def ruvetia_meetups - $meetups + Meetup.all end private :ruvetia_meetups helper_method :ruvetia_meetups def ruvetia_team - $team + Team.all end private :ruvetia_team helper_method :ruvetia_team diff --git a/app/models/.gitkeep b/app/controllers/concerns/.keep similarity index 100% rename from app/models/.gitkeep rename to app/controllers/concerns/.keep diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 0e317cc..1361cbb 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -1,5 +1,4 @@ class PagesController < ApplicationController - def home @title = "Home" end @@ -7,5 +6,4 @@ def home def team @title = "Team" end - end diff --git a/app/controllers/participations_controller.rb b/app/controllers/participations_controller.rb index 10fe3d6..fd7919d 100644 --- a/app/controllers/participations_controller.rb +++ b/app/controllers/participations_controller.rb @@ -1,10 +1,12 @@ class ParticipationsController < ApplicationController def index - @meetup = $meetups.detect {|m| m.id == params[:meetup].to_i} - attendees = @meetup.participants.map {|p| - { "name" => p.name, - "github" => p.github_login} + @meetup = Meetup.all.detect { |m| m.id == params[:meetup].to_i } + attendees = @meetup.participants.map { |p| + { + "name" => p.name, + "github" => p.github_login + } } render json: JSON.pretty_generate(attendees) end diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb new file mode 100644 index 0000000..d394c3d --- /dev/null +++ b/app/jobs/application_job.rb @@ -0,0 +1,7 @@ +class ApplicationJob < ActiveJob::Base + # Automatically retry jobs that encountered a deadlock + # retry_on ActiveRecord::Deadlocked + + # Most jobs are safe to ignore if the underlying records are no longer available + # discard_on ActiveJob::DeserializationError +end diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb new file mode 100644 index 0000000..3c34c81 --- /dev/null +++ b/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: "from@example.com" + layout "mailer" +end diff --git a/app/models/application_record.rb b/app/models/application_record.rb new file mode 100644 index 0000000..b63caeb --- /dev/null +++ b/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + primary_abstract_class +end diff --git a/app/models/auth/github.rb b/app/models/auth/github.rb index 6af1d16..d43ef04 100644 --- a/app/models/auth/github.rb +++ b/app/models/auth/github.rb @@ -3,8 +3,10 @@ module Github extend self def authorize_url - client.auth_code.authorize_url(:redirect_uri => callback_url, - :scope => github_scopes) + client.auth_code.authorize_url( + redirect_uri: callback_url, + scope: github_scopes + ) end def access_token(code) @@ -16,16 +18,19 @@ def user_data(token) end def client - OAuth2::Client.new(ENV['RUVETIA_GITHUB_TOKEN'], - ENV['RUVETIA_GITHUB_SECRET'], - { - site: 'https://api.github.com', - authorize_url: 'https://github.com/login/oauth/authorize', - token_url: 'https://github.com/login/oauth/access_token' - }) + OAuth2::Client.new( + ENV['RUVETIA_GITHUB_TOKEN'], + ENV['RUVETIA_GITHUB_SECRET'], + { + site: 'https://api.github.com', + authorize_url: 'https://github.com/login/oauth/authorize', + token_url: 'https://github.com/login/oauth/access_token' + } + ) end private + def github_scopes 'user:email' end diff --git a/app/models/bbq.rb b/app/models/bbq.rb index 1d5d32e..b23e342 100644 --- a/app/models/bbq.rb +++ b/app/models/bbq.rb @@ -1,4 +1,4 @@ -class Bbq < Meetup +class BBQ < Meetup def title @attributes[:title] || "BBQ.rb ##{@number}" end diff --git a/lib/assets/.gitkeep b/app/models/concerns/.keep similarity index 100% rename from lib/assets/.gitkeep rename to app/models/concerns/.keep diff --git a/app/models/meetup.rb b/app/models/meetup.rb index e3790c0..a47f42f 100644 --- a/app/models/meetup.rb +++ b/app/models/meetup.rb @@ -1,5 +1,4 @@ class Meetup - attr_reader :id, :number, :title, :city, :time, :location, :map_src def initialize(attributes = {}) @@ -21,10 +20,85 @@ def date end def participants - Member.joins(:participations). + Member.distinct.joins(:participations). select('members.*, participations.created_at'). where('meetup_id = ?', @id). - uniq. order('participations.created_at') end + + def self.all + [ + Meetup.new( + id: 8, + number: 8, + city: "Basel", + location: "Werk 8", + time: "08.05.2015 18:00", + map_src: "https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d5386.645932126084!2d7.594735293498037!3d47.54204262705834!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x4791b845fdb2acb3%3A0xcff581105a20a660!2sKantensprung+AG!5e0!3m2!1sen!2sch!4v1430826614995" + ), + + Meetup.new( + id: 7, + number: 7, + city: "Luzern", + location: "Havanna Café & Bar", + time: "31.10.2014 18:00", + map_src: "https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2718.6405381720174!2d8.307837999999993!3d47.047284!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x478ffba3cb1edf03%3A0x76e591b5fb5cb3c9!2sHavanna+Caf%C3%A9+%2B+Bar+GmbH!5e0!3m2!1sen!2sch!4v1413905565712" + ), + + Meetup.new( + id: 6, + number: 6, + city: "Bern", + location: "Musigbistrot", + time: "13.06.2014 18:00", + map_src: "https://maps.google.ch/maps?q=musigbistrot+bern,+M%C3%BChlemattstrasse,+Bern&hl=de&ie=UTF8&ll=46.944769,7.433066&spn=0.009419,0.017209&sll=46.946161,7.432938&sspn=0.009419,0.017209&oq=musigbi&hq=musigbistrot+bern,+M%C3%BChlemattstrasse,+Bern&t=m&z=16" + ), + + Meetup.new( + id: 5, + number: 4, + city: "Lausanne", + location: "Café Saint Pierre", + time: "04.10.2013 18:30", + map_src: "https://maps.google.ch/maps?q=Caf%C3%A9+Saint+Pierre,+Place+Benjamin-Constant,+Lausanne&hl=de&ie=UTF8&sll=46.835845,7.658535&sspn=1.275764,2.661438&oq=cafe+saint+pierr&hq=Caf%C3%A9+Saint+Pierre,&hnear=Place+Benjamin-Constant,+Lausanne,+Vaud&t=m&z=16" + ), + + BBQ.new( + id: 4, + number: 3, + city: "Bern", + location: "A de Aare", + time: "31.08.2013 12:00", + map_src: "https://maps.google.ch/maps?q=46.981658,7.446174&hl=de&sll=46.813187,8.22421&sspn=2.552665,5.559082&t=m&z=16" + ), + + Meetup.new( + id: 3, + number: 3, + city: "Zug", + location: "im Hof", + time: "12.07.2013 18:00", + map_src: "https://maps.google.ch/maps?q=Savi+im+Hof+GmbH&hl=de&ll=47.173845,8.511915&spn=0.037516,0.080509&cid=4429921772654024681&gl=CH&t=m&z=14&iwloc=A" + ), + + Meetup.new( + id: 2, + number: 2, + city: "Basel", + location: "eoipso", + time: "03.05.2013 18:00", + map_src: "https://maps.google.com/maps?q=eoipso&hl=en&ll=47.550927,7.593269&spn=0.081913,0.181103&sll=31.428663,-82.880859&sspn=49.27302,92.724609&hq=eoipso&radius=15000&t=m&z=13&iwloc=A" + ), + + Meetup.new( + id: 1, + number: 1, + city: "Bern", + location: "Musigbistrot", + time: "15.03.2013 18:00", + map_src: "https://maps.google.ch/maps?q=musigbistrot+bern,+M%C3%BChlemattstrasse,+Bern&hl=de&ie=UTF8&ll=46.944769,7.433066&spn=0.009419,0.017209&sll=46.946161,7.432938&sspn=0.009419,0.017209&oq=musigbi&hq=musigbistrot+bern,+M%C3%BChlemattstrasse,+Bern&t=m&z=16" + ) + ] + end end diff --git a/app/models/member.rb b/app/models/member.rb index e773940..dbd2b45 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -1,5 +1,4 @@ -class Member < ActiveRecord::Base - +class Member < ApplicationRecord has_many :participations validates :name, presence: true @@ -15,7 +14,7 @@ def cancel(meetup_id) end def attends?(meetup_id) - participations.pluck(:meetup_id).include? meetup_id.to_i + participations.pluck(:meetup_id).include?(meetup_id.to_i) end def self.find_by_github_id(github_id) @@ -24,11 +23,14 @@ def self.find_by_github_id(github_id) def self.from_github_data(token, data) user = find_by_github_id(data["id"]) - user ||= Member.create!(name: data.fetch("name", data["login"]), - email: data["email"], - github_id: data["id"], - github_login: data["login"], - github_oauth_token: token) + user ||= Member.create!( + name: data.fetch("name", data["login"]), + email: data["email"], + github_id: data["id"], + github_login: data["login"], + github_oauth_token: token + ) + user end end diff --git a/app/models/organizer.rb b/app/models/organizer.rb index eb8dea6..c9296c4 100644 --- a/app/models/organizer.rb +++ b/app/models/organizer.rb @@ -1,5 +1,4 @@ class Organizer - attr_reader :nick, :name, :bio, :social_media def initialize(nick, name, attributes = {}) @@ -11,11 +10,10 @@ def initialize(nick, name, attributes = {}) end def image_url - "http://www.gravatar.com/avatar/%s?s=%s" % [@gravatar_hash, image_size] + "https://www.gravatar.com/avatar/%s?s=%s" % [@gravatar_hash, image_size] end def image_size 200 end - end diff --git a/app/models/participation.rb b/app/models/participation.rb index 330678d..7974442 100644 --- a/app/models/participation.rb +++ b/app/models/participation.rb @@ -1,4 +1,4 @@ -class Participation < ActiveRecord::Base +class Participation < ApplicationRecord validates :member, presence: true validates :meetup_id, presence: true validates_uniqueness_of :member_id, scope: :meetup_id diff --git a/app/models/team.rb b/app/models/team.rb index 979ebf2..cf523ac 100644 --- a/app/models/team.rb +++ b/app/models/team.rb @@ -1,5 +1,4 @@ class Team - def member(nick) members.detect { |m| m.nick == nick } end @@ -16,4 +15,71 @@ def each(&block) members.each(&block) end + def self.all + team = Team.new + + # ruvetia organizers in no particular order + team << Organizer.new( + :senny, + 'Yves Senn', + social_media: { + github: 'https://github.com/senny', + twitter: 'https://twitter.com/yves_senn', + web: 'http://blog.senny.ch' + }, + gravatar_hash: "3d698e2872c07061a455d9e250861235", + bio: "Yves started experimenting with Ruby in late 2007. Since then he worked on medium to large scale Rails applications with a strong focus on automated testing. He is a Rails committer and works on other Open Source projects like spring and queue_classic." + ) + + team << Organizer.new( + :therod, + 'Rodrigo Haenggi', + social_media: { + github: 'https://github.com/therod', + twitter: 'https://twitter.com/therod', + web: 'https://rodrigohaenggi.com' + }, + gravatar_hash: "961ce8457830cbe5607fd365f134710c", + bio: "Rodrigo loves all things japanese - Ruby coming in on place three in his list, right after Anime and Matcha Tea. He has been programming since 2004, but only got really passionate about it after discovering Ruby and its wonderful community. He also loves whiskey, and what could be better than sharing a few drinks with fellow Rubyists? J-pop, maybe?" + ) + + team << Organizer.new( + :danielpuglisi, + 'Daniel Puglisi', + social_media: { + github: 'https://github.com/danielpuglisi', + twitter: 'https://twitter.com/danielpuglisi', + web: 'https://danielpuglisi.com' + }, + gravatar_hash: "34fd3386654f1b625e1d3b8b6c43a217", + bio: "Fascinated by Ruby's english like syntax, the Rails Framework and the awesome community behind it, Daniel decided to put Ruby into his design and programming toolbox. Ruvetia is his attempt to make Ruby more fundamental and popular in Switzerland and to spread the love about this beautiful programming language and its extraordinary people behind it." + ) + + team << Organizer.new( + :kschiess, + 'Kaspar Schiess', + social_media: { + bitbucket: 'https://bitbucket.org/kschiess', + github: 'https://github.com/kschiess', + web: 'http://www.absurd.li', + twitter: 'https://twitter.com/kasparschiess' + }, + gravatar_hash: "ae4df18bf57748120b915d63b7e233d4", + bio: "Kaspar has found Ruby in 2003 and since then told everyone who would listen about it. Working hard to promote the language as general purpose programming language, he likes to take a pick at Rails, but only in jest. Take a look at his box of gems on GitHub and be delighted by the useful and the obscure." + ) + + team << Organizer.new( + :nerdinand, + 'Ferdinand Niedermann', + social_media: { + github: 'https://github.com/nerdinand', + twitter: 'https://twitter.com/nerdinand' + }, + gravatar_hash: "a69ea888ca7c5102e04e59a54d7db420", + bio: "Ferdinand got started with Ruby and Rails during his time at the University of Basel. He was soon amazed by the helpful and very active community around Ruby and worked at different companies to apply his Rails knowledge." + ) + + team + end + end diff --git a/app/views/_shared/_social_media_links.html.erb b/app/views/_shared/_social_media_links.html.erb index 5ceb900..23f0d7f 100644 --- a/app/views/_shared/_social_media_links.html.erb +++ b/app/views/_shared/_social_media_links.html.erb @@ -4,7 +4,7 @@ <% if data.has_key?(:email) %>
  • <%= link_to "mailto:#{data[:email]}" do %> - <%= fa_icon "envelope" %> + <% end %>
  • <% end %> @@ -12,7 +12,7 @@ <% if data.has_key?(:twitter) %>
  • <%= link_to data[:twitter], target: "_blank" do %> - <%= fa_icon "twitter" %> + <% end %>
  • <% end %> @@ -20,7 +20,7 @@ <% if data.has_key?(:mailing_list) %>
  • <%= link_to data[:mailing_list], target: "_blank" do %> - <%= fa_icon "comments" %> + <% end %>
  • <% end %> @@ -28,15 +28,15 @@ <% if data.has_key?(:github) %>
  • <%= link_to data[:github], target: "_blank" do %> - <%= fa_icon "github" %> + <% end %>
  • <% end %> - <% if value=data[:bitbucket] %> + <% if data.has_key?(:bitbucket) %>
  • - <%= link_to value, target: "_blank" do %> - <%= fa_icon "bitbucket" %> + <%= link_to data[:bitbucket], target: "_blank" do %> + <% end %>
  • <% end %> @@ -44,7 +44,7 @@ <% if data.has_key?(:web) %>
  • <%= link_to data[:web], target: "_blank" do %> - <%= fa_icon "globe" %> + <% end %>
  • <% end %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index a95025d..d1bb716 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -6,11 +6,17 @@ Ruvetia | meet Ruby Developers in Switzerland - <%= stylesheet_link_tag "application", :media => "all" %> - <%= javascript_include_tag "application" %> + + <%#= stylesheet_link_tag "application", media: "all" %> + <%#= javascript_include_tag "application" %> <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + + + <%= stylesheet_link_tag "application", media: "all", "data-turbo-track": "reload" %> diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb new file mode 100644 index 0000000..3aac900 --- /dev/null +++ b/app/views/layouts/mailer.html.erb @@ -0,0 +1,13 @@ + + + + + + + + + <%= yield %> + + diff --git a/app/views/layouts/mailer.text.erb b/app/views/layouts/mailer.text.erb new file mode 100644 index 0000000..37f0bdd --- /dev/null +++ b/app/views/layouts/mailer.text.erb @@ -0,0 +1 @@ +<%= yield %> diff --git a/app/views/pages/_intro.html.erb b/app/views/pages/_intro.html.erb index 4e25fbf..f99dd5b 100644 --- a/app/views/pages/_intro.html.erb +++ b/app/views/pages/_intro.html.erb @@ -16,8 +16,11 @@

    Feel free to drop us an <%= link_to 'Email', "mailto:#{$ruvetia[:email]}" %> if you want to get in contact with the organisers.

    -<% unless signed_in? %> -
    - <%= link_to "Join / Sign in using GitHub", auth_github_path, class: "btn btn-join" %> -
    + +<% if false %> + <% unless signed_in? %> +
    + <%= link_to "Join / Sign in using GitHub", auth_github_path, class: "btn btn-join" %> +
    + <% end %> <% end %> diff --git a/app/views/pages/_meetups.html.erb b/app/views/pages/_meetups.html.erb index cad2b86..26f9f72 100644 --- a/app/views/pages/_meetups.html.erb +++ b/app/views/pages/_meetups.html.erb @@ -5,27 +5,34 @@

    <%= meetup.title %>, <%= meetup.city %>

    +

    <%= meetup.date %>, <%= link_to meetup.location, meetup.map_src, target: "_blank" %>

    -
    - <% if signed_in? %> - <% if !current_user.attends?(meetup.id) %> - <%= link_to "I will be there!", attend_path(meetup.id), method: :put, class: "btn" %> + + <% if false %> +
    + <% if signed_in? %> + <% if !current_user.attends?(meetup.id) %> + <%= link_to "I will be there!", attend_path(meetup.id), method: :put, class: "btn" %> + <% else %> + <%= link_to "I can't make it!", cancel_path(meetup.id), method: :delete, class: "btn" %> + <% end %> <% else %> - <%= link_to "I can't make it!", cancel_path(meetup.id), method: :delete, class: "btn" %> + <%= link_to "Sign in using GitHub", auth_github_path(meetup: meetup.id), class: "btn" %> <% end %> - <% else %> - <%= link_to "Sign in using GitHub", auth_github_path(meetup: meetup.id), class: "btn" %> - <% end %> -
    +
    + <% end %> +
    <%= link_to participants_path(meetup.id, format: :json) do %> <%= pluralize(meetup.participants.count(:all), "rubyist") %> will attend <% end %>
    - <%= map(meetup.map_src) %> + + <%# Add map back in %> + <% map(meetup.map_src) %> <% end %> diff --git a/app/views/pages/home.html.erb b/app/views/pages/home.html.erb index 51f3783..1b209c6 100644 --- a/app/views/pages/home.html.erb +++ b/app/views/pages/home.html.erb @@ -19,12 +19,12 @@ -<%= ribbon("Upcoming Meetup", class: "bottom") %> +<%= ribbon("Last Meetup", class: "bottom") %>
    <%= render 'meetups', meetups: [ruvetia_meetups.first] %> -
    + <%= ribbon("Meet the Team", class: "top") %> diff --git a/bin/bootstrap b/bin/bootstrap deleted file mode 100755 index 57dc1d2..0000000 --- a/bin/bootstrap +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/env ruby - -# -# bootstrap -# - -# -# Welcome to the ruvetia Bootstrap Script -# -puts "" -puts "Ruvetia.org bootstrap" -puts "================ " -puts "" -puts "! Logs will be written to: log/boostrap.log" -system ("echo 'Bootstrap started at #{Time.now}' > log/bootstrap.log") -puts "" - -# -# lol constants -# -puts "database user:" -DB_USERNAME = gets.strip -puts "database password:" -DB_PASSWORD = gets.strip -DB_HOST = "localhost" -TEST_DATABASE = "ruvetia_test" -DEV_DATABASE = "ruvetia_development" - -# -# Check for PostgreSQL -# -unless system("which psql 2>&1 > /dev/null") - puts "x You need to install PostgreSQL. If you use Homebrew, you can run:" - puts " => brew install postgresql" - exit(1) -else - puts "+ PostgreSQL found." -end - -# -# Check for Bundler -# -unless system("which bundle 2>&1 > /dev/null") - puts "x You need to install Bundler:" - puts " => gem install bundler" - exit(1) -else - puts "+ Bundler found." -end - -# -# Check for Heroku toolbelt -# -unless system("which heroku 2>&1 > /dev/null") - puts "+ You need to install the Heroku toolbelt:" - puts " => https://toolbelt.heroku.com/" - exit(1) -else - puts "+ Heroku toolbelt found." -end - - -# -# Let's install some bundles -# -puts "" -puts "Installing bundles..." -system("bundle install >> log/bootstrap.log") - -require "bundler/setup" -require 'erubis' - -# -# Generate the database configuration -# -unless File.exists?("config/database.yml") - input = File.read('config/database_template.yml.erb') - template = Erubis::Eruby.new(input) # create Eruby object - - list = ['aaa', 'bbb', 'ccc'] - content = template.result(:development_database => DEV_DATABASE, - :test_database => TEST_DATABASE, - :username => DB_USERNAME, - :password => DB_PASSWORD) - File.open("config/database.yml", "w+") {|f| f.write content } -end - -# -# Prepare Database -# -puts "" -puts "Should we set up the dev & test Databases for you?" -puts "WARNING: This will destroy existing databases named '#{DEV_DATABASE}'and '#{TEST_DATABASE}'!" -print "(y)es, (n)o => " - -case gets.strip - when 'Y', 'y', 'yes' - puts "" - puts "Dropping all connections to #{DEV_DATABASE}..." - system(%Q{psql postgres #{DB_USERNAME} --command="SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname='#{DEV_DATABASE}';" >> log/bootstrap.log}) - - puts "Deleting old #{DEV_DATABASE}..." - system("dropdb #{DEV_DATABASE} --username=#{DB_USERNAME} >> log/bootstrap.log") - - puts "Creating #{DEV_DATABASE}..." - system("createdb --owner=#{DB_USERNAME} --username=#{DB_USERNAME} #{DEV_DATABASE} >> log/bootstrap.log") - - puts "Migrating #{DEV_DATABASE}..." - system("rake db:migrate >> log/bootstrap.log") - - puts "Seeding #{DEV_DATABASE}..." - system("rake db:seed >> log/bootstrap.log") - - puts "Deleting old #{TEST_DATABASE}..." - system("dropdb #{TEST_DATABASE} --username=#{DB_USERNAME} >> log/bootstrap.log") - - puts "Creating #{TEST_DATABASE}..." - system("createdb --owner=#{DB_USERNAME} --username=#{DB_USERNAME} #{TEST_DATABASE} >> log/bootstrap.log") - - puts "Preparing #{TEST_DATABASE}..." - system("rake db:test:prepare >> log/bootstrap.log") - system("rake db:test:load >> log/bootstrap.log") - - puts "" - puts "DATABASES ARE READY!" -end - - -# -# Restart the Rails Server if it is running (for pow users) -# -puts "" -puts "Restarting app..." -system("touch tmp/restart.txt") - -# -# RUN EM TESTS -# -puts "" -puts "Running tests..." -system("bundle exec rake test") - -# -# DONE -# -puts "" -puts "Sweet, my job here is done!" diff --git a/bin/bundle b/bin/bundle index 66e9889..50da5fd 100755 --- a/bin/bundle +++ b/bin/bundle @@ -1,3 +1,109 @@ #!/usr/bin/env ruby -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -load Gem.bin_path('bundler', 'bundle') +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'bundle' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "rubygems" + +m = Module.new do + module_function + + def invoked_as_script? + File.expand_path($0) == File.expand_path(__FILE__) + end + + def env_var_version + ENV["BUNDLER_VERSION"] + end + + def cli_arg_version + return unless invoked_as_script? # don't want to hijack other binstubs + return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update` + bundler_version = nil + update_index = nil + ARGV.each_with_index do |a, i| + if update_index && update_index.succ == i && a.match?(Gem::Version::ANCHORED_VERSION_PATTERN) + bundler_version = a + end + next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ + bundler_version = $1 + update_index = i + end + bundler_version + end + + def gemfile + gemfile = ENV["BUNDLE_GEMFILE"] + return gemfile if gemfile && !gemfile.empty? + + File.expand_path("../Gemfile", __dir__) + end + + def lockfile + lockfile = + case File.basename(gemfile) + when "gems.rb" then gemfile.sub(/\.rb$/, ".locked") + else "#{gemfile}.lock" + end + File.expand_path(lockfile) + end + + def lockfile_version + return unless File.file?(lockfile) + lockfile_contents = File.read(lockfile) + return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ + Regexp.last_match(1) + end + + def bundler_requirement + @bundler_requirement ||= + env_var_version || + cli_arg_version || + bundler_requirement_for(lockfile_version) + end + + def bundler_requirement_for(version) + return "#{Gem::Requirement.default}.a" unless version + + bundler_gem_version = Gem::Version.new(version) + + bundler_gem_version.approximate_recommendation + end + + def load_bundler! + ENV["BUNDLE_GEMFILE"] ||= gemfile + + activate_bundler + end + + def activate_bundler + gem_error = activation_error_handling do + gem "bundler", bundler_requirement + end + return if gem_error.nil? + require_error = activation_error_handling do + require "bundler/version" + end + return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION)) + warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`" + exit 42 + end + + def activation_error_handling + yield + nil + rescue StandardError, LoadError => e + e + end +end + +m.load_bundler! + +if m.invoked_as_script? + load Gem.bin_path("bundler", "bundle") +end diff --git a/bin/dev b/bin/dev new file mode 100755 index 0000000..a4e05fa --- /dev/null +++ b/bin/dev @@ -0,0 +1,11 @@ +#!/usr/bin/env sh + +if ! gem list foreman -i --silent; then + echo "Installing foreman..." + gem install foreman +fi + +# Default to port 3000 if not specified +export PORT="${PORT:-3000}" + +exec foreman start -f Procfile.dev "$@" diff --git a/bin/rails b/bin/rails index 5191e69..efc0377 100755 --- a/bin/rails +++ b/bin/rails @@ -1,4 +1,4 @@ #!/usr/bin/env ruby -APP_PATH = File.expand_path('../../config/application', __FILE__) -require_relative '../config/boot' -require 'rails/commands' +APP_PATH = File.expand_path("../config/application", __dir__) +require_relative "../config/boot" +require "rails/commands" diff --git a/bin/rake b/bin/rake index 1724048..4fbf10b 100755 --- a/bin/rake +++ b/bin/rake @@ -1,4 +1,4 @@ #!/usr/bin/env ruby -require_relative '../config/boot' -require 'rake' +require_relative "../config/boot" +require "rake" Rake.application.run diff --git a/bin/setup b/bin/setup index acdb2c1..d38bf9f 100755 --- a/bin/setup +++ b/bin/setup @@ -1,29 +1,36 @@ #!/usr/bin/env ruby -require 'pathname' +require "fileutils" # path to your application root. -APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) +APP_ROOT = File.expand_path("..", __dir__) -Dir.chdir APP_ROOT do - # This script is a starting point to setup your application. - # Add necessary setup steps to this file: +def system!(*args) + system(*args, exception: true) +end + +FileUtils.chdir APP_ROOT do + # This script is a way to set up or update your development environment automatically. + # This script is idempotent, so that you can run it at any time and get an expectable outcome. + # Add necessary setup steps to this file. puts "== Installing dependencies ==" - system "gem install bundler --conservative" - system "bundle check || bundle install" + system! "gem install bundler --conservative" + system("bundle check") || system!("bundle install") + + # Install JavaScript dependencies + system("yarn check --check-files") || system!("yarn install") # puts "\n== Copying sample files ==" # unless File.exist?("config/database.yml") - # system "cp config/database.yml.sample config/database.yml" + # FileUtils.cp "config/database.yml.sample", "config/database.yml" # end puts "\n== Preparing database ==" - system "bin/rake db:setup" + system! "bin/rails db:prepare" puts "\n== Removing old logs and tempfiles ==" - system "rm -f log/*" - system "rm -rf tmp/cache" + system! "bin/rails log:clear tmp:clear" puts "\n== Restarting application server ==" - system "touch tmp/restart.txt" + system! "bin/rails restart" end diff --git a/config.ru b/config.ru index 6c3d729..4a3c09a 100644 --- a/config.ru +++ b/config.ru @@ -1,4 +1,6 @@ # This file is used by Rack-based servers to start the application. -require ::File.expand_path('../config/environment', __FILE__) -run Ruvetia::Application +require_relative "config/environment" + +run Rails.application +Rails.application.load_server diff --git a/config/application.rb b/config/application.rb index 2ce9fea..5cd9b0e 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,35 +1,27 @@ -require File.expand_path('../boot', __FILE__) +require_relative "boot" -# require 'rails/all' +require "rails/all" -# customize loaded rails frameworks -require "rails" +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) -[ - 'active_record', - 'action_controller', - # 'action_mailer', - 'rails/test_unit', - 'sprockets', -].each do |framework| - require "#{framework}/railtie" -end - -# Assets should be precompiled for production (so we don't need the gems loaded then) -Bundler.require(*Rails.groups(assets: %w(development test))) - -module Ruvetia +module RuvetiaOrg class Application < Rails::Application - # 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. + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 7.1 - # 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 = 'Bern' + # Please, add to the `ignore` list any other `lib` subdirectories that do + # not contain `.rb` files, or that should not be reloaded or eager loaded. + # Common ones are `templates`, `generators`, or `middleware`, for example. + config.autoload_lib(ignore: %w(assets tasks)) - # 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 + # Configuration for the application, engines, and railties goes here. + # + # These settings can be overridden in specific environments using the files + # in config/environments, which are processed later. + # + # config.time_zone = "Central Time (US & Canada)" + # config.eager_load_paths << Rails.root.join("extras") end end diff --git a/config/boot.rb b/config/boot.rb index 6b750f0..988a5dd 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,3 +1,4 @@ -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) -require 'bundler/setup' # Set up gems listed in the Gemfile. +require "bundler/setup" # Set up gems listed in the Gemfile. +require "bootsnap/setup" # Speed up boot time by caching expensive operations. diff --git a/config/cable.yml b/config/cable.yml new file mode 100644 index 0000000..075066c --- /dev/null +++ b/config/cable.yml @@ -0,0 +1,10 @@ +development: + adapter: async + +test: + adapter: test + +production: + adapter: redis + url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> + channel_prefix: ruvetia_org_production diff --git a/config/credentials.yml.enc b/config/credentials.yml.enc new file mode 100644 index 0000000..3488451 --- /dev/null +++ b/config/credentials.yml.enc @@ -0,0 +1 @@ +CeINHff9utF/zcE+udDb/HfDFBO9W7zkOn7UnAog27PttrfU4YJX1RDmt7pBLq/MoYXi/JS/7BhyjBAZwFIJ42kW/ckMN4i7SMHbUvRPV8GbZYccesTWPcDyQ+FX6+9rFqilEHqPPjwHgWqmVR6Km8dfH6tZAu2NpOPTHFGgDV5tS+aic9KzAz5LRL7bZTQloNfI49F9qQMKmtZJrDVd852T5KUs1PPS3HgvDXl5jdvgmzaauF8H9Fk0F5pAOFDnqAwvrqRTUi9RqP5Zg3UYT7T8/76q2uvRSLhvkScOGPFLOcYAWQ1sBKb0yHQgqQk/cFrgqPRyJL3lNV0uepJFYmnz99PQ2mQZX0pcQiPi1Ee3qakcyhMXFTfx5MIKtbdnmxkLrQhNeBiXDugw7s5B++EubyN/--01heOlQOmtUtUN5d--7OLFzAKhO96kmz5OYkMeWQ== \ No newline at end of file diff --git a/config/database.yml b/config/database.yml new file mode 100644 index 0000000..0f696a7 --- /dev/null +++ b/config/database.yml @@ -0,0 +1,84 @@ +# PostgreSQL. Versions 9.3 and up are supported. +# +# Install the pg driver: +# gem install pg +# On macOS with Homebrew: +# gem install pg -- --with-pg-config=/usr/local/bin/pg_config +# On Windows: +# gem install pg +# Choose the win32 build. +# Install PostgreSQL and put its /bin directory on your path. +# +# Configure Using Gemfile +# gem "pg" +# +default: &default + adapter: postgresql + encoding: unicode + # For details on connection pooling, see Rails configuration guide + # https://guides.rubyonrails.org/configuring.html#database-pooling + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + +development: + <<: *default + database: ruvetia_org_development + + # The specified database role being used to connect to PostgreSQL. + # To create additional roles in PostgreSQL see `$ createuser --help`. + # When left blank, PostgreSQL will use the default role. This is + # the same name as the operating system user running Rails. + #username: ruvetia_org + + # The password associated with the PostgreSQL role (username). + #password: + + # Connect on a TCP socket. Omitted by default since the client uses a + # domain socket that doesn't need configuration. Windows does not have + # domain sockets, so uncomment these lines. + #host: localhost + + # The TCP port the server listens on. Defaults to 5432. + # If your server runs on a different port number, change accordingly. + #port: 5432 + + # Schema search path. The server defaults to $user,public + #schema_search_path: myapp,sharedapp,public + + # Minimum log levels, in increasing order: + # debug5, debug4, debug3, debug2, debug1, + # log, notice, warning, error, fatal, and panic + # Defaults to warning. + #min_messages: notice + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: ruvetia_org_test + +# As with config/credentials.yml, you never want to store sensitive information, +# like your database password, in your source code. If your source code is +# ever seen by anyone, they now have access to your database. +# +# Instead, provide the password or a full connection URL as an environment +# variable when you boot the app. For example: +# +# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" +# +# If the connection URL is provided in the special DATABASE_URL environment +# variable, Rails will automatically merge its configuration values on top of +# the values provided in this file. Alternatively, you can specify a connection +# URL environment variable explicitly: +# +# production: +# url: <%= ENV["MY_APP_DATABASE_URL"] %> +# +# Read https://guides.rubyonrails.org/configuring.html#configuring-a-database +# for a full overview on how database connection configuration can be specified. +# +production: + <<: *default + database: ruvetia_org_production + username: ruvetia_org + password: <%= ENV["RUVETIA_ORG_DATABASE_PASSWORD"] %> diff --git a/config/database_template.yml.erb b/config/database_template.yml.erb deleted file mode 100644 index f0311b5..0000000 --- a/config/database_template.yml.erb +++ /dev/null @@ -1,25 +0,0 @@ -development: - adapter: postgresql - encoding: unicode - database: <%= development_database %> - pool: 5 - username: <%= username %> - password: <%= password %> - min_messages: warning - encoding: UTF8 - host: localhost - - -# Warning: The database defined as "test" will be erased and -# re-generated from your development database when you run "rake". -# Do not set this db to the same as development or production. -test: - adapter: postgresql - encoding: unicode - database: <%= test_database %> - pool: 5 - username: <%= username %> - password: <%= password %> - min_messages: warning - encoding: UTF8 - host: localhost diff --git a/config/environment.rb b/config/environment.rb index ee8d90d..cac5315 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,5 +1,5 @@ # Load the Rails application. -require File.expand_path('../application', __FILE__) +require_relative "application" # Initialize the Rails application. Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb index e460641..2e7fb48 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,34 +1,76 @@ +require "active_support/core_ext/integer/time" + Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. - # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development + # In the development environment your application's code is reloaded any time + # it changes. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. - config.cache_classes = false + config.enable_reloading = true # Do not eager load code on boot. config.eager_load = false - # Show full error reports and disable caching. - config.consider_all_requests_local = true - config.action_controller.perform_caching = false + # Show full error reports. + config.consider_all_requests_local = true + + # Enable server timing + config.server_timing = true + + # Enable/disable caching. By default caching is disabled. + # Run rails dev:cache to toggle caching. + if Rails.root.join("tmp/caching-dev.txt").exist? + config.action_controller.perform_caching = true + config.action_controller.enable_fragment_cache_logging = true + + config.cache_store = :memory_store + config.public_file_server.headers = { + "Cache-Control" => "public, max-age=#{2.days.to_i}" + } + else + config.action_controller.perform_caching = false + + config.cache_store = :null_store + end + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # 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 + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + # Raise an error on page load if there are pending migrations. config.active_record.migration_error = :page_load - # Debug mode disables concatenation and preprocessing of assets. - # This option may cause significant delays in view rendering with a large - # number of complex assets. - config.assets.debug = true + # Highlight code that triggered database queries in logs. + config.active_record.verbose_query_logs = true + + # Highlight code that enqueued background job in logs. + config.active_job.verbose_enqueue_logs = true + + # Suppress logger output for asset requests. + config.assets.quiet = true + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = 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 + # Uncomment if you wish to allow Action Cable access from any origin. + # config.action_cable.disable_request_forgery_protection = true - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true + # Raise error when a before_action's only/except options reference missing actions + config.action_controller.raise_on_missing_callback_actions = true end diff --git a/config/environments/production.rb b/config/environments/production.rb index 5711fae..2b46be7 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,8 +1,10 @@ +require "active_support/core_ext/integer/time" + Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. - config.cache_classes = true + config.enable_reloading = false # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web servers @@ -11,69 +13,85 @@ config.eager_load = true # Full error reports are disabled and caching is turned on. - config.consider_all_requests_local = false + 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 + # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment + # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files). + # config.require_master_key = true - # Disable Rails's static asset server (Apache or nginx will already do this). - config.serve_static_assets = false + # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead. + # config.public_file_server.enabled = false - # Compress JavaScripts and CSS. - config.assets.js_compressor = :uglifier + # Compress CSS using a preprocessor. # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = false - # Generate digests for assets URLs. - config.assets.digest = true - - # Version of your assets, change this if you want to expire all your assets. - config.assets.version = '1.0' + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.asset_host = "http://assets.example.com" # 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 + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache + # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # 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.*/ ] + + # Assume all access to the app is happening through a SSL-terminating reverse proxy. + # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies. + # config.assume_ssl = true # 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. - config.log_level = :info + # Log to STDOUT by default + config.logger = ActiveSupport::Logger.new(STDOUT) + .tap { |logger| logger.formatter = ::Logger::Formatter.new } + .then { |logger| ActiveSupport::TaggedLogging.new(logger) } # 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) + # Info include generic and useful information about system operation, but avoids logging too much + # information to avoid inadvertent exposure of personally identifiable information (PII). If you + # want to log everything, set the level to "debug". + config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") # Use a different cache store in production. # config.cache_store = :mem_cache_store - # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.action_controller.asset_host = "http://assets.example.com" + # 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 = "ruvetia_org_production" + + config.action_mailer.perform_caching = false - # Precompile additional assets. - # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. - # config.assets.precompile += %w( search.js ) + # 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. + # config.action_mailer.raise_delivery_errors = false # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true - # Send deprecation notices to registered listeners. - 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. - config.log_formatter = ::Logger::Formatter.new + # Don't log any deprecations. + config.active_support.report_deprecations = false # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false + + # Enable DNS rebinding protection and other `Host` header attacks. + # config.hosts = [ + # "example.com", # Allow requests from example.com + # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` + # ] + # Skip DNS rebinding protection for the default health check endpoint. + # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } end diff --git a/config/environments/test.rb b/config/environments/test.rb index 7977216..adbb4a6 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,36 +1,64 @@ +require "active_support/core_ext/integer/time" + +# The test environment is used exclusively to run your application's +# test suite. You never need to work with it otherwise. Remember that +# your test database is "scratch space" for the test suite and is wiped +# and recreated between test runs. Don't rely on the data there! + Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true + # While tests run files are not watched, reloading is not necessary. + config.enable_reloading = false - # Do not eager load code on boot. This avoids loading your whole application - # just for the purpose of running a single test. If you are using a tool that - # preloads Rails for running tests, you may have to set it to true. - config.eager_load = false + # Eager loading loads your entire application. When running a single test locally, + # this is usually not necessary, and can slow down your test suite. However, it's + # recommended that you enable it in continuous integration systems to ensure eager + # loading is working properly before deploying your code. + config.eager_load = ENV["CI"].present? - # Configure static asset server for tests with Cache-Control for performance. - config.serve_static_files = true - config.static_cache_control = 'public, max-age=3600' + # 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=#{1.hour.to_i}" + } # Show full error reports and disable caching. - config.consider_all_requests_local = true + config.consider_all_requests_local = true config.action_controller.perform_caching = false + config.cache_store = :null_store - # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = false + # Render exception templates for rescuable exceptions and raise for other exceptions. + config.action_dispatch.show_exceptions = :rescuable # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false + # Store uploaded files on the local file system in a temporary directory. + config.active_storage.service = :test + + 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 + # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true - config.active_support.test_order = :random + # Raise error when a before_action's only/except options reference missing actions + config.action_controller.raise_on_missing_callback_actions = true end diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 01ef3e6..2eeef96 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -1,11 +1,12 @@ # Be sure to restart your server when you modify this file. # Version of your assets, change this if you want to expire all your assets. -Rails.application.config.assets.version = '1.0' +Rails.application.config.assets.version = "1.0" -# Add additional assets to the asset load path +# Add additional assets to the asset load path. # Rails.application.config.assets.paths << Emoji.images_path # Precompile additional assets. -# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. -# Rails.application.config.assets.precompile += %w( search.js ) +# application.js, application.css, and all non-JS/CSS in the app/assets +# folder are already added. +# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb deleted file mode 100644 index 59385cd..0000000 --- a/config/initializers/backtrace_silencers.rb +++ /dev/null @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. -# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } - -# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb new file mode 100644 index 0000000..b3076b3 --- /dev/null +++ b/config/initializers/content_security_policy.rb @@ -0,0 +1,25 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide content security policy. +# See the Securing Rails Applications Guide for more information: +# https://guides.rubyonrails.org/security.html#content-security-policy-header + +# Rails.application.configure do +# config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https +# # Specify URI for violation reports +# # policy.report_uri "/csp-violation-report-endpoint" +# end +# +# # Generate session nonces for permitted importmap, inline scripts, and inline styles. +# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s } +# config.content_security_policy_nonce_directives = %w(script-src style-src) +# +# # Report violations without enforcing the policy. +# # config.content_security_policy_report_only = true +# end diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb deleted file mode 100644 index ac5f8b6..0000000 --- a/config/initializers/cookies_serializer.rb +++ /dev/null @@ -1,3 +0,0 @@ -# Be sure to restart your server when you modify this file. - -Rails.application.config.action_dispatch.cookies_serializer = :marshal diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index 4a994e1..c2d89e2 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -1,4 +1,8 @@ # Be sure to restart your server when you modify this file. -# Configure sensitive parameters which will be filtered from the log file. -Rails.application.config.filter_parameters += [:password] +# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. +# Use this to limit dissemination of sensitive information. +# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors. +Rails.application.config.filter_parameters += [ + :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn +] diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index ac033bf..b55eecb 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -4,13 +4,13 @@ # are locale specific, and you may define rules for as many different # locales as you wish. All of these examples are active by default: # ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' +# inflect.plural /^(ox)$/i, "\\1en" +# inflect.singular /^(ox)en/i, "\\1" +# inflect.irregular "person", "people" # inflect.uncountable %w( fish sheep ) # end # These inflection rules are supported but not enabled by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.acronym 'RESTful' -# end +ActiveSupport::Inflector.inflections(:en) do |inflect| + inflect.acronym "BBQ" +end diff --git a/config/initializers/meetup_setup.rb b/config/initializers/meetup_setup.rb deleted file mode 100644 index ed40d96..0000000 --- a/config/initializers/meetup_setup.rb +++ /dev/null @@ -1,72 +0,0 @@ -# -*- coding: utf-8 -*- -$meetups = [ - Meetup.new( - id: 8, - number: 8, - city: "Basel", - location: "Werk 8", - time: "08.05.2015 18:00", - map_src: "https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d5386.645932126084!2d7.594735293498037!3d47.54204262705834!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x4791b845fdb2acb3%3A0xcff581105a20a660!2sKantensprung+AG!5e0!3m2!1sen!2sch!4v1430826614995" - ), - - Meetup.new( - id: 7, - number: 7, - city: "Luzern", - location: "Havanna Café & Bar", - time: "31.10.2014 18:00", - map_src: "https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2718.6405381720174!2d8.307837999999993!3d47.047284!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x478ffba3cb1edf03%3A0x76e591b5fb5cb3c9!2sHavanna+Caf%C3%A9+%2B+Bar+GmbH!5e0!3m2!1sen!2sch!4v1413905565712" - ), - - Meetup.new( - id: 6, - number: 6, - city: "Bern", - location: "Musigbistrot", - time: "13.06.2014 18:00", - map_src: "https://maps.google.ch/maps?q=musigbistrot+bern,+M%C3%BChlemattstrasse,+Bern&hl=de&ie=UTF8&ll=46.944769,7.433066&spn=0.009419,0.017209&sll=46.946161,7.432938&sspn=0.009419,0.017209&oq=musigbi&hq=musigbistrot+bern,+M%C3%BChlemattstrasse,+Bern&t=m&z=16" - ), - - Meetup.new( - id: 5, - number: 4, - city: "Lausanne", - location: "Café Saint Pierre", - time: "04.10.2013 18:30", - map_src: "https://maps.google.ch/maps?q=Caf%C3%A9+Saint+Pierre,+Place+Benjamin-Constant,+Lausanne&hl=de&ie=UTF8&sll=46.835845,7.658535&sspn=1.275764,2.661438&oq=cafe+saint+pierr&hq=Caf%C3%A9+Saint+Pierre,&hnear=Place+Benjamin-Constant,+Lausanne,+Vaud&t=m&z=16" - ), - - Bbq.new( - id: 4, - number: 3, - city: "Bern", - location: "A de Aare", - time: "31.08.2013 12:00", - map_src: "https://maps.google.ch/maps?q=46.981658,7.446174&hl=de&sll=46.813187,8.22421&sspn=2.552665,5.559082&t=m&z=16" - ), - - Meetup.new( - id: 3, - number: 3, - city: "Zug", - location: "im Hof", - time: "12.07.2013 18:00", - map_src: "https://maps.google.ch/maps?q=Savi+im+Hof+GmbH&hl=de&ll=47.173845,8.511915&spn=0.037516,0.080509&cid=4429921772654024681&gl=CH&t=m&z=14&iwloc=A" - ), - Meetup.new( - id: 2, - number: 2, - city: "Basel", - location: "eoipso", - time: "03.05.2013 18:00", - map_src: "https://maps.google.com/maps?q=eoipso&hl=en&ll=47.550927,7.593269&spn=0.081913,0.181103&sll=31.428663,-82.880859&sspn=49.27302,92.724609&hq=eoipso&radius=15000&t=m&z=13&iwloc=A" - ), - Meetup.new( - id: 1, - number: 1, - city: "Bern", - location: "Musigbistrot", - time: "15.03.2013 18:00", - map_src: "https://maps.google.ch/maps?q=musigbistrot+bern,+M%C3%BChlemattstrasse,+Bern&hl=de&ie=UTF8&ll=46.944769,7.433066&spn=0.009419,0.017209&sll=46.946161,7.432938&sspn=0.009419,0.017209&oq=musigbi&hq=musigbistrot+bern,+M%C3%BChlemattstrasse,+Bern&t=m&z=16" - ) - ] diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb deleted file mode 100644 index dc18996..0000000 --- a/config/initializers/mime_types.rb +++ /dev/null @@ -1,4 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new mime types for use in respond_to blocks: -# Mime::Type.register "text/richtext", :rtf diff --git a/config/initializers/permissions_policy.rb b/config/initializers/permissions_policy.rb new file mode 100644 index 0000000..7db3b95 --- /dev/null +++ b/config/initializers/permissions_policy.rb @@ -0,0 +1,13 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide HTTP permissions policy. For further +# information see: https://developers.google.com/web/updates/2018/06/feature-policy + +# Rails.application.config.permissions_policy do |policy| +# policy.camera :none +# policy.gyroscope :none +# policy.microphone :none +# policy.usb :none +# policy.fullscreen :self +# policy.payment :self, "https://secure.example.com" +# end diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb deleted file mode 100644 index 076bd6a..0000000 --- a/config/initializers/secret_token.rb +++ /dev/null @@ -1,12 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# 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 `rake secret` to generate a secure secret key. - -# Make sure your secret_key_base is kept private -# if you're sharing your code publicly. -Ruvetia::Application.config.secret_key_base = '703a8a02ae859cc20a9f4ff37c3cd6d1ab39c36322332654c884b5dac9f12f04a6b1d0f4952dd780893bff2136652483fe6e227f2866942f28fbd6ce0fd9d2a3' diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb deleted file mode 100644 index 6ffefd1..0000000 --- a/config/initializers/session_store.rb +++ /dev/null @@ -1,3 +0,0 @@ -# Be sure to restart your server when you modify this file. - -Rails.application.config.session_store :cookie_store, key: '_ruvetia_session' diff --git a/config/initializers/team_setup.rb b/config/initializers/team_setup.rb deleted file mode 100644 index 41769e3..0000000 --- a/config/initializers/team_setup.rb +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -$team = Team.new -# ruvetia organizers in no particular order -$team << Organizer.new(:senny, 'Yves Senn', - social_media: { github: 'http://github.com/senny', twitter: 'https://twitter.com/yves_senn', web: 'http://blog.senny.ch' }, - gravatar_hash: "3d698e2872c07061a455d9e250861235", - bio: "Yves started experimenting with Ruby in late 2007. Since then he worked on medium to large scale Rails applications with a strong focus on automated testing. He is a Rails committer and works on other Open Source projects like spring and queue_classic.") - -$team << Organizer.new(:therod, 'Rodrigo Haenggi', - social_media: { github: 'http://github.com/therod', twitter: 'https://twitter.com/therod', web: 'http://rodrigohaenggi.com' }, - gravatar_hash: "961ce8457830cbe5607fd365f134710c", - bio: "Rodrigo loves all things japanese - Ruby coming in on place three in his list, right after Anime and Matcha Tea. He has been programming since 2004, but only got really passionate about it after discovering Ruby and its wonderful community. He also loves whiskey, and what could be better than sharing a few drinks with fellow Rubyists? J-pop, maybe?") - -$team << Organizer.new(:danielpuglisi, 'Daniel Puglisi', - social_media: { github: 'http://github.com/danielpuglisi', twitter: 'https://twitter.com/danielpuglisi', web: 'http://danielpuglisi.com' }, - gravatar_hash: "34fd3386654f1b625e1d3b8b6c43a217", - bio: "Fascinated by Ruby's english like syntax, the Rails Framework and the awesome community behind it, Daniel decided to put Ruby into his design and programming toolbox. Ruvetia is his attempt to make Ruby more fundamental and popular in Switzerland and to spread the love about this beautiful programming language and its extraordinary people behind it.") - -$team << Organizer.new(:kschiess, 'Kaspar Schiess', - social_media: { - bitbucket: 'https://bitbucket.org/kschiess', - github: 'http://github.com/kschiess', - web: 'http://absurd.li', - twitter: 'https://twitter.com/kasparschiess' }, - gravatar_hash: "ae4df18bf57748120b915d63b7e233d4", - bio: "Kaspar has found Ruby in 2003 and since then told everyone who would"+ - " listen about it. Working hard to promote the language as general purpose"+ - " programming language, he likes to take a pick at Rails, but only in jest."+ - " Take a look at his box of gems on github and be delighted by the useful "+ - " and the obscure.") - -$team << Organizer.new(:nerdinand, 'Ferdinand Niedermann', - social_media: { github: 'http://github.com/nerdinand', twitter: 'https://twitter.com/nerdinand' }, - gravatar_hash: "a69ea888ca7c5102e04e59a54d7db420", - bio: "Ferdinand got started with Ruby and Rails during his time at the University of Basel. He was soon amazed by the helpful and very active community around Ruby and worked at different companies to apply his Rails knowledge.") diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb deleted file mode 100644 index 33725e9..0000000 --- a/config/initializers/wrap_parameters.rb +++ /dev/null @@ -1,14 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# This file contains settings for ActionController::ParamsWrapper which -# is enabled by default. - -# 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] 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 -# end diff --git a/config/locales/en.yml b/config/locales/en.yml index 0653957..6c349ae 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,14 +1,14 @@ -# Files in the config/locales directory are used for internationalization -# and are automatically loaded by Rails. If you want to use locales other -# than English, add the necessary files in this directory. +# Files in the config/locales directory are used for internationalization and +# are automatically loaded by Rails. If you want to use locales other than +# English, add the necessary files in this directory. # # To use the locales, use `I18n.t`: # -# I18n.t 'hello' +# I18n.t "hello" # # In views, this is aliased to just `t`: # -# <%= t('hello') %> +# <%= t("hello") %> # # To use a different locale, set it with `I18n.locale`: # @@ -16,8 +16,16 @@ # # This would use the information in config/locales/es.yml. # -# To learn more, please read the Rails Internationalization guide -# available at http://guides.rubyonrails.org/i18n.html. +# To learn more about the API, please read the Rails Internationalization guide +# at https://guides.rubyonrails.org/i18n.html. +# +# Be aware that YAML interprets the following case-insensitive strings as +# booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings +# must be quoted to be interpreted as strings. For example: +# +# en: +# "yes": yup +# enabled: "ON" en: hello: "Hello world" diff --git a/config/puma.rb b/config/puma.rb new file mode 100644 index 0000000..afa809b --- /dev/null +++ b/config/puma.rb @@ -0,0 +1,35 @@ +# This configuration file will be evaluated by Puma. The top-level methods that +# are invoked here are part of Puma's configuration DSL. For more information +# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html. + +# 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. +max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } +min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } +threads min_threads_count, max_threads_count + +# Specifies that the worker count should equal the number of processors in production. +if ENV["RAILS_ENV"] == "production" + require "concurrent-ruby" + worker_count = Integer(ENV.fetch("WEB_CONCURRENCY") { Concurrent.physical_processor_count }) + workers worker_count if worker_count > 1 +end + +# Specifies the `worker_timeout` threshold that Puma will use to wait before +# terminating a worker in development environments. +worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development" + +# 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 `pidfile` that Puma will use. +pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } + +# Allow puma to be restarted by `bin/rails restart` command. +plugin :tmp_restart diff --git a/config/routes.rb b/config/routes.rb index 286dc12..bd31c97 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,12 @@ -Ruvetia::Application.routes.draw do +Rails.application.routes.draw do + # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html + + # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. + # Can be used by load balancers and uptime monitors to verify that the app is live. + get "up" => "rails/health#show", as: :rails_health_check + + # Defines the root path route ("/") + # root "posts#index" # we don't want www constraints(:host => /^www\./) do diff --git a/config/secrets.yml b/config/secrets.yml deleted file mode 100644 index b8e05a2..0000000 --- a/config/secrets.yml +++ /dev/null @@ -1,22 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key is used for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# 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 `rake 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: 37964380eefdd182807a4799f48631791faddbf0c1c9e09046b602b7211ab765f8d63a1fb15d84e75235f965dfb3428807c0b04fde8cafcf04431c5cafef8d47 - -test: - secret_key_base: 93c7dcfe33b1110f366783f0d3a0d6467c3098ae1c2b1e85f8a4678e61a5a526a4e218c29480d5f2d948c9dad8e989b4b341c9395f1a8ed7ab1a9f7f1d30ef68 - -# Do not keep production secrets in the repository, -# instead read values from the environment. -production: - secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/config/storage.yml b/config/storage.yml new file mode 100644 index 0000000..4942ab6 --- /dev/null +++ b/config/storage.yml @@ -0,0 +1,34 @@ +test: + service: Disk + root: <%= Rails.root.join("tmp/storage") %> + +local: + service: Disk + root: <%= Rails.root.join("storage") %> + +# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) +# amazon: +# service: S3 +# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> +# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> +# region: us-east-1 +# bucket: your_own_bucket-<%= Rails.env %> + +# Remember not to checkin your GCS keyfile to a repository +# google: +# service: GCS +# project: your_project +# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> +# bucket: your_own_bucket-<%= Rails.env %> + +# Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) +# microsoft: +# service: AzureStorage +# storage_account_name: your_account_name +# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> +# container: your_container_name-<%= Rails.env %> + +# mirror: +# service: Mirror +# primary: local +# mirrors: [ amazon, google, microsoft ] diff --git a/config/travis.database.yml b/config/travis.database.yml deleted file mode 100644 index c69ea6d..0000000 --- a/config/travis.database.yml +++ /dev/null @@ -1,21 +0,0 @@ -development: - adapter: postgresql - encoding: unicode - database: ruvetia_development - pool: 5 - username: postgres - password: - min_messages: warning - encoding: UTF8 - host: localhost - -test: - adapter: postgresql - encoding: unicode - database: ruvetia_test - pool: 5 - username: postgres - password: - min_messages: warning - encoding: UTF8 - host: localhost diff --git a/db/migrate/20130301180004_create_members.rb b/db/migrate/20130301180004_create_members.rb index a511474..66dc446 100644 --- a/db/migrate/20130301180004_create_members.rb +++ b/db/migrate/20130301180004_create_members.rb @@ -1,4 +1,4 @@ -class CreateMembers < ActiveRecord::Migration +class CreateMembers < ActiveRecord::Migration[4.2] def change create_table :members do |t| t.string :name diff --git a/db/migrate/20130301184145_create_participations.rb b/db/migrate/20130301184145_create_participations.rb index c5eb3f7..6367692 100644 --- a/db/migrate/20130301184145_create_participations.rb +++ b/db/migrate/20130301184145_create_participations.rb @@ -1,4 +1,4 @@ -class CreateParticipations < ActiveRecord::Migration +class CreateParticipations < ActiveRecord::Migration[4.2] def change create_table :participations do |t| t.integer :meetup_number @@ -6,6 +6,7 @@ def change t.timestamps end + add_index :participations, [:meetup_number, :member_id], unique: true end end diff --git a/db/migrate/20130430094913_change_github_id_to_integer.rb b/db/migrate/20130430094913_change_github_id_to_integer.rb index e3aea2d..d2c6da6 100644 --- a/db/migrate/20130430094913_change_github_id_to_integer.rb +++ b/db/migrate/20130430094913_change_github_id_to_integer.rb @@ -1,4 +1,4 @@ -class ChangeGithubIdToInteger < ActiveRecord::Migration +class ChangeGithubIdToInteger < ActiveRecord::Migration[4.2] def up execute 'ALTER TABLE members ALTER COLUMN github_id TYPE integer USING CAST(github_id AS INTEGER)' end diff --git a/db/migrate/20130807074014_change_meetup_number_to_meetup_id.rb b/db/migrate/20130807074014_change_meetup_number_to_meetup_id.rb index 80844ca..f57ddf5 100644 --- a/db/migrate/20130807074014_change_meetup_number_to_meetup_id.rb +++ b/db/migrate/20130807074014_change_meetup_number_to_meetup_id.rb @@ -1,4 +1,4 @@ -class ChangeMeetupNumberToMeetupId < ActiveRecord::Migration +class ChangeMeetupNumberToMeetupId < ActiveRecord::Migration[4.2] def change rename_column :participations, :meetup_number, :meetup_id end diff --git a/db/schema.rb b/db/schema.rb index 7e03dd7..441f925 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,38 +1,35 @@ -# encoding: UTF-8 # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). +# This file is the source Rails uses to define your schema when running `bin/rails +# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20130807074014) do - +ActiveRecord::Schema[7.1].define(version: 2013_08_07_074014) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" - create_table "members", force: :cascade do |t| - t.string "name" - t.string "email" - t.integer "github_id" - t.string "github_login" - t.string "github_oauth_token" - t.datetime "created_at" - t.datetime "updated_at" + create_table "members", id: :serial, force: :cascade do |t| + t.string "name" + t.string "email" + t.integer "github_id" + t.string "github_login" + t.string "github_oauth_token" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil end - create_table "participations", force: :cascade do |t| - t.integer "meetup_id" - t.integer "member_id" - t.datetime "created_at" - t.datetime "updated_at" + create_table "participations", id: :serial, force: :cascade do |t| + t.integer "meetup_id" + t.integer "member_id" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil + t.index ["meetup_id", "member_id"], name: "index_participations_on_meetup_id_and_member_id", unique: true end - add_index "participations", ["meetup_id", "member_id"], name: "index_participations_on_meetup_id_and_member_id", unique: true, using: :btree - end diff --git a/lib/tasks/.gitkeep b/lib/assets/.keep similarity index 100% rename from lib/tasks/.gitkeep rename to lib/assets/.keep diff --git a/log/.gitkeep b/lib/tasks/.keep similarity index 100% rename from log/.gitkeep rename to lib/tasks/.keep diff --git a/vendor/assets/javascripts/.gitkeep b/log/.keep similarity index 100% rename from vendor/assets/javascripts/.gitkeep rename to log/.keep diff --git a/package.json b/package.json new file mode 100644 index 0000000..da8f9fd --- /dev/null +++ b/package.json @@ -0,0 +1,10 @@ +{ + "name": "app", + "private": "true", + "dependencies": { + "sass": "^1.69.6" + }, + "scripts": { + "build:css": "sass ./app/assets/stylesheets/application.sass.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules" + } +} diff --git a/public/404.html b/public/404.html index 9a48320..2be3af2 100644 --- a/public/404.html +++ b/public/404.html @@ -2,25 +2,66 @@ The page you were looking for doesn't exist (404) - - +
    -

    The page you were looking for doesn't exist.

    -

    You may have mistyped the address or the page may have moved.

    +
    +

    The page you were looking for doesn't exist.

    +

    You may have mistyped the address or the page may have moved.

    +
    +

    If you are the application owner check the logs for more information.

    diff --git a/public/422.html b/public/422.html index 83660ab..c08eac0 100644 --- a/public/422.html +++ b/public/422.html @@ -2,25 +2,66 @@ The change you wanted was rejected (422) - - +
    -

    The change you wanted was rejected.

    -

    Maybe you tried to change something you didn't have access to.

    +
    +

    The change you wanted was rejected.

    +

    Maybe you tried to change something you didn't have access to.

    +
    +

    If you are the application owner check the logs for more information.

    diff --git a/public/500.html b/public/500.html index f3648a0..78a030a 100644 --- a/public/500.html +++ b/public/500.html @@ -2,24 +2,65 @@ We're sorry, but something went wrong (500) - - +
    -

    We're sorry, but something went wrong.

    +
    +

    We're sorry, but something went wrong.

    +
    +

    If you are the application owner check the logs for more information.

    diff --git a/vendor/assets/stylesheets/.gitkeep b/public/apple-touch-icon-precomposed.png similarity index 100% rename from vendor/assets/stylesheets/.gitkeep rename to public/apple-touch-icon-precomposed.png diff --git a/vendor/plugins/.gitkeep b/public/apple-touch-icon.png similarity index 100% rename from vendor/plugins/.gitkeep rename to public/apple-touch-icon.png diff --git a/public/robots.txt b/public/robots.txt index 085187f..c19f78a 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -1,5 +1 @@ -# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file -# -# To ban all spiders from the entire site uncomment the next two lines: -# User-Agent: * -# Disallow: / +# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file diff --git a/storage/.keep b/storage/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb new file mode 100644 index 0000000..d19212a --- /dev/null +++ b/test/application_system_test_case.rb @@ -0,0 +1,5 @@ +require "test_helper" + +class ApplicationSystemTestCase < ActionDispatch::SystemTestCase + driven_by :selenium, using: :chrome, screen_size: [1400, 1400] +end diff --git a/test/channels/application_cable/connection_test.rb b/test/channels/application_cable/connection_test.rb new file mode 100644 index 0000000..6340bf9 --- /dev/null +++ b/test/channels/application_cable/connection_test.rb @@ -0,0 +1,13 @@ +require "test_helper" + +module ApplicationCable + class ConnectionTest < ActionCable::Connection::TestCase + # test "connects with cookies" do + # cookies.signed[:user_id] = 42 + # + # connect + # + # assert_equal connection.user_id, "42" + # end + end +end diff --git a/test/system/.keep b/test/system/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/test_helper.rb b/test/test_helper.rb index 4a4979a..0c22470 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,19 +1,15 @@ -ENV["RAILS_ENV"] = "test" -require File.expand_path('../../config/environment', __FILE__) -require 'rails/test_help' -require 'capybara/rails' +ENV["RAILS_ENV"] ||= "test" +require_relative "../config/environment" +require "rails/test_help" -class ActiveSupport::TestCase -end +module ActiveSupport + class TestCase + # Run tests in parallel with specified workers + parallelize(workers: :number_of_processors) -class ActionDispatch::IntegrationTest - # Make the Capybara DSL available in all integration tests - include Capybara::DSL - Capybara.app = Ruvetia::Application - # Capybara.default_selector = :css + # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. + fixtures :all - teardown do - Capybara.reset_sessions! # Forget the (simulated) browser state - Capybara.use_default_driver # Revert Capybara.current_driver to Capybara.default_driver + # Add more helper methods to be used by all tests here... end end diff --git a/vendor/.keep b/vendor/.keep new file mode 100644 index 0000000..e69de29 diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..7a447ca --- /dev/null +++ b/yarn.lock @@ -0,0 +1,129 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +anymatch@~3.1.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +binary-extensions@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" + integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw== + +braces@~3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== + dependencies: + fill-range "^7.1.1" + +"chokidar@>=3.0.0 <4.0.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" + integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +compass@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/compass/-/compass-0.1.1.tgz#5c56d5eb442d10c1ad5989ef5c5e925db60c60e1" + integrity sha512-9z+RjcAGig6/9uAFeCbWajTvrye1u61ca5QrqN6JTrHRYOOgAKs33Xv/3/fODYthxWC2C97AE0e45PLETNRicg== + +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== + dependencies: + to-regex-range "^5.0.1" + +fsevents@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + +glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +immutable@^4.0.0: + version "4.3.6" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.6.tgz#6a05f7858213238e587fb83586ffa3b4b27f0447" + integrity sha512-Ju0+lEMyzMVZarkTn/gqRpdqd5dOPaz1mCZ0SH3JV6iFw81PldE/PEB1hWVEA288HPt4WXW8O7AWxB10M+03QQ== + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +picomatch@^2.0.4, picomatch@^2.2.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + +sass@^1.69.6: + version "1.77.2" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.77.2.tgz#18d4ed2eefc260cdc8099c5439ec1303fd5863aa" + integrity sha512-eb4GZt1C3avsX3heBNlrc7I09nyT00IUuo4eFhAbeXWU2fvA7oXI53SxODVAA+zgZCk9aunAZgO+losjR3fAwA== + dependencies: + chokidar ">=3.0.0 <4.0.0" + immutable "^4.0.0" + source-map-js ">=0.6.2 <2.0.0" + +"source-map-js@>=0.6.2 <2.0.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.0.tgz#16b809c162517b5b8c3e7dcd315a2a5c2612b2af" + integrity sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg== + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0"