lean-microsoft-graph 0.2.0 → 0.2.2

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: 779e491c44e7cde426387a2d5c45ddc1d28c58c58adc18240881e5a85e85e7c2
4
+ data.tar.gz: '07864e53aea38ea0c2e2481bcdbbebf7b35f2deb6a0fe28a24e494a69bcae71e'
5
5
  SHA512:
6
- metadata.gz: f38076f360a47acc6d05b4b985cf356503316bb90ab8c8e9ff826012005f26fbab25b03e092634987bda14987c2aefd887e7fe0c20d9c9ffce235e93e55e04ef
7
- data.tar.gz: 25fe8eb56dafb3891d6b6409aa8e4605c4593e0272f9d3f60f131f7889e2da3d0f990ac1815643141baa14acff166ce22a4eb468c94b9e5096e80438f92a92f9
6
+ metadata.gz: 6272ff9c1f064ea8dff155d75e5cb5b59521960c717ed085871eae67b8b020986d8a2255214be9fbaf4de2270c0f35a5ae9aaf0257a5c3fbf6260a8b3966753d
7
+ data.tar.gz: ed68e95c573e651d31b512edba0f7c5ed5253d9acb04bbe71f5f92440a9bc145f0e1e391ed4e0638506a6b9790f677c03bc8c5d6b84f35a05afa658bb32c797c
data/CHANGELOG.md CHANGED
@@ -4,8 +4,36 @@ 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.2] - 2023-11-11
8
+
9
+ ### Added
10
+
11
+ - Check consistency of gem version with git tag.
12
+
13
+ ### Fixed
14
+
15
+ - Fix issue that prevented gem from being loaded.
16
+
17
+ ## [0.2.1] - 2023-11-09
18
+
19
+ ### Added
20
+
21
+ - Missing tests for resource class.
22
+ - Github action to run tests on push and pull requests.
23
+ - Github action to publish new versions to Rubygems.
24
+
25
+ ### Fixed
26
+
27
+ - Fix error message parser when handling responses.
28
+
29
+ ### Removed
30
+
31
+ - The .tool-versions file from repository. Now it is ignored.
32
+
7
33
  ## [0.2.0] - 2023-11-04
34
+
8
35
  ### Added
36
+
9
37
  - Ability to count users with `client.users.count`.
10
38
  - Ability to retrieve users per page with `client.users.get_all(per_page)`.
11
39
  - Ability to retrieve users by reference with `client.users.get_all_by_reference('reference')`.
@@ -16,4 +44,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
16
44
 
17
45
  - Initial release
18
46
 
47
+ [0.2.2]: https://github.com/betogrun/lean_microsoft_graph/releases/tag/v0.2.2
48
+ [0.2.1]: https://github.com/betogrun/lean_microsoft_graph/releases/tag/v0.2.1
19
49
  [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.2)
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
 
@@ -0,0 +1 @@
1
+ require 'lean_microsoft_graph'
@@ -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.2"
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.2
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-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -53,6 +53,7 @@ files:
53
53
  - Rakefile
54
54
  - bin/console
55
55
  - bin/setup
56
+ - lib/lean-microsoft-graph.rb
56
57
  - lib/lean_microsoft_graph.rb
57
58
  - lib/lean_microsoft_graph/authentication/credentials.rb
58
59
  - lib/lean_microsoft_graph/authentication/token_retriever.rb
@@ -86,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
87
  - !ruby/object:Gem::Version
87
88
  version: '0'
88
89
  requirements: []
89
- rubygems_version: 3.4.1
90
+ rubygems_version: 3.2.33
90
91
  signing_key:
91
92
  specification_version: 4
92
93
  summary: "'lean-microsoft-graph' is a gem is a simple interface to Microsoft Graph