grade_runner 0.0.3.pre.3 → 0.0.3.pre.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e7e47002e6b90c5bdd013d4834933bd3735ada2610bb863a428a3c391f3d1d86
4
- data.tar.gz: 68605c5761c65cbdf3c799af06c4c26b0cd9d4d61c1322377ede855bb575a1ee
3
+ metadata.gz: 78d36c19cabfff00aa753ae3971b98ee8b322706920fdb2615502afe9db192e2
4
+ data.tar.gz: bcee602c1f6a1dbf4579c74a71643ed1f4984bcad6af35afdab3e2088fa92999
5
5
  SHA512:
6
- metadata.gz: ce6ccd761d0abfe9cd2a254fb6f69b90a168ff65d7903ac5835fe81d3b2efc1704db438b80857555fbba4111f853d020b66700b624517eb8009dfd584d5eacd1
7
- data.tar.gz: 4480023cdc7cb0c5b8a0862c10c82c63d3beb4c49d7c5f659707b45805f7e4038d30c482e36728f924fa23cdeae1c2eb5be239cc81a95ab2a1bdfff82663de3e
6
+ metadata.gz: 1c98546b7953efd45a09b14b8357cc4bb2c69bc74d81962596496c9099e6956b3c81626320db5ae40a67cee742fe372a9ff8d664af72c8ae73f3f4e2adbd45fc
7
+ data.tar.gz: b839f46883a83fd28fe957ff5b2be8fecd2250f1567c4502d0fc377d9f16a59d34025f020fd09f5abe166637a75b0acd010732262e38b32f1f45c2ce5a3c52f9
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3.pre.3
1
+ 0.0.3.pre.4
@@ -1,11 +1,11 @@
1
- require 'rails'
1
+ # require 'rails'
2
2
 
3
3
  module GradeRunner
4
- class Railtie < ::Rails::Railtie
4
+ # class Railtie < ::Rails::Railtie
5
5
 
6
- rake_tasks do
7
- load "tasks/grade_runner.rake"
8
- load "tasks/grade.rake"
9
- end
10
- end
6
+ # rake_tasks do
7
+ # load "tasks/grade_runner.rake"
8
+ # load "tasks/grade.rake"
9
+ # end
10
+ # end
11
11
  end
data/lib/tasks/grade.rake CHANGED
@@ -9,7 +9,7 @@ namespace :grade do
9
9
  input_token = ARGV[1]
10
10
  file_token = nil
11
11
 
12
- config_file_name = Rails.root.join("grades.yml")
12
+ config_file_name = File.join(__dir__, "grades.yml")
13
13
  student_config = {}
14
14
  student_config["submission_url"] = "https://grades.firstdraft.com"
15
15
 
@@ -17,7 +17,7 @@ namespace :grade do
17
17
  begin
18
18
  config = YAML.load_file(config_file_name)
19
19
  rescue
20
- abort "It looks like there's something wrong with your token in `/grades.yml`. Please delete that file and try `rails grade:all` again, and be sure to provide the access token for THIS project.".red
20
+ abort "It looks like there's something wrong with your token in `/grades.yml`. Please delete that file and try `rake grade:all` again, and be sure to provide the access token for THIS project.".red
21
21
  end
22
22
  submission_url = config["submission_url"]
23
23
  file_token = config["personal_access_token"]
@@ -57,11 +57,13 @@ namespace :grade do
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)
60
- puts "Your access token looked invalid, so we've reset it to be blank. Please re-run rails grade and, when asked, copy-paste your token carefully from the assignment page."
60
+ puts "Your access token looked invalid, so we've reset it to be blank. Please re-run rake grade and, when asked, copy-paste your token carefully from the assignment page."
61
61
  else
62
- path = Rails.root.join("/tmp/output/#{Time.now.to_i}.json")
63
- `bin/rails db:migrate RAILS_ENV=test`
64
- `RAILS_ENV=test bundle exec rspec --order default --format JsonOutputFormatter --out #{path}`
62
+ path = File.join(__dir__, "/tmp/output/#{Time.now.to_i}.json")
63
+ # `bin/rails db:migrate RAILS_ENV=test`
64
+ `bin/rake db:migrate`
65
+ # `RAILS_ENV=test bundle exec rspec --order default --format JsonOutputFormatter --out #{path}`
66
+ `bundle exec rspec --order default --format JsonOutputFormatter --out #{path}`
65
67
  rspec_output_json = JSON.parse(File.read(path))
66
68
  username = ""
67
69
  reponame = ""
@@ -70,19 +72,21 @@ namespace :grade do
70
72
  GradeRunner::Runner.new(submission_url, token, rspec_output_json, username, reponame, sha, "manual").process
71
73
  end
72
74
  else
73
- 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 rails grade ... command shown there."
75
+ 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."
74
76
  end
75
77
  end
76
78
 
77
79
  desc "Run only the next failing test."
78
80
  task :next do
79
- path = Rails.root.join("examples.txt")
81
+ path = File.join(__dir__, "examples.txt")
80
82
  if File.exist?(path)
81
- `bin/rails db:migrate RAILS_ENV=test`
82
- puts `RAILS_ENV=test bundle exec rspec --next-failure --format HintFormatter`
83
+ # `bin/rails db:migrate RAILS_ENV=test`
84
+ # puts `RAILS_ENV=test bundle exec rspec --next-failure --format HintFormatter`
85
+ puts `bundle exec rspec --next-failure --format HintFormatter`
83
86
  else
84
- puts `RAILS_ENV=test bundle exec rspec`
85
- puts "Please rerun rails grade:next to run the first failing spec"
87
+ # puts `RAILS_ENV=test bundle exec rspec`
88
+ puts `bundle exec rspec`
89
+ puts "Please rerun rake grade:next to run the first failing spec"
86
90
  end
87
91
  end
88
92
 
@@ -3,12 +3,12 @@ namespace :grade_runner do
3
3
  task :runner do
4
4
  default_submission_url = "https://grades.firstdraft.com"
5
5
  config = {}
6
- path = Rails.root.join("grades.yml")
6
+ path = File.join(__dir__,"grades.yml")
7
7
  if File.exist?(path)
8
8
  begin
9
9
  config = YAML.load_file(path)
10
10
  rescue
11
- abort "It looks like there's something wrong with your token in `/grades.yml`. Please delete that file and try `rails grade:all` again, and be sure to provide the access token for THIS project.".red
11
+ abort "It looks like there's something wrong with your token in `/grades.yml`. Please delete that file and try `rake grade:all` again, and be sure to provide the access token for THIS project.".red
12
12
  end
13
13
  end
14
14
  rspec_output_json = JSON.parse(File.read("#{ENV['CIRCLE_ARTIFACTS']}/output/rspec_output.json"))
@@ -19,7 +19,7 @@ namespace :grade_runner do
19
19
  if token.present?
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
- 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 rails grade ... command shown there."
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."
23
23
  end
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grade_runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3.pre.3
4
+ version: 0.0.3.pre.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raghu Betina