martlet 0.0.2 → 0.0.3

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.
@@ -6,15 +6,25 @@ module Martlet
6
6
 
7
7
  def initialize(email, password)
8
8
  @agent = Mechanize.new
9
- @email = email
9
+ @email = format_email(email)
10
10
 
11
11
  authenticator = Authenticator.new(@agent)
12
- authenticator.authenticate(email, password)
12
+ authenticator.authenticate(@email, password)
13
13
  end
14
14
 
15
15
  def grades
16
16
  transcript = Transcript.new(@agent)
17
17
  transcript.fetch_grades
18
18
  end
19
+
20
+ private
21
+
22
+ def format_email(email)
23
+ if email.include?('@')
24
+ email
25
+ else
26
+ "#{email}@mail.mcgill.ca"
27
+ end
28
+ end
19
29
  end
20
30
  end
@@ -1,3 +1,3 @@
1
1
  module Martlet
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: martlet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: