canopus 0.6.1 → 0.6.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: a20fa9cab0519ae8959585f06d1d0b599a770a9a154b9f6dabd258ae82f6c469
4
- data.tar.gz: 8dc607311d74a51fc70a13c8bd6fdec3b626a99377935b9e68e1a3b015462cbb
3
+ metadata.gz: 013571d4fd7a6edfd38e0110f8a2a36107932361bd19153d161632b354d16c27
4
+ data.tar.gz: 4330cff9ebe687ff4841736a7f1a5da170d1201956b132104389fecae9cb5a2d
5
5
  SHA512:
6
- metadata.gz: 84a896182add9dce7fb75a12de42e30a79e219e25295f6629478585ddd7653d8f29ee27361228ca32921277deffb22ad5cba1546ad31959bc85ca0162ab89574
7
- data.tar.gz: 2ca8a81c3359b955f1c9f84f89d9e8312cc1fcd797f3ea52a1fcb40e5e89fb9a8f1de770e6c7c44996730e694a665f682ae5d1519bd1e8f935bb300cc85c30fe
6
+ metadata.gz: d13cf4ece7e1b4ebe6bcaf02e216ccfece40a33bada9abb1e7ff6b829ec9f0448a8931936e0229a7038840a9926f8a2d363346ba9c6d84bcc5aace62d57cf246
7
+ data.tar.gz: c87250d7daf362912550a79cd1a45e82306cbe1086e73561832ac551004ea1e67f10b21a049a7d7755f955acdfdfb24aadf44dee35d35eac05fd3f5a0b803d5a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.2 — 2026-09-23
4
+
5
+ - Use Xamidimura for stable source snapshots and SHA-256 save-conflict checks.
6
+ - Require CRuby 3.2 or newer for Xamidimura compatibility.
7
+
3
8
  ## 0.6.1 — 2026-09-21
4
9
 
5
10
  - Add a deterministic terminal walkthrough cast and editor demo image with regeneration tasks.
data/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  <a href="https://rubygems.org/gems/canopus"><img src="https://img.shields.io/gem/v/canopus.svg" alt="Gem version"></a>
11
11
  <a href="https://rubygems.org/gems/canopus"><img src="https://img.shields.io/gem/dt/canopus.svg" alt="Gem downloads"></a>
12
12
  <a href="https://github.com/noxdea/canopus/actions/workflows/main.yml"><img src="https://github.com/noxdea/canopus/actions/workflows/main.yml/badge.svg" alt="CI"></a>
13
- <img src="https://img.shields.io/badge/CRuby-%3E%3D%203.1-cc342d.svg" alt="CRuby 3.1 or newer">
13
+ <img src="https://img.shields.io/badge/CRuby-%3E%3D%203.2-cc342d.svg" alt="CRuby 3.2 or newer">
14
14
  <a href="LICENSE.txt"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT license"></a>
15
15
  </p>
16
16
 
@@ -53,7 +53,7 @@ gem install canopus
53
53
  canopus --version
