bloomy 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -4
- data/bloomy.gemspec +1 -1
- data/lib/bloomy/client.rb +4 -3
- data/lib/bloomy/configuration.rb +1 -1
- data/lib/bloomy/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0d0f6f6172769244a6783a916bebd1543662f84f6e53af17437c2f09484f1cf
|
4
|
+
data.tar.gz: 7ad965fcfbcac1501e16c2431a2e91c88f16f5854ea3b3be9eebdaf2ec222baf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37ef8b9fb6ee8bb2f13e8ba0481a0b4ea40d1c24fe944df8dae8dbbcf37c8734f7d05c2a3267699466e2a8955e4f0424fe73ba80e1e3e25ca3b9848e6aae045d
|
7
|
+
data.tar.gz: bb9965e3a7701ba7d0fd3ec5566f1e516e172cde06d6d7fe65c294e4f6be5da88fde0cedba512f5ec93cc95d8cf9289fbc15cc94e004999ec1c9361d7a7e6de6
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Bloomy
|
2
|
+
[![RSpec Tests](https://github.com/franccesco/bloomy/actions/workflows/main.yml/badge.svg)](https://github.com/franccesco/bloomy/actions/workflows/main.yml) [![Deploy Docs](https://github.com/franccesco/bloomy/actions/workflows/deploy_docs.yml/badge.svg)](https://github.com/franccesco/bloomy/actions/workflows/deploy_docs.yml)
|
2
3
|
|
3
|
-
|
4
|
+
Bloomy is a Ruby library for interacting with the Bloom Growth API. It provides convenient methods for getting user details, todos, rocks, meetings, measurables, and issues.
|
4
5
|
|
5
6
|
## Installation
|
6
7
|
|
@@ -36,20 +37,23 @@ config = Bloomy::Configuration.new
|
|
36
37
|
|
37
38
|
### Configure the API Key
|
38
39
|
|
39
|
-
You can configure the API key using your username and password. Optionally, you can store the API key locally for future use.
|
40
|
+
You can configure the API key using your username and password. Optionally, you can store the API key locally under `~/.bloomy/config.yaml` for future use.
|
40
41
|
|
41
42
|
```ruby
|
42
43
|
config.configure_api_key("your_username", "your_password", store_key: true)
|
43
44
|
```
|
44
45
|
|
45
|
-
|
46
|
+
You can also set an `BG_API_KEY` environment variable and it will be loaded automatically for you once you initialize a client. A configuration is useful if you plan to use a fixed API key for your operations. However, you can also pass an API key when initializing a client without doing any configuration.
|
46
47
|
|
47
48
|
## Client Initialization
|
48
49
|
|
49
50
|
Once the configuration is set up, you can initialize the client. The client provides access to various features such as managing users, todos, rocks, meetings, measurables, and issues.
|
50
51
|
|
52
|
+
> [!NOTE]
|
53
|
+
> Passing an API key is entirely optional and only useful if you plan to use different API keys to manage different organizations. This will bypass the regular configuration process.
|
54
|
+
|
51
55
|
```ruby
|
52
|
-
client = Bloomy::Client.new
|
56
|
+
client = Bloomy::Client.new(api_key: "abc...")
|
53
57
|
```
|
54
58
|
|
55
59
|
## Using Client Features
|
data/bloomy.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.summary = "Manage your Bloom Growth account from the command line."
|
12
12
|
spec.homepage = "https://github.com/franccesco/bloomy"
|
13
13
|
spec.required_ruby_version = ">= 2.6.0"
|
14
|
-
spec.licenses = ["
|
14
|
+
spec.licenses = ["Apache-2.0"]
|
15
15
|
|
16
16
|
# spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
|
17
17
|
|
data/lib/bloomy/client.rb
CHANGED
@@ -21,15 +21,16 @@ module Bloomy
|
|
21
21
|
# client.meetings.list
|
22
22
|
# client.user.details
|
23
23
|
# client.meeting.delete(id)
|
24
|
-
def initialize
|
25
|
-
@configuration = Configuration.new
|
24
|
+
def initialize(api_key = nil)
|
25
|
+
@configuration = Configuration.new unless api_key
|
26
|
+
@api_key = api_key || @configuration.api_key
|
26
27
|
@base_url = "https://app.bloomgrowth.com/api/v1"
|
27
28
|
@conn = Faraday.new(url: @base_url) do |faraday|
|
28
29
|
faraday.response :json
|
29
30
|
faraday.adapter Faraday.default_adapter
|
30
31
|
faraday.headers["Accept"] = "*/*"
|
31
32
|
faraday.headers["Content-Type"] = "application/json"
|
32
|
-
faraday.headers["Authorization"] = "Bearer #{
|
33
|
+
faraday.headers["Authorization"] = "Bearer #{@api_key}"
|
33
34
|
end
|
34
35
|
@user = User.new(@conn)
|
35
36
|
@user_id = @user.default_user_id
|
data/lib/bloomy/configuration.rb
CHANGED
@@ -15,7 +15,7 @@ module Bloomy
|
|
15
15
|
# @example
|
16
16
|
# config = Bloomy::Configuration.new(api_key)
|
17
17
|
def initialize(api_key = nil)
|
18
|
-
@api_key = api_key || ENV["
|
18
|
+
@api_key = api_key || ENV["BG_API_KEY"] || load_api_key
|
19
19
|
end
|
20
20
|
|
21
21
|
# Configures the API key using the provided username and password
|
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.1.
|
4
|
+
version: 0.1.1
|
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-06-
|
11
|
+
date: 2024-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -67,7 +67,7 @@ files:
|
|
67
67
|
- sig/bloomy.rbs
|
68
68
|
homepage: https://github.com/franccesco/bloomy
|
69
69
|
licenses:
|
70
|
-
-
|
70
|
+
- Apache-2.0
|
71
71
|
metadata:
|
72
72
|
homepage_uri: https://github.com/franccesco/bloomy
|
73
73
|
rubygems_mfa_required: 'true'
|