psu_identity 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 643de6e39ef7a39a897e8fc676e72cc61cb464fdd24b65cea2bc005845ce284d
4
- data.tar.gz: 9b864ade99b2016694aa58ccc94e79ad662c959944a52deb292f704892d07d7f
3
+ metadata.gz: 5d3f87c3035f20409f1987d81d696940fc0a017400da2f83041ff291e35601b3
4
+ data.tar.gz: 0d23bb5ef092eca44bcf89e1bf94896a627415dcd0e6eb48385d6f794b9cf60a
5
5
  SHA512:
6
- metadata.gz: ffe982ee3c4c68a07152e2500dbdfea69213f26040322b84c95bd8f9292cd358060555f5d39d3d72867170fab722a7fafb2fbef82fd152a4b8609ca1afdeca65
7
- data.tar.gz: f4938672ac8e04c2dc7c637439d044f55517b019065e66ef368f2467883638ad9f83270fff526ebd3a140c1c0dbefe18bfb2a0d58cf2cd5cb607d004cd66e60c
6
+ metadata.gz: c5dfcae9ca3c8a9682a1230404faef7d4b63e50c1e4e9e951986f158d8362290477493470a3c4bd1cc6836d3bb6e53cc2ce6661269bd8defa53d30982f36415b
7
+ data.tar.gz: 764530285679ed547889f7012bd63c413fc308c5cbd19d4290dcaffc0735101cc2666386b66a84b3cac25e9e92fffdb52a517492ed1c4ee52e74784f37a16247
@@ -22,6 +22,22 @@ jobs:
22
22
  # An orb function for bundling
23
23
  - ruby/bundle-install
24
24
 
25
+ - run:
26
+ name: Setup Code Climate test-reporter
27
+ command: |
28
+ # download test reporter as a static binary
29
+ curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > bin/cc-test-reporter
30
+ chmod +x bin/cc-test-reporter
31
+
32
+ # TODO Remove quotes when rubocop fixes are made
33
+ # - run:
34
+ # name: "Rubocop"
35
+ # command: |
36
+ # bundle exec rubocop
37
+
25
38
  - run:
26
39
  name: "Rspec"
27
- command: RAILS_ENV=test bundle exec rspec
40
+ command: |
41
+ RAILS_ENV=test bundle exec rspec &&
42
+ bin/cc-test-reporter format-coverage -t simplecov -o coverage/codeclimate.json coverage/.resultset.json &&
43
+ bin/cc-test-reporter upload-coverage
data/Gemfile CHANGED
@@ -5,6 +5,10 @@ gemspec
5
5
 
6
6
  gem "rake", "~> 12.0"
7
7
  gem 'faraday', '~> 0.17.0'
8
+ # SimpleCov > 0.17 not compatible with Code Climate
9
+ gem 'simplecov', '=0.17'
10
+ gem 'rubocop', '~> 0.0'
11
+ gem 'json'
8
12
 
9
13
  group :test do
10
14
  # Rspec and packages
