openclacky 0.9.1 → 0.9.2

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: 8a13cced61727911f2587013fa7f701863f8644ed62caaf235217be4dc306574
4
- data.tar.gz: 9f9f1d42f482bf159099d2a49c8435f8bff176dc0126321cd980079297ff7078
3
+ metadata.gz: 634937d9d7a20aa0a76b046ba079ef2d82c398ac81d59014968f7dbeb325726c
4
+ data.tar.gz: 7cd5c7eab980c54b5da38b6744dbc21dd3ac48af00c541a609d5537d6867ee70
5
5
  SHA512:
6
- metadata.gz: 7b3841fdddb699185b6a0854a4413b2a604b5187235bc3a5cd408525a8bfd21746e8dab0a5e1b085fbbd928acad3f3bda845cd208d077b0420c6419815036168
7
- data.tar.gz: 70feae263b9d3a43d3b199ffd26e40f3a79d61d8e56e27a77b9ab615a62cb9a483dcbbdde770cbe4117aee66db1aa93fcbfae6350aab7e744f8b7a8c80a9ab8d
6
+ metadata.gz: b874781caf58c502536666c33b8aff0c459076689909dd36bd82151f7092953d453d51b2e90259bbfdb6b2eb0ba389e5e56c083a1364118ca0a15edbef471e02
7
+ data.tar.gz: 1639031ccf11848ab3b8c2a18d3eb7d87c487dc1e13b856e4c0cdc8cb35e3ebf4c8001660ea607f013e64a40fa1ef09255915652af9d0bc44ad8ddf9c0b1dff2
data/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.9.2] - 2026-03-15
11
+
12
+ ### Fixed
13
+ - **Version upgrade button now appears reliably**: the new version check now queries RubyGems directly instead of relying on local gem mirror sources (which often lag behind by hours or days), so the upgrade badge shows up promptly when a new version is available. Falls back to the local mirror if RubyGems is unreachable.
14
+ - **Edit confirmation diff output restored**: the file diff was not displaying correctly when the input area paused during an edit confirmation prompt; this is now fixed.
15
+
10
16
  ## [0.9.1] - 2026-03-15
11
17
 
12
18
  ### Added
@@ -687,10 +687,38 @@ module Clacky
687
687
  latest
688
688
  end
689
689
 
690
- # Query the latest openclacky version via `gem list -r openclacky`.
691
- # Runs through login shell so gem source mirrors configured via rbenv/mise work correctly.
692
- # Output format: "openclacky (0.9.0)"
690
+ # Query the latest openclacky version.
691
+ # Strategy: try RubyGems official REST API first (most accurate, not affected by mirror lag),
692
+ # then fall back to `gem list -r` (respects user's configured gem source).
693
693
  private def fetch_latest_version_from_gem
694
+ fetch_latest_version_from_rubygems_api || fetch_latest_version_from_gem_command
695
+ end
696
+
697
+ # Try RubyGems official REST API — fast and always up-to-date.
698
+ # Returns nil if the request fails or times out.
699
+ private def fetch_latest_version_from_rubygems_api
700
+ require "net/http"
701
+ require "json"
702
+
703
+ uri = URI("https://rubygems.org/api/v1/gems/openclacky.json")
704
+ http = Net::HTTP.new(uri.host, uri.port)
705
+ http.use_ssl = true
706
+ http.open_timeout = 5
707
+ http.read_timeout = 8
708
+
709
+ res = http.get(uri.request_uri)
710
+ return nil unless res.is_a?(Net::HTTPSuccess)
711
+
712
+ data = JSON.parse(res.body)
713
+ data["version"].to_s.strip.then { |v| v.empty? ? nil : v }
714
+ rescue StandardError
715
+ nil
716
+ end
717
+
718
+ # Fall back to `gem list -r openclacky` via login shell.
719
+ # Respects the user's configured gem source (rbenv/mise mirrors, etc.).
720
+ # Output format: "openclacky (0.9.0)"
721
+ private def fetch_latest_version_from_gem_command
694
722
  shell = Clacky::Tools::Shell.new
695
723
  result = shell.execute(command: "gem list -r openclacky", soft_timeout: 15, hard_timeout: 30)
696
724
  return nil unless result[:exit_code] == 0
@@ -59,8 +59,15 @@ module Clacky
59
59
  screen.clear_line
60
60
  end
61
61
 
62
- # Re-render fixed areas at new position
63
- render_fixed_areas
62
+ # When input is paused (InlineInput active), fixed_area_start_row has grown
63
+ # (input_area.required_height returns 0 while paused), so the cleared rows
64
+ # now belong to the output area. Re-render output from buffer to fill them in.
65
+ if input_area.paused?
66
+ render_output_from_buffer
67
+ else
68
+ # Re-render fixed areas at new position
69
+ render_fixed_areas
70
+ end
64
71
  screen.flush
65
72
  end
66
73
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Clacky
4
- VERSION = "0.9.1"
4
+ VERSION = "0.9.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openclacky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - windy