Commit d346125c authored by Zac Wood's avatar Zac Wood

Small refactors

parent 2b984243
......@@ -35,6 +35,8 @@ group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '~> 2.13'
gem 'pry'
gem 'pry-doc'
gem 'selenium-webdriver'
end
......
......@@ -53,6 +53,7 @@ GEM
xpath (>= 2.0, < 4.0)
childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11)
coderay (1.1.2)
concurrent-ruby (1.0.5)
crass (1.0.3)
erubi (1.7.1)
......@@ -83,6 +84,12 @@ GEM
nio4r (2.3.0)
nokogiri (1.8.2)
mini_portile2 (~> 2.3.0)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
pry-doc (0.13.4)
pry (~> 0.11)
yard (~> 0.9.11)
public_suffix (3.0.2)
puma (3.11.3)
rack (2.0.4)
......@@ -167,6 +174,7 @@ GEM
websocket-extensions (0.1.3)
xpath (3.0.0)
nokogiri (~> 1.8)
yard (0.9.12)
PLATFORMS
ruby
......@@ -177,6 +185,8 @@ DEPENDENCIES
icalendar
jbuilder (~> 2.5)
listen (>= 3.0.5, < 3.2)
pry
pry-doc
puma (~> 3.7)
rails (~> 5.1.6)
rubyXL
......
......@@ -19,7 +19,7 @@ class CalendarGeneratorController < ApplicationController
def generate_event_from_section(section)
event = Icalendar::Event.new
event.summary = section.name
event.description = section.title
event.location = section.location
......@@ -57,16 +57,18 @@ class CalendarGeneratorController < ApplicationController
end
def exdates_for_section(section)
exdates = Closure.where(semester: section.course.semester).map { |closure|
generate_exdate(closure.date.to_formatted_s(:number), section.start_time)
exdates = Closure.where(semester: section.course.semester).map { |closure|
generate_exdate(closure.date.to_formatted_s(:number), section.start_time)
}
# Every section's start_date is the first Monday of the semester.
# So we need to add an exclusion for that day unless the class is held on Mondays
exdates << generate_exdate(
section.start_date.to_formatted_s(:number),
unless section.days.start_with? "M"
exdates << generate_exdate(
section.start_date.to_formatted_s(:number),
section.start_time
) unless section.days.start_with? "M"
)
end
exdates
end
......
import * as FileSaver from 'file-saver';
import * as React from 'react';
import Section from '../section';
import SectionList from './SectionList';
import Search from './Search';
import * as FileSaver from 'file-saver';
import SectionList from './SectionList';
interface State {
currentSchedule: Section[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment