lean-microsoft-graph 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68d12b40dc1ac7a49f0871b42827af0428474d472e9b06f6e6b18cdfaff67138
4
- data.tar.gz: f6493c4f976717411ad7b1a0fb08ee97a0faf416dcfa99f05b7375675e89e0f2
3
+ metadata.gz: a6b711f8e892323120c00c966cad10124b1d5948fd2b14a884e22c2d78c8cb60
4
+ data.tar.gz: 3d6042393cd5105e4b353416b1d2eb81f6e9e9e36a4d60416a5e2338930b0606
5
5
  SHA512:
6
- metadata.gz: f38076f360a47acc6d05b4b985cf356503316bb90ab8c8e9ff826012005f26fbab25b03e092634987bda14987c2aefd887e7fe0c20d9c9ffce235e93e55e04ef
7
- data.tar.gz: 25fe8eb56dafb3891d6b6409aa8e4605c4593e0272f9d3f60f131f7889e2da3d0f990ac1815643141baa14acff166ce22a4eb468c94b9e5096e80438f92a92f9
6
+ metadata.gz: 52242da5380b066fbc762a1ba637ac05e007264a8a2c249f9efab38db0e3e2577a274e8e43e04d631146caf3c6c1d00f13de111a9884a277818539542c746dcb
7
+ data.tar.gz: 75f7376697cf08b5af7e771b8af49a488a6dfd80ef70e5b92a6698acea26f4518147feea4838e40ad491bc7f39bc54c5cb83a4d15369f1238c081ab0290c24cf
data/CHANGELOG.md CHANGED
@@ -4,8 +4,26 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
6
 
7
+ ## [0.2.1] - 2023-11-09
8
+
9
+ ### Added
10
+
11
+ - Missing tests for resource class.
12
+ - Github action to run tests on push and pull requests.
13
+ - Github action to publish new versions to Rubygems.
14
+
15
+ ### Fixed
16
+
17
+ - Fix error message parser when handling responses.
18
+
19
+ ### Removed
20
+
21
+ - The .tool-versions file from repository. Now it is ignored.
22
+
7
23
  ## [0.2.0] - 2023-11-04
24
+
8
25
  ### Added
26
+
9
27
  - Ability to count users with `client.users.count`.
10
28
  - Ability to retrieve users per page with `client.users.get_all(per_page)`.
11
29
  - Ability to retrieve users by reference with `client.users.get_all_by_reference('reference')`.
@@ -16,4 +34,5 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
16
34
 
17
35
  - Initial release
18
36
 
37
+ [0.2.1]: https://github.com/betogrun/lean_microsoft_graph/releases/tag/v0.2.1
19
38
  [0.2.0]: https://github.com/betogrun/lean_microsoft_graph/releases/tag/v0.2.0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lean-microsoft-graph (0.1.0)
4
+ lean-microsoft-graph (0.2.1)
5
5
  faraday (~> 1.10)
6
6
  faraday_middleware (~> 1.0)
7
7
 
@@ -41,6 +41,7 @@ GEM
41
41
  ruby2_keywords (0.0.5)
42
42
 
43
43
  PLATFORMS
44
+ x86_64-darwin-21
44
45
  x86_64-linux
45
46
 
46
47
  DEPENDENCIES
@@ -50,4 +51,4 @@ DEPENDENCIES
50
51
  rake (~> 13.0)
51
52
 
52
53
  BUNDLED WITH
53
- 2.2.31
54
+ 2.2.33
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
- # Lean::Microsoft::Graph
1
+ # LeanMicrosoftGraph
2
2
 
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/lean/microsoft/graph`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Lean Microsoft Graph is a lightweight gem designed for Ruby developers who need to interact with the Microsoft Graph API but are constrained by the use of Faraday version 1. This gem bridges this gap, providing an interface with Microsoft Graph API.
6
4
 
7
5
  ## Installation
8
6
 
@@ -20,10 +20,7 @@ module LeanMicrosoftGraph
20
20
  parsed_response = JSON.parse(response.body, symbolize_names: true)
21
21
  return parsed_response if (200..299).include?(response.status)
22
22
 
23
- error_message = parsed_response[:error_description]
24
- error_code = parsed_response[:error_codes]
25
-
26
- puts parsed_response
23
+ error_message, error_code = parse_error(parsed_response)
27
24
 
28
25
  case { status: response.status, code: error_code, message: error_message }
29
26
  in { status: 400, code: code, message: message }
@@ -44,5 +41,16 @@ module LeanMicrosoftGraph
44
41
  raise Error, "An unknown error occurred with status: #{response.status}."
45
42
  end
46
43
  end
44
+
45
+ def parse_error(parsed_response)
46
+ if parsed_response[:error].is_a?(Hash)
47
+ error_code = parsed_response[:error][:code]
48
+ error_message = parsed_response[:error][:message]
49
+ else
50
+ error_code = parsed_response[:error_codes]
51
+ error_message = parsed_response[:error_description]
52
+ end
53
+ [error_message, error_code]
54
+ end
47
55
  end
48
56
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LeanMicrosoftGraph
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lean-microsoft-graph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alberto Rocha
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-04 00:00:00.000000000 Z
11
+ date: 2023-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  requirements: []
89
- rubygems_version: 3.4.1
89
+ rubygems_version: 3.2.33
90
90
  signing_key:
91
91
  specification_version: 4
92
92
  summary: "'lean-microsoft-graph' is a gem is a simple interface to Microsoft Graph