54
54
  ```
55
55
 
56
- Canopus requires CRuby 3.1 or newer. The launcher enables YJIT when supported
56
+ Canopus requires CRuby 3.2 or newer. The launcher enables YJIT when supported
57
57
  and otherwise uses the interpreter. Native windows also require the `fiddle`
58
58
  standard-library component; some Ruby distributions package it separately.
59
59
 
@@ -13,7 +13,7 @@ and performance expectations.
13
13
 
14
14
  ## Decision
15
15
 
16
- Require CRuby 3.1 or newer. Attempt to enable YJIT on macOS and Linux, falling
16
+ Require CRuby 3.2 or newer. Attempt to enable YJIT on macOS and Linux, falling
17
17
  back to the interpreter when the selected Ruby build lacks it. On native Windows,
18
18
  preserve an already enabled JIT but do not pass an unsupported YJIT flag.
19
19
 
data/docs/tasks.md CHANGED
@@ -59,6 +59,6 @@ and all output parsing remains frame-budgeted. Matcher lines and unfinished
59
59
  input are limited to 64 KiB, each matcher retains at most 1,000 diagnostics,
60
60
  and regular expressions use a timeout. A matcher that times out is disabled for
61
61
  the rest of that task run while its already-published diagnostics are retained.
62
- On Ruby 3.1, one timeout on a complete line is deferred to the next frame before
63
- disabling, which avoids dropping a matcher after a transient scheduler delay;
64
- an unterminated final line is disabled on its first timeout.
62
+ On unsupported Ruby 3.1, one timeout on a complete line is deferred to the next
63
+ frame before disabling, which avoids dropping a matcher after a transient
64
+ scheduler delay; an unterminated final line is disabled on its first timeout.
data/exe/canopus CHANGED
@@ -3,8 +3,8 @@
3
3
 
4
4
  require "rbconfig"
5
5
  require "rubygems"
6
- unless RUBY_ENGINE == "ruby" && (RUBY_VERSION.split(".").first(2).map(&:to_i) <=> [3, 1]) >= 0
7
- abort "Canopus requires CRuby 3.1 or newer."
6
+ unless RUBY_ENGINE == "ruby" && (RUBY_VERSION.split(".").first(2).map(&:to_i) <=> [3, 2]) >= 0
7
+ abort "Canopus requires CRuby 3.2 or newer."
8
8
  end
9
9
  unless RUBY_PLATFORM.match?(/mswin|mingw/) || RbConfig::CONFIG["YJIT_SUPPORT"] != "yes" ||
10
10
  (defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled?) || ENV["CANOPUS_YJIT_REEXEC"] == "1"
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "digest"
4
3
  require "tempfile"
5
4
  require "denebola"
6
5
  require_relative "denebola_compat"
@@ -26,14 +25,17 @@ module Canopus
26
25
  return new("", path: path, read_only: true, rope: rope, encoding: detection.encoding,
27
26
  bom: detection.bom, detection: detection)
28
27
  end
29
- raw = File.binread(path)
28
+ snapshot = Xamidimura::SourceRevision.read(path)
29
+ raw = snapshot.bytes
30
30
  detection = detect_bytes(raw, encoding: encoding)
31
31
  raise Error, "cannot edit binary file" if detection.binary
32
32
  text = Menkar.decode(raw, detection)
33
33
  new(text, path: path, encoding: detection.encoding, bom: detection.bom, detection: detection,
34
- disk_digest: Digest::SHA256.hexdigest(raw))
34
+ disk_digest: snapshot.digest)
35
35
  rescue Menkar::Error => error
36
36
  raise Error, error.message
37
+ rescue Xamidimura::Error => error
38
+ raise Error, "cannot read #{path}: #{error.message}"
37
39
  rescue EncodingError => error
38
40
  raise Error, "cannot decode #{path}: #{error.message}"
39
41
  end
@@ -279,7 +281,7 @@ module Canopus
279
281
  destination = File.realpath(destination) if File.symlink?(destination)
280
282
  original = File.file?(destination) ? File.binread(destination) : nil
281
283
  same_file = @path && (File.expand_path(path) == @path || (File.exist?(@path) && File.exist?(destination) && File.identical?(@path, destination)))
282
- if !force && same_file && @disk_digest && (!original || Digest::SHA256.hexdigest(original) != @disk_digest)
284
+ if !force && same_file && @disk_digest && (!original || Xamidimura::SourceRevision.digest(original) != @disk_digest)
283
285
  raise SaveConflict, "file changed on disk: #{path}"
284
286
  end
285
287
  raise SaveConflict, "destination exists: #{path}" if !force && original && (!same_file || !@disk_digest)
@@ -301,7 +303,7 @@ module Canopus
301
303
  @detection = detection
302
304
  @encoding, @bom = detection.encoding, detection.bom
303
305
  end
304
- @saved_rope, @disk_digest = snapshot, Digest::SHA256.hexdigest(encoded)
306
+ @saved_rope, @disk_digest = snapshot, Xamidimura::SourceRevision.digest(encoded)
305
307
  self
306
308
  end
307
309
  rescue EncodingError => error
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Canopus
4
- VERSION = "0.6.1"
4
+ VERSION = "0.6.2"
5
5
  end
data/lib/canopus.rb CHANGED
@@ -11,6 +11,7 @@ require "denebola"
11
11
  require "zaniah"
12
12
  require "porrima"
13
13
  require "thuban"
14
+ require "xamidimura"
14
15
  require_relative "canopus/command"
15
16
  require_relative "canopus/panel"
16
17
  require_relative "canopus/decoration"
@@ -13,7 +13,7 @@ smoke = ARGV.first && File.expand_path(ARGV.fetch(0))
13
13
  abort "Usage: ruby tools/check_dependencies.rb [smoke.rb]" if ARGV.length > 1 || (smoke && !File.file?(smoke))
14
14
  specification = Gem::Specification.load(File.join(root, "#{entry}.gemspec"))
15
15
  dependencies = specification.runtime_dependencies.map(&:name).sort
16
- expected = %w[alhena alkaid antares denebola editorconfig gienah kochab megrez menkar porrima prism rexml rouge sadr saiph spica tarazed thuban timeout unicode-display_width zaniah]
16
+ expected = %w[alhena alkaid antares denebola editorconfig gienah kochab megrez menkar porrima prism rexml rouge sadr saiph spica tarazed thuban timeout unicode-display_width xamidimura zaniah]
17
17
  abort "unexpected runtime gem dependencies" unless dependencies == expected
18
18
  abort "native extension declaration" unless specification.extensions.empty?
19
19
  abort "packaged native binary" if specification.files.any? { |path| path.match?(/\.(?:so|bundle|dll|dylib|a|o)\z/i) }
@@ -33,10 +33,10 @@ Dir.mktmpdir("#{entry}-install-") do |directory|
33
33
  environment = ENV.each_key.grep(/\ABUNDLE/).to_h { |key| [key, nil] }.merge(
34
34
  "GEM_HOME" => installation, "GEM_PATH" => ([installation] + Gem.path).join(File::PATH_SEPARATOR),
35
35
  "RUBYLIB" => nil, "RUBYOPT" => nil, "GIENAH_PATH" => nil, "ZANIAH_PATH" => nil, "ALKAID_PATH" => nil, "ANTARES_PATH" => nil,
36
- "MEGREZ_PATH" => nil, "MENKAR_PATH" => nil, "SADR_PATH" => nil, "SAIPH_PATH" => nil, "TARAZED_PATH" => nil
36
+ "MEGREZ_PATH" => nil, "MENKAR_PATH" => nil, "SADR_PATH" => nil, "SAIPH_PATH" => nil, "TARAZED_PATH" => nil, "XAMIDIMURA_PATH" => nil
37
37
  )
38
38
  {"GIENAH_PATH" => "gienah", "ZANIAH_PATH" => "zaniah", "ALKAID_PATH" => "alkaid", "ANTARES_PATH" => "antares", "MEGREZ_PATH" => "megrez", "MENKAR_PATH" => "menkar", "SADR_PATH" => "sadr", "SAIPH_PATH" => "saiph",
39
- "TARAZED_PATH" => "tarazed"}.each do |variable, name|
39
+ "TARAZED_PATH" => "tarazed", "XAMIDIMURA_PATH" => "xamidimura"}.each do |variable, name|
40
40
  next unless ENV[variable]
41
41
 
42
42
  dependency_root = File.realpath(ENV.fetch(variable))
data/tools/package.rb CHANGED
@@ -91,7 +91,7 @@ module CanopusPackage
91
91
  $shortcut = $shell.CreateShortcut((Join-Path $Destination 'Canopus.lnk'))
92
92
  $shortcut.TargetPath = Join-Path $PSScriptRoot 'canopus.cmd'
93
93
  $shortcut.WorkingDirectory = [Environment]::GetFolderPath('UserProfile')
94
- $shortcut.Description = 'Canopus text editor (requires CRuby 3.1+)'
94
+ $shortcut.Description = 'Canopus text editor (requires CRuby 3.2+)'
95
95
  $shortcut.Save()
96
96
  POWERSHELL
97
97
  write_windows_installers(output, version)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canopus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yudai Takada
@@ -301,6 +301,20 @@ dependencies:
301
301
  - - "~>"
302
302
  - !ruby/object:Gem::Version
303
303
  version: '3.2'
304
+ - !ruby/object:Gem::Dependency
305
+ name: xamidimura
306
+ requirement: !ruby/object:Gem::Requirement
307
+ requirements:
308
+ - - "~>"
309
+ - !ruby/object:Gem::Version
310
+ version: 0.1.0
311
+ type: :runtime
312
+ prerelease: false
313
+ version_requirements: !ruby/object:Gem::Requirement
314
+ requirements:
315
+ - - "~>"
316
+ - !ruby/object:Gem::Version
317
+ version: 0.1.0
304
318
  - !ruby/object:Gem::Dependency
305
319
  name: zaniah
306
320
  requirement: !ruby/object:Gem::Requirement
@@ -526,7 +540,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
526
540
  requirements:
527
541
  - - ">="
528
542
  - !ruby/object:Gem::Version
529
- version: '3.1'
543
+ version: '3.2'
530
544
  required_rubygems_version: !ruby/object:Gem::Requirement
531
545
  requirements:
532
546
  - - ">="