From 51781b59c675bc257fc3a822f41dce16f10f7d4f Mon Sep 17 00:00:00 2001 From: Jeffrey Sturek Date: Wed, 31 Jul 2019 14:43:15 -0500 Subject: [PATCH 1/6] Replace IIM references with DXG --- views/template_partials/footer.erb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/views/template_partials/footer.erb b/views/template_partials/footer.erb index 85bd64e..4ce4674 100644 --- a/views/template_partials/footer.erb +++ b/views/template_partials/footer.erb @@ -1,15 +1,15 @@ \ No newline at end of file -- GitLab From ee844bd9f55e635acb7c75184e6bc130d19e6da2 Mon Sep 17 00:00:00 2001 From: JSTUREK8 Date: Wed, 31 Jul 2019 19:53:41 +0000 Subject: [PATCH 2/6] Revert "Replace IIM references with DXG" This reverts commit 51781b59c675bc257fc3a822f41dce16f10f7d4f --- views/template_partials/footer.erb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/views/template_partials/footer.erb b/views/template_partials/footer.erb index 4ce4674..85bd64e 100644 --- a/views/template_partials/footer.erb +++ b/views/template_partials/footer.erb @@ -1,15 +1,15 @@ \ No newline at end of file -- GitLab From fb8961213d9fcb3ab12dcc95d8dccce74ccba175 Mon Sep 17 00:00:00 2001 From: Jeff Sturek Date: Fri, 22 Nov 2019 14:28:41 -0600 Subject: [PATCH 3/6] Upgrade ruby to 2.6.5 --- Gemfile | 4 +- Gemfile.lock | 179 +++++++++++++++++++++++---------------------- config/config.json | 2 +- 3 files changed, 93 insertions(+), 92 deletions(-) diff --git a/Gemfile b/Gemfile index 6c047c6..d7e07a9 100644 --- a/Gemfile +++ b/Gemfile @@ -1,11 +1,11 @@ source "https://rubygems.org" -ruby '2.2.3' +ruby '2.6.5' gem 'sinatra' gem 'sinatra-contrib' gem 'activerecord', :require => 'active_record' -gem 'mysql' +gem 'mysql2' gem 'bcrypt' gem 'unicorn' gem 'pony' diff --git a/Gemfile.lock b/Gemfile.lock index 05c0eae..9bc332c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,36 +1,34 @@ GEM remote: https://rubygems.org/ specs: - activemodel (4.2.6) - activesupport (= 4.2.6) - builder (~> 3.1) - activerecord (4.2.6) - activemodel (= 4.2.6) - activesupport (= 4.2.6) - arel (~> 6.0) - activesupport (4.2.6) - i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) + activemodel (6.0.1) + activesupport (= 6.0.1) + activerecord (6.0.1) + activemodel (= 6.0.1) + activesupport (= 6.0.1) + activesupport (6.0.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.4.0) - arel (6.0.3) - backports (3.6.8) - bcrypt (3.1.11) - builder (3.2.2) - coderay (1.1.1) + zeitwerk (~> 2.2) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + backports (3.15.0) + bcrypt (3.1.13) + coderay (1.1.2) commonjs (0.2.7) - daemons (1.2.3) - domain_name (0.5.20160310) + concurrent-ruby (1.1.5) + daemons (1.3.1) + domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - eventmachine (1.2.0.1) - ffi (1.9.10) + eventmachine (1.2.7) + ffi (1.11.2) formatador (0.2.5) - guard (2.14.0) + guard (2.16.1) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) - lumberjack (~> 1.0) + lumberjack (>= 1.0.12, < 2.0) nenv (~> 0.1) notiffany (~> 0.0) pry (>= 0.9.12) @@ -41,95 +39,98 @@ GEM guard (~> 2.0) guard-compat (~> 1.2) less (~> 2.3) - http-cookie (1.0.2) + http-accept (1.7.0) + http-cookie (1.0.3) domain_name (~> 0.5) - i18n (0.7.0) - icalendar (2.4.1) - json (1.8.3) - kgio (2.10.0) + i18n (1.7.0) + concurrent-ruby (~> 1.0) + icalendar (2.5.3) + ice_cube (~> 0.16) + ice_cube (0.16.3) + kgio (2.11.2) less (2.6.0) commonjs (~> 0.2.7) - libv8 (3.16.14.15) - listen (3.1.5) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - ruby_dep (~> 1.2) - lumberjack (1.0.10) - mail (2.6.4) - mime-types (>= 1.16, < 4) - method_source (0.8.2) - mime-types (2.99.2) - mini_portile2 (2.1.0) - minitest (5.9.0) - multi_json (1.12.1) - mysql (2.9.1) + libv8 (3.16.14.19) + listen (3.2.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + lumberjack (1.0.13) + mail (2.7.1) + mini_mime (>= 0.1.1) + method_source (0.9.2) + mime-types (3.3) + mime-types-data (~> 3.2015) + mime-types-data (3.2019.1009) + mini_mime (1.0.2) + mini_portile2 (2.4.0) + minitest (5.13.0) + multi_json (1.14.1) + mustermann (1.0.3) + mysql2 (0.5.2) nenv (0.3.0) netrc (0.11.0) - nokogiri (1.6.8) - mini_portile2 (~> 2.1.0) - pkg-config (~> 1.1.7) - notiffany (0.1.0) + nokogiri (1.10.5) + mini_portile2 (~> 2.4.0) + notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) - pkg-config (1.1.7) - pony (1.11) + pony (1.13.1) mail (>= 2.0) - pry (0.10.3) + pry (0.12.2) coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - rack (1.6.4) - rack-cas (0.13.0) + method_source (~> 0.9.0) + public_suffix (4.0.1) + rack (2.0.7) + rack-cas (0.16.1) addressable (~> 2.3) nokogiri (~> 1.5) - rack (~> 1.3) - rack-protection (1.5.3) + rack (>= 1.3) + rack-protection (2.0.7) rack - rack-test (0.6.3) - rack (>= 1.0) - raindrops (0.16.0) - rb-fsevent (0.9.7) - rb-inotify (0.9.7) - ffi (>= 0.5.0) + raindrops (0.19.0) + rb-fsevent (0.10.3) + rb-inotify (0.10.0) + ffi (~> 1.0) ref (2.0.0) - rest-client (1.8.0) + rest-client (2.1.0) + http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 3.0) - netrc (~> 0.7) - ruby_dep (1.3.1) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) shellany (0.0.1) - shotgun (0.9.1) + shotgun (0.9.2) rack (>= 1.0) - sinatra (1.4.7) - rack (~> 1.5) - rack-protection (~> 1.4) - tilt (>= 1.3, < 3) - sinatra-contrib (1.4.7) - backports (>= 2.0) + sinatra (2.0.7) + mustermann (~> 1.0) + rack (~> 2.0) + rack-protection (= 2.0.7) + tilt (~> 2.0) + sinatra-contrib (2.0.7) + backports (>= 2.8.2) multi_json - rack-protection - rack-test - sinatra (~> 1.4.0) - tilt (>= 1.3, < 3) - slop (3.6.0) - therubyracer (0.12.2) - libv8 (~> 3.16.14.0) + mustermann (~> 1.0) + rack-protection (= 2.0.7) + sinatra (= 2.0.7) + tilt (~> 2.0) + therubyracer (0.12.3) + libv8 (~> 3.16.14.15) ref - thin (1.7.0) + thin (1.7.2) daemons (~> 1.0, >= 1.0.9) eventmachine (~> 1.0, >= 1.0.4) rack (>= 1, < 3) - thor (0.19.1) - thread_safe (0.3.5) - tilt (2.0.5) - tzinfo (1.2.2) + thor (0.20.3) + thread_safe (0.3.6) + tilt (2.0.10) + tzinfo (1.2.5) thread_safe (~> 0.1) unf (0.1.4) unf_ext - unf_ext (0.0.7.2) - unicorn (5.1.0) + unf_ext (0.0.7.6) + unicorn (5.5.1) kgio (~> 2.6) raindrops (~> 0.7) + zeitwerk (2.2.1) PLATFORMS ruby @@ -140,7 +141,7 @@ DEPENDENCIES guard guard-less icalendar - mysql + mysql2 pony rack-cas rest-client @@ -152,7 +153,7 @@ DEPENDENCIES unicorn RUBY VERSION - ruby 2.2.3p173 + ruby 2.6.5p114 BUNDLED WITH - 1.14.6 + 1.17.3 diff --git a/config/config.json b/config/config.json index 235d9fb..06dcf7e 100644 --- a/config/config.json +++ b/config/config.json @@ -1,6 +1,6 @@ { "database" : { - "adapter" : "mysql", + "adapter" : "mysql2", "host" : "localhost", "username" : "root", "password" : "", -- GitLab From d51d8702e75028f6067db7cf966b8293abbf3ad0 Mon Sep 17 00:00:00 2001 From: Jeff Sturek Date: Fri, 22 Nov 2019 14:54:18 -0600 Subject: [PATCH 4/6] Update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 73a3c7a..2134667 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ Installation Using local resources --------------------- 0. Run `xcode-select --install`. Congratulations, you have saved yourself 5000 insanity points. -1. Get the right ruby on your machine. UNL Resource Scheduler currently runs on Ruby 2.2.3. Get RVM on your machine with `\curl -sSL https://get.rvm.io | bash`. -2. Now using RVM, install the ruby with `rvm install 2.2.3`. +1. Get the right ruby on your machine. UNL Resource Scheduler currently runs on Ruby 2.6.5. Get RVM on your machine with `\curl -sSL https://get.rvm.io | bash`. +2. Now using RVM, install the ruby with `rvm install 2.6.5`. 3. You probably do not have the `bundler` gem. Check with `bundle`. If not, install it with `gem install bundler`. 4. In the project root, install the gems using `bundle install`. 5. Create a mysql database you'd like to use, you can typically use one on your computer. `brew install mysql` if necessary. -- GitLab From 0557140ad09efde6291b8f51fd1d7f9cc3ea68a7 Mon Sep 17 00:00:00 2001 From: Jeff Sturek Date: Thu, 9 Jan 2020 11:14:46 -0600 Subject: [PATCH 5/6] Update gems again --- Gemfile.lock | 62 +++++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9bc332c..1ed0e81 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,12 +1,12 @@ GEM remote: https://rubygems.org/ specs: - activemodel (6.0.1) - activesupport (= 6.0.1) - activerecord (6.0.1) - activemodel (= 6.0.1) - activesupport (= 6.0.1) - activesupport (6.0.1) + activemodel (6.0.2.1) + activesupport (= 6.0.2.1) + activerecord (6.0.2.1) + activemodel (= 6.0.2.1) + activesupport (= 6.0.2.1) + activesupport (6.0.2.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -23,7 +23,7 @@ GEM domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) eventmachine (1.2.7) - ffi (1.11.2) + ffi (1.11.3) formatador (0.2.5) guard (2.16.1) formatador (>= 0.2.4) @@ -42,34 +42,35 @@ GEM http-accept (1.7.0) http-cookie (1.0.3) domain_name (~> 0.5) - i18n (1.7.0) + i18n (1.8.1) concurrent-ruby (~> 1.0) - icalendar (2.5.3) + icalendar (2.6.1) ice_cube (~> 0.16) ice_cube (0.16.3) - kgio (2.11.2) + kgio (2.11.3) less (2.6.0) commonjs (~> 0.2.7) libv8 (3.16.14.19) - listen (3.2.0) + listen (3.2.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - lumberjack (1.0.13) + lumberjack (1.1.0) mail (2.7.1) mini_mime (>= 0.1.1) method_source (0.9.2) - mime-types (3.3) + mime-types (3.3.1) mime-types-data (~> 3.2015) mime-types-data (3.2019.1009) mini_mime (1.0.2) mini_portile2 (2.4.0) minitest (5.13.0) multi_json (1.14.1) - mustermann (1.0.3) - mysql2 (0.5.2) + mustermann (1.1.1) + ruby2_keywords (~> 0.0.1) + mysql2 (0.5.3) nenv (0.3.0) netrc (0.11.0) - nokogiri (1.10.5) + nokogiri (1.10.7) mini_portile2 (~> 2.4.0) notiffany (0.1.3) nenv (~> 0.1) @@ -79,17 +80,17 @@ GEM pry (0.12.2) coderay (~> 1.1.0) method_source (~> 0.9.0) - public_suffix (4.0.1) - rack (2.0.7) + public_suffix (4.0.3) + rack (2.0.8) rack-cas (0.16.1) addressable (~> 2.3) nokogiri (~> 1.5) rack (>= 1.3) - rack-protection (2.0.7) + rack-protection (2.0.8.1) rack - raindrops (0.19.0) + raindrops (0.19.1) rb-fsevent (0.10.3) - rb-inotify (0.10.0) + rb-inotify (0.10.1) ffi (~> 1.0) ref (2.0.0) rest-client (2.1.0) @@ -97,20 +98,21 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) + ruby2_keywords (0.0.2) shellany (0.0.1) shotgun (0.9.2) rack (>= 1.0) - sinatra (2.0.7) + sinatra (2.0.8.1) mustermann (~> 1.0) rack (~> 2.0) - rack-protection (= 2.0.7) + rack-protection (= 2.0.8.1) tilt (~> 2.0) - sinatra-contrib (2.0.7) + sinatra-contrib (2.0.8.1) backports (>= 2.8.2) multi_json mustermann (~> 1.0) - rack-protection (= 2.0.7) - sinatra (= 2.0.7) + rack-protection (= 2.0.8.1) + sinatra (= 2.0.8.1) tilt (~> 2.0) therubyracer (0.12.3) libv8 (~> 3.16.14.15) @@ -119,18 +121,18 @@ GEM daemons (~> 1.0, >= 1.0.9) eventmachine (~> 1.0, >= 1.0.4) rack (>= 1, < 3) - thor (0.20.3) + thor (1.0.1) thread_safe (0.3.6) tilt (2.0.10) - tzinfo (1.2.5) + tzinfo (1.2.6) thread_safe (~> 0.1) unf (0.1.4) unf_ext unf_ext (0.0.7.6) - unicorn (5.5.1) + unicorn (5.5.2) kgio (~> 2.6) raindrops (~> 0.7) - zeitwerk (2.2.1) + zeitwerk (2.2.2) PLATFORMS ruby -- GitLab From e78c1b224ba0f6c3e0dead654a66de67b575e34a Mon Sep 17 00:00:00 2001 From: Jeff Sturek Date: Thu, 9 Jan 2020 11:49:21 -0600 Subject: [PATCH 6/6] Move repeated constants to one spot --- app.rb | 4 ++++ views/calendar.erb | 6 +----- views/reserve.erb | 6 +----- views/resource_calendar.erb | 6 +----- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/app.rb b/app.rb index 0e50299..c2602c7 100644 --- a/app.rb +++ b/app.rb @@ -29,6 +29,10 @@ DIRECTORY_URL = 'https://directory.unl.edu/' NIS_SS_ID = ServiceSpace.where(:name => 'Innovation Studio').first.id NIS_TOOL_RESOURCE_CLASS_ID = 1 +HALF_HOUR_HEIGHT = 28 # pixel height of half-hour sections in calendar. DO NOT CHANGE RESPONSIVELY +SIX_AM_MINUTES = 360 # start time of calendar +EIGHT_PM_MINUTES = 1200 # end time of calendar + # this gives the user messages def flash(type, header, message) session["notice"] ||= [] diff --git a/views/calendar.erb b/views/calendar.erb index c669623..cc288c2 100644 --- a/views/calendar.erb +++ b/views/calendar.erb @@ -1,10 +1,6 @@ <% events_groups = events.group_by do |event| event.start_time.in_time_zone.strftime("%Y/%m/%d") -end - -HALF_HOUR_HEIGHT = 28 # pixel height of half-hour sections in calendar. DO NOT CHANGE RESPONSIVELY -SIX_AM_MINUTES = 360 # start time of calendar -EIGHT_PM_MINUTES = 1200 # end time of calendar +end %>
diff --git a/views/reserve.erb b/views/reserve.erb index 952c653..c73b10c 100644 --- a/views/reserve.erb +++ b/views/reserve.erb @@ -12,11 +12,7 @@ unless reservation.nil? end start_hour += 12 if start_hour == 0 start_minute = reservation.start_time.in_time_zone.min -end - -HALF_HOUR_HEIGHT = 28 # pixel height of half-hour sections in calendar. DO NOT CHANGE RESPONSIVELY -SIX_AM_MINUTES = 360 # start time of calendar -EIGHT_PM_MINUTES = 1200 # end time of calendar +end %>

<%= reservation.nil? ? 'Reserve Time for ' : 'Edit Reservation for ' %><%= resource.name %>

diff --git a/views/resource_calendar.erb b/views/resource_calendar.erb index c1758b0..1383c02 100644 --- a/views/resource_calendar.erb +++ b/views/resource_calendar.erb @@ -1,10 +1,6 @@ <% reservation_groups = reservations.group_by do |reservation| reservation.start_time.in_time_zone.strftime("%Y/%m/%d") -end - -HALF_HOUR_HEIGHT = 28 # pixel height of half-hour sections in calendar. DO NOT CHANGE RESPONSIVELY -SIX_AM_MINUTES = 360 # start time of calendar -EIGHT_PM_MINUTES = 1200 # end time of calendar +end %> <% if kiosk_mode %> -- GitLab