powerapi 1.0.0 → 1.0.1
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/lib/powerapi/parser.rb +2 -0
- data/lib/powerapi/section.rb +4 -0
- data/lib/powerapi/version.rb +1 -1
- data/lib/powerapi.rb +10 -0
- data/spec/powerapi_spec.rb +14 -0
- data/spec/section_spec.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37841ff98ae99e8c2b0dd4b89464ab7c244a000d
|
4
|
+
data.tar.gz: 548bd5663509d0e6d35215ca755c5cf15eccc673
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c776a30b3c0bafdc48b4e758ed5a46722e2ceed47e40bf9aa6bf21159b8d2fda6c45d736ecb7a310da43c9c0d1f592020d1fff6220cd69ab6de0a0f774d565f7
|
7
|
+
data.tar.gz: 3586a016448f7c836d9f56db58521a1ec72357793dbdd8741b56727a89f0e13abaf380150d3d5ae124beec8ee7f4a3b2bdb504beebca111eb78b8a558858410f
|
data/lib/powerapi/parser.rb
CHANGED
data/lib/powerapi/section.rb
CHANGED
data/lib/powerapi/version.rb
CHANGED
data/lib/powerapi.rb
CHANGED
@@ -13,6 +13,8 @@ module PowerAPI
|
|
13
13
|
module_function
|
14
14
|
|
15
15
|
def authenticate(url, username, password, fetch_transcript=true)
|
16
|
+
url = clean_url(url)
|
17
|
+
|
16
18
|
soap_endpoint = url + "/pearson-rest/services/PublicPortalService"
|
17
19
|
|
18
20
|
login_client = Savon.client(
|
@@ -31,4 +33,12 @@ module PowerAPI
|
|
31
33
|
|
32
34
|
return PowerAPI::Student.new(url, session, fetch_transcript)
|
33
35
|
end
|
36
|
+
|
37
|
+
def clean_url(url)
|
38
|
+
if url[-1] == "/"
|
39
|
+
url = url[0..-2]
|
40
|
+
else
|
41
|
+
url = url
|
42
|
+
end
|
43
|
+
end
|
34
44
|
end
|
data/spec/powerapi_spec.rb
CHANGED
@@ -34,4 +34,18 @@ describe PowerAPI do
|
|
34
34
|
).to be_an_instance_of(PowerAPI::Student)
|
35
35
|
end
|
36
36
|
end
|
37
|
+
|
38
|
+
describe "#clean_url" do
|
39
|
+
it "leaves 'https://powerschool.example' alone" do
|
40
|
+
expect(
|
41
|
+
PowerAPI.clean_url("https://powerschool.example")
|
42
|
+
).to eq("https://powerschool.example")
|
43
|
+
end
|
44
|
+
|
45
|
+
it "removes the slash in 'https://powerschool.example/'" do
|
46
|
+
expect(
|
47
|
+
PowerAPI.clean_url("https://powerschool.example/")
|
48
|
+
).to eq("https://powerschool.example")
|
49
|
+
end
|
50
|
+
end
|
37
51
|
end
|
data/spec/section_spec.rb
CHANGED
@@ -57,6 +57,20 @@ describe PowerAPI::Section do
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
+
describe "#expression" do
|
61
|
+
it "has an expression of '1 (M-F)' at index 0" do
|
62
|
+
expect(
|
63
|
+
@section0.expression
|
64
|
+
).to eq("1 (M-F)")
|
65
|
+
end
|
66
|
+
|
67
|
+
it "has an expression of '3 (M-F)' at index 1" do
|
68
|
+
expect(
|
69
|
+
@section1.expression
|
70
|
+
).to eq("3 (M-F)")
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
60
74
|
describe "#final_grades" do
|
61
75
|
it "has one final grade at index 0" do
|
62
76
|
expect(
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: powerapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henri Watson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|