grade_runner 0.0.3.pre.4 → 0.0.3.pre.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/tasks/grade.rake +5 -5
- data/lib/tasks/grade_runner.rake +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1998d265196255aef4a6fbd0cac907a6ea4a7644d404b18d5efb6d5206894037
|
4
|
+
data.tar.gz: 5b8ed5a4739025ba141effcfec6b79806d515847908735f0823e2f01e27cf8ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90f0f25e47b308eba572a313f40e0738fb675724477e0095e2341fe510cc920820d71d8ff60892f2a71d56cab1655b7896c21227c074e7e8be1437bf5a01cf7a
|
7
|
+
data.tar.gz: cd28875fdbd93a38d25afdab2b612d2a4de0896418c891417cd9a2c2dc881f2b6dd4c7199fda1f182abe13f6867d3c0e8f22495ec9ec7cd9ae6b69e3beafaf4c
|
data/Rakefile
CHANGED
@@ -40,7 +40,7 @@ task :default => :spec
|
|
40
40
|
|
41
41
|
require 'rdoc/task'
|
42
42
|
Rake::RDocTask.new do |rdoc|
|
43
|
-
version = File.
|
43
|
+
version = File.file?('VERSION') ? File.read('VERSION') : ""
|
44
44
|
|
45
45
|
rdoc.rdoc_dir = 'rdoc'
|
46
46
|
rdoc.title = "grade_runner #{version}"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.3.pre.4
|
1
|
+
0.0.3.pre.4.1
|
data/lib/tasks/grade.rake
CHANGED
@@ -13,7 +13,7 @@ namespace :grade do
|
|
13
13
|
student_config = {}
|
14
14
|
student_config["submission_url"] = "https://grades.firstdraft.com"
|
15
15
|
|
16
|
-
if File.
|
16
|
+
if File.file?(config_file_name)
|
17
17
|
begin
|
18
18
|
config = YAML.load_file(config_file_name)
|
19
19
|
rescue
|
@@ -26,11 +26,11 @@ namespace :grade do
|
|
26
26
|
submission_url = "https://grades.firstdraft.com"
|
27
27
|
end
|
28
28
|
|
29
|
-
if input_token.
|
29
|
+
if input_token.nil?
|
30
30
|
token = input_token
|
31
31
|
student_config["personal_access_token"] = input_token
|
32
32
|
update_config_file(config_file_name, student_config)
|
33
|
-
elsif input_token.nil? && file_token.
|
33
|
+
elsif input_token.nil? && file_token.nil?
|
34
34
|
token = file_token
|
35
35
|
elsif input_token.nil? && file_token.nil?
|
36
36
|
puts "Enter your access token for this project"
|
@@ -53,7 +53,7 @@ namespace :grade do
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
if token.
|
56
|
+
if token.nil?
|
57
57
|
if is_valid_token?(submission_url, token) == false
|
58
58
|
student_config["personal_access_token"] = nil
|
59
59
|
update_config_file(config_file_name, student_config)
|
@@ -79,7 +79,7 @@ namespace :grade do
|
|
79
79
|
desc "Run only the next failing test."
|
80
80
|
task :next do
|
81
81
|
path = File.join(__dir__, "examples.txt")
|
82
|
-
if File.
|
82
|
+
if File.file?(path)
|
83
83
|
# `bin/rails db:migrate RAILS_ENV=test`
|
84
84
|
# puts `RAILS_ENV=test bundle exec rspec --next-failure --format HintFormatter`
|
85
85
|
puts `bundle exec rspec --next-failure --format HintFormatter`
|
data/lib/tasks/grade_runner.rake
CHANGED
@@ -4,7 +4,7 @@ namespace :grade_runner do
|
|
4
4
|
default_submission_url = "https://grades.firstdraft.com"
|
5
5
|
config = {}
|
6
6
|
path = File.join(__dir__,"grades.yml")
|
7
|
-
if File.
|
7
|
+
if File.file?(path)
|
8
8
|
begin
|
9
9
|
config = YAML.load_file(path)
|
10
10
|
rescue
|
@@ -16,7 +16,7 @@ namespace :grade_runner do
|
|
16
16
|
reponame = ENV["CIRCLE_PROJECT_REPONAME"]
|
17
17
|
sha = ENV["CIRCLE_SHA1"]
|
18
18
|
token = ENV['GRADES_PERSONAL_ACCESS_TOKEN']
|
19
|
-
if token.
|
19
|
+
if token.nil?
|
20
20
|
GradeRunner::Runner.new('', config['submission_url'] || default_submission_url, token, rspec_output_json, username, reponame, sha, 'circle_ci').process
|
21
21
|
else
|
22
22
|
puts "We couldn't find your access token, so we couldn't record your grade. Please click on the assignment link again and run the rake grade ... command shown there."
|