diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14aea7b6f..b4992e7d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,12 +19,12 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7.4 + ruby-version: 2.7.6 bundler-cache: true - name: Setup Databse @@ -35,7 +35,7 @@ jobs: RAILS_ENV: test - name: Run tests + run: bundle exec rspec --color --format progress --require spec_helper --require rails_helper env: RAILS_ENV: test CC_TEST_REPORTER_ID: true - run: bundle exec rspec --color --format progress --require spec_helper --require rails_helper \ No newline at end of file diff --git a/.ruby-version b/.ruby-version index a4dd9dba4..bf3abf715 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1,2 @@ -2.7.4 +2.7.6 + diff --git a/Gemfile b/Gemfile index 56348b9a2..d12ca4016 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ source 'https://rubygems.org' -ruby '2.7.4' +ruby '2.7.6' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 6.1.4.7' @@ -16,9 +16,6 @@ gem 'uglifier' # Use CoffeeScript for .js.coffee assets and views gem 'coffee-rails', '~> 5.0' -# See https://github.com/sstephenson/execjs#readme for more supported runtimes -gem 'therubyracer', '~> 0.12.0', platforms: :ruby - # Use jquery as the JavaScript library gem 'jquery-rails', '~> 4.3' diff --git a/Gemfile.lock b/Gemfile.lock index 22ac14156..dc9bc514d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -192,7 +192,6 @@ GEM addressable (~> 2.7) letter_opener (1.7.0) launchy (~> 2.2) - libv8 (3.16.14.19) loofah (2.16.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) @@ -279,7 +278,6 @@ GEM raindrops (0.19.1) rake (13.0.6) rdoc (6.3.1) - ref (2.0.0) regexp_parser (2.1.1) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) @@ -304,7 +302,7 @@ GEM rspec-mocks (~> 3.10) rspec-support (~> 3.10) rspec-support (3.10.2) - rubocop (1.11.0) + rubocop (1.13.0) parallel (~> 1.10) parser (>= 3.0.0.0) rainbow (>= 2.2.2, < 4.0) @@ -361,9 +359,6 @@ GEM net-ssh (>= 2.8.0) terrapin (0.6.0) climate_control (>= 0.0.3, < 1.0) - therubyracer (0.12.3) - libv8 (~> 3.16.14.15) - ref thor (1.2.1) tilt (2.0.10) timeliness (0.4.4) @@ -460,7 +455,6 @@ DEPENDENCIES sentry-raven simple_form simplecov - therubyracer (~> 0.12.0) tinymce-rails (~> 5.6) tinymce-rails-langs (~> 5.20200505) traco @@ -473,7 +467,8 @@ DEPENDENCIES will_paginate-bootstrap RUBY VERSION - ruby 2.7.4p191 + ruby 2.7.6p219 + BUNDLED WITH - 2.1.4 + 2.3.11 diff --git a/lib/tasks/project.rake b/lib/tasks/project.rake deleted file mode 100644 index a7d944c7c..000000000 --- a/lib/tasks/project.rake +++ /dev/null @@ -1,69 +0,0 @@ -require 'highline/import' - -namespace :project do - desc "register yourself for the swt2 project with your github username and your immatriculation number" - task "register" => [:spec] do - say "Tests ran successfully. Congratulations! Now please register yourself for the project." - say_line - github_username = get_github_username() - - unless github_username.nil? - say_line - codeschool_account_number = ask("Please enter your Codeschool Account Id.: ", String) - register(github_username, codeschool_account_number) - end - end - - def get_github_username() - github_user = `git config --get user.name` - github_user.strip! - choose do |menu| - menu.prompt = "Is '#{github_user}' your github username? " - menu.choice("yes") { return github_user } - menu.choice("no") { - say_warning - return nil - } - end - end - - def say_warning - say("Please set your git username to match your github account (<%= color('git config user.name \"\"', BOLD) %>)!") - end - - def register(github_name, codeschool_account_number) - mat_nr = ask("Please enter your HPI Account Name: ", String) - begin - resp = RestClient.post(server_address, assignment_hash(github_name, mat_nr, codeschool_account_number), {:accept => :json}) - say(JSON.parse(resp.body)["message"]) - rescue => e - if e.response.code == 409 - json = JSON.parse(e.response.body) - say(json["message"]) - say_line - choose do |menu| - menu.prompt = "Overwrite existing record?" - menu.choice("yes") { - resp = RestClient.put(json["redirect_url"], assignment_hash(github_name, mat_nr, codeschool_account_number), {:accept => :json}) - say(JSON.parse(resp.body)["message"]) - } - menu.choice("no") {return} - end - else - puts e.response - end - end - end - - def server_address() - "http://192.168.30.32:3000/assignments" - end - - def say_line - say("------------------") - end - - def assignment_hash(github_name, mat_nr, codeschool_account_number) - {:assignment => {:github_account => github_name, :mat_nr => mat_nr, :code_school_account => codeschool_account_number}} - end -end