@@ -1,22 +1,31 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- psu_identity (0.1.1)
4
+ psu_identity (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  addressable (2.7.0)
10
10
  public_suffix (>= 2.0.2, < 5.0)
11
+ ast (2.4.0)
11
12
  crack (0.4.3)
12
13
  safe_yaml (~> 1.0.0)
13
14
  diff-lcs (1.3)
15
+ docile (1.3.2)
14
16
  faraday (0.17.3)
15
17
  multipart-post (>= 1.2, < 3)
16
18
  hashdiff (1.0.1)
19
+ json (2.3.0)
17
20
  multipart-post (2.1.1)
21
+ parallel (1.19.1)
22
+ parser (2.7.1.3)
23
+ ast (~> 2.4.0)
18
24
  public_suffix (4.0.4)
25
+ rainbow (3.0.0)
19
26
  rake (12.3.3)
27
+ regexp_parser (1.7.0)
28
+ rexml (3.2.4)
20
29
  rspec (3.9.0)
21
30
  rspec-core (~> 3.9.0)
22
31
  rspec-expectations (~> 3.9.0)
@@ -33,7 +42,25 @@ GEM
33
42
  diff-lcs (>= 1.2.0, < 2.0)
34
43
  rspec-support (~> 3.9.0)
35
44
  rspec-support (3.9.3)
45
+ rubocop (0.85.0)
46
+ parallel (~> 1.10)
47
+ parser (>= 2.7.0.1)
48
+ rainbow (>= 2.2.2, < 4.0)
49
+ regexp_parser (>= 1.7)
50
+ rexml
51
+ rubocop-ast (>= 0.0.3)
52
+ ruby-progressbar (~> 1.7)
53
+ unicode-display_width (>= 1.4.0, < 2.0)
54
+ rubocop-ast (0.0.3)
55
+ parser (>= 2.7.0.1)
56
+ ruby-progressbar (1.10.1)
36
57
  safe_yaml (1.0.5)
58
+ simplecov (0.17.0)
59
+ docile (~> 1.1)
60
+ json (>= 1.8, < 3)
61
+ simplecov-html (~> 0.10.0)
62
+ simplecov-html (0.10.2)
63
+ unicode-display_width (1.7.0)
37
64
  vcr (5.1.0)
38
65
  webmock (3.8.3)
39
66
  addressable (>= 2.3.6)
@@ -45,10 +72,13 @@ PLATFORMS
45
72
 
46
73
  DEPENDENCIES
47
74
  faraday (~> 0.17.0)
75
+ json
48
76
  psu_identity!
49
77
  rake (~> 12.0)
50
78
  rspec (~> 3.0)
51
79
  rspec-its
80
+ rubocop (~> 0.0)
81
+ simplecov (= 0.17)
52
82
  vcr
53
83
  webmock
54
84
 
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
- # PsuIdentity
1
+ [![CircleCI](https://circleci.com/gh/psu-libraries/psu_identity.svg?style=svg)](https://circleci.com/gh/psu-libraries/psu_identity)
2
+ [![Maintainability](https://api.codeclimate.com/v1/badges/4add85571dd35c111426/maintainability)](https://codeclimate.com/github/psu-libraries/psu_identity/maintainability)
3
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/4add85571dd35c111426/test_coverage)](https://codeclimate.com/github/psu-libraries/psu_identity/test_coverage)
2
4
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/psu_identity`. To experiment with that code, run `bin/console` for an interactive prompt.
5
+ # PsuIdentity
4
6
 
5
- TODO: Delete this and the text above, and describe your gem
7
+ A wrapper for Penn State's search service API.
6
8
 
7
9
  ## Installation
8
10
 
@@ -22,7 +24,25 @@ Or install it yourself as:
22
24
 
23
25
  ## Usage
24
26
 
25
- TODO: Write usage instructions here
27
+ Add this to the top of your code:
28
+
29
+ require 'penn_state/search_service'
30
+
31
+ To query the search service by name:
32
+
33
+ # Takes a hash as parameter with 'text:' as the key
34
+
35
+ PennState::SearchService::Client.new.search(text: 'Jimmy Tester')
36
+
37
+ ***This will return an array of PennState::SearchService::Person objects matching the query***
38
+
39
+ To query the search service by userid:
40
+
41
+ # Takes a string as a parameter
42
+
43
+ PennState::SearchService::Client.new.userid('abc123')
44
+
45
+ ***This will return a single PennState::SearchService::Person object matching the query***
26
46
 
27
47
  ## Development
28
48
 
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  require 'faraday'
3
+ require 'json'
3
4
 
4
5
  # @abstract Client for querying Penn State's identity API: https://identity.apps.psu.edu/search-service/resources
5
6
  module PennState::SearchService
@@ -2,7 +2,7 @@ require_relative 'lib/psu_identity/version'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "psu_identity"
5
- spec.version = "0.1.1"
5
+ spec.version = "0.1.2"
6
6
  spec.authors = ["Alex Kiessling"]
7
7
  spec.email = ["ajkiessl@gmail.com"]
8
8
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: psu_identity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Kiessling