uw_sws 2.0.31 → 2.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +1 -1
- data/config-sample.yml +2 -0
- data/lib/uw_sws/version.rb +1 -1
- data/test/test_endpoints.rb +17 -21
- data/uw_sws.gemspec +2 -0
- metadata +32 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5a1ef6568ef393ad3453b7268c25317b65608ed
|
4
|
+
data.tar.gz: 7f3b426260a68d399abf91360f4e286e3fc27c2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5a3692a2757693a10f761803f553049c9798869abb12808d87377807904d8bf2682f2a3cc650690bdebb1eee8d532f48c699b824d8e65a18b4ef70b2dcfa79d
|
7
|
+
data.tar.gz: 4cfd22c88fb08813a4fe5d9fda82cbaa2f08fea37ccc7455506a5c763c3574b040025df1170e04dc15ced141fda1e5c5ddfe8bd184b3cf5d6f05ce186e49e62c
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -49,7 +49,6 @@ All links below go to the official service documentation. The code block refers
|
|
49
49
|
* [Department Search](https://wiki.cac.washington.edu/display/SWS/Department+Search+Resource+V5) ``service.departments``
|
50
50
|
* [Enrollment](https://wiki.cac.washington.edu/display/SWS/Enrollment+Resource+V5) ``service.enrollment``
|
51
51
|
* [Enrollment Search](https://wiki.cac.washington.edu/display/SWS/Enrollment+Search+Resource+V5) ``service.enrollments``
|
52
|
-
* [Personal Financial](https://wiki.cac.washington.edu/display/SWS/Personal+Financial+Resource+V5) ``service.finance``
|
53
52
|
* [Person](https://wiki.cac.washington.edu/display/SWS/Person+Resource+V5) ``service.person``
|
54
53
|
* [Person Search](https://wiki.cac.washington.edu/display/SWS/Person+Search+Resource+V5) ``service.people``
|
55
54
|
* [Registration](https://wiki.cac.washington.edu/display/SWS/Registration+Resource+V5) ``service.registration``
|
@@ -61,6 +60,7 @@ All links below go to the official service documentation. The code block refers
|
|
61
60
|
|
62
61
|
#### Partially Supported (may or may not work)
|
63
62
|
* [Notice](https://wiki.cac.washington.edu/display/SWS/Notice+Resource+V5) ``service.notice``
|
63
|
+
* [Personal Financial](https://wiki.cac.washington.edu/display/SWS/Personal+Financial+Resource+V5) ``service.finance``
|
64
64
|
|
65
65
|
#### Not implemented in this gem
|
66
66
|
Most of these are not implemented due to additional security requirements beyond a simple 509 cert. Requirements such as permissions in ASTRA or x-uw-act-as permissions passed in the header. Feel free fork and make a pull request with working tests if you have those permissions.
|
data/config-sample.yml
ADDED
data/lib/uw_sws/version.rb
CHANGED
data/test/test_endpoints.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
+
require "pry"
|
1
2
|
require "minitest/autorun"
|
2
3
|
require "json"
|
3
4
|
require "logger"
|
5
|
+
require "yaml"
|
4
6
|
require_relative "../lib/uw_sws"
|
5
7
|
|
6
8
|
describe UwSws do
|
@@ -10,9 +12,13 @@ describe UwSws do
|
|
10
12
|
|
11
13
|
# cert and key are required
|
12
14
|
# do not explicity set URL if you want to make sure to use v5 production
|
13
|
-
|
14
|
-
|
15
|
-
|
15
|
+
path = "#{Dir.pwd}/config.yml"
|
16
|
+
config = YAML.load_file(path)
|
17
|
+
raise "Missing #{path}." unless !config.nil?
|
18
|
+
|
19
|
+
cert = config["cert"]
|
20
|
+
key = config["key"]
|
21
|
+
url = "https://wseval.s.uw.edu/student/v5/"
|
16
22
|
@regid = "DB79E7927ECA11D694790004AC494FFE"
|
17
23
|
@uw = UwSws.new(cert: cert, key: key, throw_HEPPS: false,
|
18
24
|
logger: log, use_cache: true, base: url)
|
@@ -82,13 +88,13 @@ describe UwSws do
|
|
82
88
|
|
83
89
|
describe "when doing an enrollment search " do
|
84
90
|
it "it must equal 2" do
|
85
|
-
@uw.enrollments(@
|
91
|
+
@uw.enrollments(@regId).size.must_equal(2)
|
86
92
|
end
|
87
93
|
end
|
88
94
|
|
89
95
|
describe "when doing a verbose enrollment search " do
|
90
96
|
it "it must have 2" do
|
91
|
-
@uw.enrollments(@
|
97
|
+
@uw.enrollments(@regId, verbose: "on").size.must_be(2)
|
92
98
|
end
|
93
99
|
end
|
94
100
|
|
@@ -239,11 +245,12 @@ describe UwSws do
|
|
239
245
|
end
|
240
246
|
end
|
241
247
|
|
242
|
-
describe "when asked for section with a HEPPS error " do
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
end
|
248
|
+
#describe "when asked for section with a HEPPS error " do
|
249
|
+
# it "must respond with error 500" do
|
250
|
+
# @uw.section(2013, :autumn, "PB AF", 521, "A").must_be_nil
|
251
|
+
# end
|
252
|
+
#end
|
253
|
+
|
247
254
|
# course searches
|
248
255
|
# curric is not needed if searching by course number
|
249
256
|
# future terms must be 0-2, but, must be zero if exclude course w/o section
|
@@ -318,15 +325,4 @@ describe UwSws do
|
|
318
325
|
#puts @uw.notice data[0]["RegID"]
|
319
326
|
end
|
320
327
|
end
|
321
|
-
|
322
|
-
describe "when getting financial info " do
|
323
|
-
it "it must not be nil" do
|
324
|
-
term = @uw.term_current
|
325
|
-
data = @uw.registrations(term["Year"], term["Quarter"],
|
326
|
-
curriculum: "CSE", course: 142,
|
327
|
-
section: "A", active: "on")
|
328
|
-
result = @uw.finance data[0]["RegID"]
|
329
|
-
result["Person"].wont_be_nil
|
330
|
-
end
|
331
|
-
end
|
332
328
|
end
|
data/uw_sws.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uw_sws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.32
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nogbit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -52,6 +52,34 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry-byebug
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
55
83
|
description: Interfaces with UW Student Web Service
|
56
84
|
email:
|
57
85
|
- milesm@uw.edu
|
@@ -64,6 +92,7 @@ files:
|
|
64
92
|
- LICENSE.txt
|
65
93
|
- README.md
|
66
94
|
- Rakefile
|
95
|
+
- config-sample.yml
|
67
96
|
- lib/uw_sws.rb
|
68
97
|
- lib/uw_sws/version.rb
|
69
98
|
- test/test_endpoints.rb
|
@@ -88,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
117
|
version: '0'
|
89
118
|
requirements: []
|
90
119
|
rubyforge_project:
|
91
|
-
rubygems_version: 2.
|
120
|
+
rubygems_version: 2.2.2
|
92
121
|
signing_key:
|
93
122
|
specification_version: 4
|
94
123
|
summary: Wraps most of the rest endpoints
|