sloprb 0.1.0 → 0.1.1

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: 506617067b45365d7b15feb11e2cc0dab95787adb139adbf60e5c544a7a2dd0f
4
- data.tar.gz: 722f67bc7a699d4be54fed15ab204d39d5b68928b2d836d690df958f78a5ca60
3
+ metadata.gz: 58e1a220d3b716251ffc2d18e26eba840c87010b06c87d2551f5a3838dc9bc85
4
+ data.tar.gz: e595902a25e97cc83b841689c814e85d32bb90ba657d57ab0b0c7668cb748b84
5
5
  SHA512:
6
- metadata.gz: 23ec911d3f3fd26a939b58bde4171e4bed6579b2326fca4f186c5afd22e3159782cd975228bb09ba6d3d24175d4a39e5b4eb1c5063ceca646f7bc480cbebae0b
7
- data.tar.gz: 11d5af26a6ea5f78b9bef9c2e199fbc6775966719081fee60b3c1b2ef75b2c02573b95c0060f593461eeb3351f2b26f6753aae4932269c962a20d397b8c41420
6
+ metadata.gz: ade7937bcab79f4073a295a2942c1b996779fdad9d47f6d274f8b34ff1355c3f7a57136d212f510274fec12c1622801236dd336e0a6e817941ad56696b5d5740
7
+ data.tar.gz: 2cc575c4e56be00cbb73ef57f8e8bb7b5f3ce46188eeeeecbff18ea121ba457405535872a4975a86eb5f153adecbbcbf1b428426b1b0766acbfb85dd867cf693
data/CHANGELOG.md CHANGED
@@ -2,7 +2,11 @@
2
2
 
3
3
  ## master
4
4
 
5
- ## 0.1.0 (2026-06-28)
5
+ ## 0.1.1 (2026-05-28)
6
+
7
+ - Get the source path from SyntaxError in Typoeater.
8
+
9
+ ## 0.1.0 (2026-05-28)
6
10
 
7
11
  - Initial release. ([@palkan][])
8
12
 
@@ -43,7 +43,8 @@ module Sloprb
43
43
  return if result.errors.any?
44
44
 
45
45
  corrected
46
- rescue
46
+ rescue => e
47
+ warn "[sloprb] failed to autocorrect #{path}: #{e.message}" if ENV["SLOPRB_DEBUG"]
47
48
  nil
48
49
  end
49
50
 
@@ -51,23 +52,21 @@ module Sloprb
51
52
  require "require-hooks/setup"
52
53
 
53
54
  RequireHooks.around_load do |path, &load_block|
54
- result = begin
55
- load_block.call
56
- rescue ::SyntaxError => original_error
57
- corrected = Typoeater.call(path, original_error)
58
- raise original_error unless corrected
55
+ load_block.call
56
+ rescue ::SyntaxError => original_error
57
+ error_path = original_error.path
58
+ corrected = Typoeater.call(error_path, original_error)
59
+ raise original_error unless corrected
59
60
 
60
- File.write(path, corrected)
61
+ File.write(error_path, corrected)
61
62
 
62
- warn "[sloprb] auto-corrected syntax error in #{path}"
63
+ warn "[sloprb] auto-corrected syntax error in #{error_path}"
63
64
 
64
- begin
65
- load_block.call
66
- rescue ::SyntaxError
67
- raise original_error
68
- end
65
+ begin
66
+ load(error_path)
67
+ rescue ::SyntaxError
68
+ raise original_error
69
69
  end
70
- result
71
70
  end
72
71
  end
73
72
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sloprb # :nodoc:
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sloprb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vova Dem