diff --git a/.env b/.env new file mode 100644 index 00000000..375b60d7 --- /dev/null +++ b/.env @@ -0,0 +1,5 @@ +RAILS_ENV=development +WEB_CONCURRENCY=1 +MAX_THREADS=4 +SECRET_TOKEN=temp +SECRET_KEY_BASE=temp diff --git a/.gitignore b/.gitignore index caa5349b..5b04c2f8 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,5 @@ # Ignore tern files \.tern-port -/coverage/ \ No newline at end of file +/coverage/ +/data/**/ diff --git a/.travis.yml b/.travis.yml index 1614cb04..212c9581 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,16 @@ -language: ruby -rvm: - - 2.2.3 -before_install: - - wget https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 - - tar -xjf phantomjs-2.0.0-ubuntu-12.04.tar.bz2 - - sudo rm -rf /usr/local/phantomjs/bin/phantomjs - - sudo mv phantomjs /usr/local/phantomjs/bin/phantomjs -before_script: - - psql -c 'create database "yacs-test";' -U postgres \ No newline at end of file +sudo: required + +services: + - docker + +env: + - RAILS_ENV=test + +install: + - bin/yacs-build + - bin/yacs-startd && docker ps + - sleep 10 + - bin/yacs-dbsetup + +script: + - bin/yacs-test diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..902c9ffd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM ruby:2.2.3 + +MAINTAINER Richie Young + +RUN apt-get update && apt-get install -qq -y build-essential nodejs wget --fix-missing --no-install-recommends + +ENV PHANTOMJS_VERSION 2.1.1 +RUN \ + apt-get install -y vim git wget libfreetype6 libfontconfig bzip2 && \ + wget -q --no-check-certificate -O /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 https://github.com/paladox/phantomjs/releases/download/2.1.7/phantomjs-2.1.1-linux-x86_64.tar.bz2 && \ + tar -xjf /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C /tmp && \ + rm -f /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 && \ + mv /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin/phantomjs /usr/bin/phantomjs + +ENV INSTALL_PATH /usr/src/app/ +RUN mkdir -p $INSTALL_PATH +RUN mkdir -p /var/run/puma + +WORKDIR $INSTALL_PATH +COPY Gemfile Gemfile.lock $INSTALL_PATH + +RUN bundle install +COPY . $INSTALL_PATH + +RUN mkdir -p /etc/puma/ssl +COPY nginx/ssl/ /etc/puma/ssl/ diff --git a/Gemfile.lock b/Gemfile.lock index 61a5bbb3..652eb7d4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -40,7 +40,8 @@ GEM minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.4.0) + addressable (2.5.0) + public_suffix (~> 2.0, >= 2.0.2) arel (6.0.3) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) @@ -48,7 +49,7 @@ GEM byebug (2.7.0) columnize (~> 0.3) debugger-linecache (~> 1.2) - capybara (2.10.1) + capybara (2.10.2) addressable mime-types (>= 1.16) nokogiri (>= 1.3.3) @@ -61,13 +62,13 @@ GEM coderay (1.1.1) columnize (0.9.0) concurrent-ruby (1.0.2) - coveralls (0.8.15) + coveralls (0.8.16) json (>= 1.8, < 3) simplecov (~> 0.12.0) - term-ansicolor (~> 1.3) + term-ansicolor (~> 1.3.0) thor (~> 0.19.1) tins (>= 1.6.0, < 2) - crono (1.0.3) + crono (1.1.2) activerecord (>= 4.0) activesupport (>= 4.0) cucumber (2.4.0) @@ -110,11 +111,11 @@ GEM sprockets (>= 2.0.0) tilt (>= 1.2) i18n (0.7.0) - jbuilder (2.6.0) + jbuilder (2.6.1) activesupport (>= 3.0.0, < 5.1) multi_json (~> 1.2) json (1.8.3) - libv8 (3.16.14.15) + libv8 (3.16.14.17) loofah (2.0.3) nokogiri (>= 1.5.9) mail (2.6.4) @@ -124,17 +125,17 @@ GEM mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) mini_portile2 (2.1.0) - minitest (5.9.1) + minitest (5.10.1) multi_json (1.12.1) multi_test (0.1.2) - newrelic_rpm (3.16.3.323) + newrelic_rpm (3.17.1.326) nokogiri (1.6.8.1) mini_portile2 (~> 2.1.0) pg (0.19.0) pickle (0.5.1) cucumber (>= 0.8) rake - poltergeist (1.10.0) + poltergeist (1.11.0) capybara (~> 2.1) cliver (~> 0.3.1) websocket-driver (>= 0.2.0) @@ -151,8 +152,9 @@ GEM pry-stack_explorer (0.4.9.2) binding_of_caller (>= 0.7) pry (>= 0.9.11) + public_suffix (2.0.4) puma (2.16.0) - rack (1.6.4) + rack (1.6.5) rack-test (0.6.3) rack (>= 1.0) railroady (1.5.2) @@ -211,7 +213,7 @@ GEM sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) - selenium-webdriver (2.53.4) + selenium-webdriver (3.0.3) childprocess (~> 0.5) rubyzip (~> 1.0) websocket (~> 1.0) @@ -230,18 +232,18 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - term-ansicolor (1.4.0) + term-ansicolor (1.3.2) tins (~> 1.0) therubyracer (0.12.2) libv8 (~> 3.16.14.0) ref - thor (0.19.1) + thor (0.19.4) thread_safe (0.3.5) tilt (2.0.5) - tins (1.12.0) + tins (1.13.0) tzinfo (1.2.2) thread_safe (~> 0.1) - uglifier (3.0.2) + uglifier (3.0.4) execjs (>= 0.3.0, < 3) web-console (2.3.0) activemodel (>= 4.0) @@ -293,4 +295,4 @@ DEPENDENCIES web-console (~> 2.0) BUNDLED WITH - 1.11.2 + 1.10.6 diff --git a/app/views/api/v5/sections/_sections.json.jbuilder b/app/views/api/v5/sections/_sections.json.jbuilder index 29959de2..5078d70e 100644 --- a/app/views/api/v5/sections/_sections.json.jbuilder +++ b/app/views/api/v5/sections/_sections.json.jbuilder @@ -11,5 +11,8 @@ json.sections sections do |section| i += 1 end end + json.course_name section.course.name + json.course_number section.course.number + json.department_code section.course.department.code end -end \ No newline at end of file +end diff --git a/app/views/static/index.html.erb b/app/views/static/index.html.erb index 08a5585f..54ec41db 100644 --- a/app/views/static/index.html.erb +++ b/app/views/static/index.html.erb @@ -29,7 +29,7 @@
Inspired by Jeff Hui's YACS.