grade_runner 0.0.4.pre.19 → 0.0.4.pre.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/tasks/grade.rake +12 -2
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1712671996eea84991468c719d1d77f402ebaf17f7ae305473678dbbabaccf2
4
- data.tar.gz: d539b8f35364af050386aad7bde779c55f3d14d9828a30fa07101fbc0f4e69d5
3
+ metadata.gz: '070915299f7c5c937ac216285f003f2a17a74a443421dd222bf7e92a2252e871'
4
+ data.tar.gz: 3291f47534deceaeaf0c0f8b159abf24d50f3cc11577f5d9c3d0dcf707567847
5
5
  SHA512:
6
- metadata.gz: 175a61e67fedd4eacbd5aa0360e0cda685f138c88b61252cdc1740fe2243d1aaf6f6a2ab70e7751878b33ac7785177e70999da310ed6f240167653adb00d9931
7
- data.tar.gz: 3c8773e7cdfb2cb5e6f77df1b32a4376510a4db5795c38d71894454647890147492e0d034afd1e6126e4958c34c84af40cc44077fc4a378e8bd805f1b28fee90
6
+ metadata.gz: 9ffd1185c5bb93da3e1cc062848ddb2f9c7b3703588efc3bd8cc4cb782c1642ceeada4ac8c5879ea8128439b6d0a2cb7123a6c791bac50c513a73b05bac91302
7
+ data.tar.gz: 0aa782b80664769e042092b399441107197cfcf31e1b2eac869a5d4c679776db479f594fcd0bbbeb84dea75f496101b404ab95a618bda4757df3318b793cd5ac
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4.pre.19
1
+ 0.0.4.pre.20
data/lib/tasks/grade.rake CHANGED
@@ -31,16 +31,21 @@ namespace :grade do
31
31
  submission_url = "https://grades.firstdraft.com"
32
32
  end
33
33
 
34
+ p "File found"#REMOVE
34
35
  if !input_token.nil?
36
+ p "input token:"#REMOVE
37
+ p input_token#REMOVE
35
38
  token = input_token
36
39
  student_config["personal_access_token"] = input_token
37
40
  update_config_file(config_file_name, student_config)
38
41
  elsif input_token.nil? && !file_token.nil?
42
+ p "file token"
43
+ p file_token
39
44
  token = file_token
40
45
  elsif input_token.nil? && file_token.nil?
41
46
  puts "Enter your access token for this project"
42
47
  new_personal_access_token = ""
43
-
48
+ p "Entering new token" #REMOVE
44
49
  while new_personal_access_token == "" do
45
50
  print "> "
46
51
  new_personal_access_token = $stdin.gets.chomp.strip
@@ -55,10 +60,12 @@ namespace :grade do
55
60
  update_config_file(config_file_name, student_config)
56
61
  token = new_personal_access_token
57
62
  end
63
+ p "end of loop" #REMOVE
58
64
  end
59
65
  end
60
66
 
61
67
  if !token.nil?
68
+ p "token not nil" #REMOVE
62
69
  if is_valid_token?(submission_url, token) == false
63
70
  student_config["personal_access_token"] = nil
64
71
  update_config_file(config_file_name, student_config)
@@ -104,6 +111,7 @@ def update_config_file(config_file_name, config)
104
111
  end
105
112
 
106
113
  def is_valid_token?(root_url, token)
114
+ p "is valid" #REMOVE
107
115
  return false unless token.is_a?(String) && token =~ /^[1-9A-Za-z][^OIl]{23}$/
108
116
  url = "#{root_url}/submissions/validate_token?token=#{token}"
109
117
  uri = URI.parse(url)
@@ -114,6 +122,8 @@ def is_valid_token?(root_url, token)
114
122
  result = JSON.parse(res.body)
115
123
  result["success"]
116
124
  rescue => e
125
+ p "error" #REMOVE
126
+ p e #REMOVE
117
127
  return false
118
128
  end
119
129
 
@@ -125,6 +135,6 @@ def project_root
125
135
  # if defined?(Bundler)
126
136
  # return Bundler.root
127
137
  # end
128
-
138
+ p "project root" #REMOVE
129
139
  Dir.pwd
130
140
  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.4.pre.19
4
+ version: 0.0.4.pre.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raghu Betina