Closed jelaniwoods closed 1 year ago
@jelaniwoods I'm trying to get a sinatra app grading via either Gitpod or Codespaces (preferably both) with rails grade
. I made the repo, added specs, and put it on the testing canvas and am trying both Gitpod and Codespaces; but I keep getting a permission denied error that I can't seem to debug. Is my repo setup missing something? I based the file structure (e.g. bin/
folder) off of the ruby-string chapter (non-rails based).
And here is the Canvas launcher to test with the rails grade token
I keep getting a permission denied error that I can't seem to debug.
@bpurinton this sounds like a file permissions issue that can be resolved by making bin/rails
executable. You can do this by running chmod 755 bin/rails
, and then bin/rails grade
should run.
Though, looking at your repo I realize that rake
wasn't added as a runtime dependency. I'll add that now.
D'oh. I was trying sudo
to get around it; forgot all about chmod
. Everything runs beautifully with bin/rails grade
. But, we are likely going to change grading to rake grade
. Is that something we will change in this repo (maybe on a separate PR) or is that a change that will be made somewhere in the bin/
files for each project repo?
we are likely going to change grading to rake grade
@bpurinton Nothing about this gem needs to change for rake grade
to work.
In Rails apps, grade
is already loaded as a Rake task that can be run by either rails grade
or rake grade
.
In non-Rails apps, bin/rails
is just named to be consistent with Rails apps, but you can name the file anything including bin/rake
to make bin/rake grade
work if that's the new thing. You can also add the bin
folder to PATH
to make it so students can run rake grade
in a non-Rails environment too.
Does that help clarify?
Thanks for clarifying things here! I think I've fully gotten my head around grade_runner
finally. And this change LGTM in case that wasn't clear.
Resolves #65
Problem
In the efforts to come up with one Gemfile for the entire "appdev" course, it would simplify things if
grade_runner
andruby_grade_runner
were unified into one gem instead of having to install both and remove one depending on which project is being worked on.The main reason for the two gems was because
grade_runner
was assumed to be installed in a Rails app and didn't properly load methods from active support that were being used.Solution
This PR:
activesupport
as a runtime dependencyrake
as a runtime dependencyoj
gem version to deal with Ruby 3 deprecation warningAn unrelated change I added was the ability to record the GitHub username of the person running
rails grade
. Previously, this was just reporting the full name of the user from the local Git config. In this PR I've added an API call to GitHub to retrieve the username and fallback to the full name if one is not found.I've also bumped the gem version
Test
Install this version of the gem
Rails
You should be all set! Just run
rails grade
again as usual.non-Rails
Update
bin/rails
to findgrade_runner
instead ofruby_grade_runner
.then
bin/rails grade
as usual.