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 +4 -4
- data/CHANGELOG.md +30 -0
- data/Gemfile.lock +3 -2
- data/README.md +2 -4
- data/lib/lean-microsoft-graph.rb +1 -0
- data/lib/lean_microsoft_graph/resource.rb +12 -4
- data/lib/lean_microsoft_graph/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 779e491c44e7cde426387a2d5c45ddc1d28c58c58adc18240881e5a85e85e7c2
|
4
|
+
data.tar.gz: '07864e53aea38ea0c2e2481bcdbbebf7b35f2deb6a0fe28a24e494a69bcae71e'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
54
|
+
2.2.33
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# LeanMicrosoftGraph
|
2
2
|
|
3
|
-
|
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
|
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
|
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.
|
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-
|
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.
|
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
|