scholarcheck 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/README.md +14 -14
- data/lib/scholarcheck.rb +6 -6
- data/lib/scholarcheck/version.rb +1 -1
- 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: 615dd12fa34700764d54124bc628c6ac18352f8c
|
|
4
|
+
data.tar.gz: 3b4e9b026444c69ed26a1fb9eb4b24094bf6e21a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: acc2b255124630c0375fd05a475801510d85773a1b116316accdefa0cfd8441f1794dd3051cb581167e8e4fd08910e123e8cd84b6324e81a9bdfa94029f9be41
|
|
7
|
+
data.tar.gz: 17c4106796a5583bed9e3d863ed51125f6dd534380375a2bb2ccdab28c6fbff8d291d178e44afe5f23bc54dedcb9259052e41b6e08678fdeceb4eebc7dbe55d4
|
data/README.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ScholarCheck Ruby Wrapper
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
```ruby
|
|
4
|
+
scholar_check = ScholarCheck::ScholarCheck.new('vZokYZdMJL8PJWNbafyi0SopAhFstp')
|
|
5
|
+
|
|
6
|
+
scholar_check.valid?('ei12038@fe.up.pt') #true
|
|
7
|
+
scholar_check.valid?('abs@mit.edu') #true
|
|
8
|
+
scholar_check.valid?('as25@cam.ac.uk') #true
|
|
9
|
+
scholar_check.valid?('ruigomeseu@gmail.com') #false
|
|
10
|
+
|
|
11
|
+
scholar_check.institution('hall@fas.harvard.edu') #Harvard University
|
|
12
|
+
scholar_check.institution('vsmith@princeton.edu') #Princeton University
|
|
13
|
+
scholar_check.institution('as25@cam.ac.uk') #University of Cambridge
|
|
14
|
+
|
|
15
|
+
```
|
|
4
16
|
|
|
5
17
|
## Installation
|
|
6
18
|
|
|
@@ -17,15 +29,3 @@ And then execute:
|
|
|
17
29
|
Or install it yourself as:
|
|
18
30
|
|
|
19
31
|
$ gem install scholarcheck
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
|
|
23
|
-
TODO: Write usage instructions here
|
|
24
|
-
|
|
25
|
-
## Contributing
|
|
26
|
-
|
|
27
|
-
1. Fork it ( https://github.com/[my-github-username]/scholarcheck/fork )
|
|
28
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
29
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
30
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
|
31
|
-
5. Create a new Pull Request
|
data/lib/scholarcheck.rb
CHANGED
|
@@ -26,16 +26,16 @@ module ScholarCheck
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def api_call(endpoint)
|
|
29
|
-
|
|
29
|
+
uri = URI(@base_url + endpoint)
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
|
|
32
|
+
request = Net::HTTP::Get.new uri
|
|
33
|
+
request.add_field("Token", @api_token)
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
http.request(req)
|
|
35
|
+
http.request request
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
JSON.parse(
|
|
38
|
+
JSON.parse(response.body)
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
end
|
data/lib/scholarcheck/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: scholarcheck
|
|
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
|
- Rui Gomes
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-04-
|
|
11
|
+
date: 2015-04-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|