fizzy-cli 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb20ca66466e8b1749b5b02f88107fa31ca0a9cb4cffb51cfeca3e712eb6effa
4
- data.tar.gz: 63b5c87f28cc3b915f77836f2147e8b1f747e6791c4f1918694df9290940ac16
3
+ metadata.gz: fe63e297523bda1dd7bf9a33e63500c79b69908f0beff894e9ac46c1417dcb50
4
+ data.tar.gz: 1a212a6743312655d388622c5af175325b61defcf8dd56076c29b1a2fa5b86e3
5
5
  SHA512:
6
- metadata.gz: 99464b430132e9ea62b098fc031112b8a6cebd8cf2ee350693b67cd189c850ee6f7ad7e8cc2ae6b9898e7377b273cf77db3e64bac1de5e406da70e996a843986
7
- data.tar.gz: ebf5fae49836fa68aac920a8e309dbf8731002d48fcbf8415fbbeabcf3a1e9be8fc586c4b09115a7f0772d064e4ce176fd92321d429d6a1f78c02da7d12b70fb
6
+ metadata.gz: e248468298d49a352c3ffe24542bee9fe5c4501487a970c4c365081ca8505423bcd90f0e8f0dafc42e05f88fbca917633cfab82b1e02b39202f9393f2bdfe1ed
7
+ data.tar.gz: 54322d6c4d43d3c528e83a124514d214d58501d4f7ee31378430af636893463c4dbb64f42ac25aa31f2a6231f7c07d09098f372560e508228dcdfbe8ece9d522
data/CHANGELOG.md CHANGED
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
+ ## [0.5.0] - 2026-02-22
9
+
10
+ ### Added
11
+ - Cache boards in `.fizzy.yml` as `boards: { id: name }` hash for quick lookups without API calls
12
+ - `fizzy boards sync` command to refresh the cached boards list from the API
13
+ - `fizzy init` now automatically fetches and caches all boards during setup
14
+ - `ProjectConfig#boards` accessor for reading cached board data
15
+
8
16
  ## [0.4.1] - 2026-02-22
9
17
 
10
18
  ### Fixed
@@ -56,6 +56,21 @@ module Fizzy
56
56
  client.delete("boards/#{board_id}")
57
57
  puts "Board #{board_id} deleted."
58
58
  end
59
+
60
+ desc "sync", "Refresh boards cache in .fizzy.yml"
61
+ def sync
62
+ raise Thor::Error, "No .fizzy.yml found. Run: fizzy init" unless project_config.found?
63
+
64
+ boards = paginator.all("boards")
65
+ boards_hash = boards.to_h { |b| [b["id"], b["name"]] }
66
+
67
+ config = YAML.safe_load_file(project_config.path)
68
+ config = {} unless config.is_a?(Hash)
69
+ config["boards"] = boards_hash
70
+
71
+ File.write(project_config.path, YAML.dump(config))
72
+ say "Synced #{boards_hash.size} board(s) to #{project_config.path}"
73
+ end
59
74
  end
60
75
  end
61
76
  end
data/lib/fizzy/cli.rb CHANGED
@@ -32,7 +32,10 @@ module Fizzy
32
32
 
33
33
  selected = pick_account
34
34
  config = { "account" => selected["account_slug"] }
35
- config["board"] = pick_board(selected) if yes?("Set a default board?")
35
+
36
+ boards = fetch_boards(selected)
37
+ config["boards"] = boards.to_h { |b| [b["id"], b["name"]] } if boards.any?
38
+ config["board"] = pick_board(boards) if boards.any? && yes?("Set a default board?")
36
39
 
37
40
  File.write(config_path, YAML.dump(config))
38
41
  say "Wrote #{config_path}"
@@ -97,15 +100,14 @@ module Fizzy
97
100
  accounts[idx]
98
101
  end
99
102
 
100
- def pick_board(account)
103
+ def fetch_boards(account)
101
104
  c = Client.new(token: account["access_token"], account_slug: account["account_slug"])
102
105
  boards = c.get("boards").body
106
+ say "No boards found." if boards.empty?
107
+ boards
108
+ end
103
109
 
104
- if boards.empty?
105
- say "No boards found."
106
- return nil
107
- end
108
-
110
+ def pick_board(boards)
109
111
  say "Boards:"
110
112
  boards.each_with_index do |b, i|
111
113
  say " #{i + 1}. #{b["name"]} (#{b["id"]})"
@@ -20,6 +20,8 @@ module Fizzy
20
20
 
21
21
  def board = @data["board"]
22
22
 
23
+ def boards = @data["boards"] || {}
24
+
23
25
  private
24
26
 
25
27
  def find_config(dir)
data/lib/fizzy/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fizzy
4
- VERSION = "0.4.1"
4
+ VERSION = "0.5.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fizzy-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Paluy