bloomy 0.8.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bloomy/client.rb +4 -0
- data/lib/bloomy/operations/goals.rb +1 -1
- data/lib/bloomy/operations/users.rb +23 -0
- data/lib/bloomy/utils/plugin_loader.rb +28 -0
- data/lib/bloomy/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c37c4101db5cde3d7ccb8d650abeea58416383c131eb35b71a74878aec1c6e69
|
4
|
+
data.tar.gz: '04397e91d4acaf30dddf615d01464c234c87e940b22d00eb2678da63f82fdcba'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2e00f5ce8c4435083d1809b3663d810a5a2b296be289e873c82a44180cc324eb0b297607b9c6314f925adb9ba7e17aaea5dcfbcca20df07b10b06d5f0f8cef3
|
7
|
+
data.tar.gz: 47be893750490311029c294edc904468bc147e902dabc6dbb16634c5c76bfe5b005c0cf9386b57cb4012ff412f578979ef3d3fa28c259b663202b27a4b2958eb
|
data/lib/bloomy/client.rb
CHANGED
@@ -8,6 +8,7 @@ require_relative "operations/meetings"
|
|
8
8
|
require_relative "operations/scorecard"
|
9
9
|
require_relative "operations/issues"
|
10
10
|
require_relative "operations/headlines"
|
11
|
+
require_relative "utils/plugin_loader"
|
11
12
|
|
12
13
|
module Bloomy
|
13
14
|
# The Client class is the main entry point for interacting with the Bloomy API.
|
@@ -43,6 +44,9 @@ module Bloomy
|
|
43
44
|
@scorecard = Scorecard.new(@conn)
|
44
45
|
@issue = Issue.new(@conn)
|
45
46
|
@headline = Headline.new(@conn)
|
47
|
+
|
48
|
+
# Initialize plugins
|
49
|
+
Bloomy::Utilities::Plugin.apply(self)
|
46
50
|
end
|
47
51
|
end
|
48
52
|
end
|
@@ -78,4 +78,27 @@ class User
|
|
78
78
|
}
|
79
79
|
end
|
80
80
|
end
|
81
|
+
|
82
|
+
# Retrieves all users in the system
|
83
|
+
#
|
84
|
+
# @param include_placeholders [Boolean] whether to include users
|
85
|
+
# @return [Array<Hash>] an array of hashes containing user details
|
86
|
+
# @example
|
87
|
+
# user.all
|
88
|
+
# #=> [{id: 1, name: "John Doe", email: "john@example.com", ...}, ...]
|
89
|
+
def all(include_placeholders: false)
|
90
|
+
users = @conn.get("search/all", term: "%").body
|
91
|
+
users
|
92
|
+
.select { |user| user["ResultType"] == "User" }
|
93
|
+
.reject { |user| !include_placeholders && user["ImageUrl"] == "/i/userplaceholder" }
|
94
|
+
.map do |user|
|
95
|
+
{
|
96
|
+
id: user["Id"],
|
97
|
+
name: user["Name"],
|
98
|
+
email: user["Email"],
|
99
|
+
position: user["Description"],
|
100
|
+
image_url: user["ImageUrl"]
|
101
|
+
}
|
102
|
+
end
|
103
|
+
end
|
81
104
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Bloomy
|
2
|
+
module Utilities
|
3
|
+
module Plugin
|
4
|
+
# A collection of registered plugins.
|
5
|
+
@plugins = []
|
6
|
+
|
7
|
+
class << self
|
8
|
+
# Registers a plugin module.
|
9
|
+
#
|
10
|
+
# @param plugin_module [Module] The plugin module to register.
|
11
|
+
# @return [void]
|
12
|
+
def register(plugin_module)
|
13
|
+
@plugins << plugin_module
|
14
|
+
end
|
15
|
+
|
16
|
+
# Applies all registered plugins to the given client.
|
17
|
+
#
|
18
|
+
# @param client [Object] The client to which the plugins will be applied.
|
19
|
+
# @return [void]
|
20
|
+
def apply(client)
|
21
|
+
@plugins.each do |plugin|
|
22
|
+
plugin.apply(client)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/bloomy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bloomy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franccesco Orozco
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- lib/bloomy/operations/todos.rb
|
68
68
|
- lib/bloomy/operations/users.rb
|
69
69
|
- lib/bloomy/utils/get_user_id.rb
|
70
|
+
- lib/bloomy/utils/plugin_loader.rb
|
70
71
|
- lib/bloomy/version.rb
|
71
72
|
- sig/bloomy.rbs
|
72
73
|
homepage: https://github.com/franccesco/bloomy
|