eager_eye 1.3.2 → 1.3.3
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 +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/eager_eye/source_parser.rb +50 -0
- data/lib/eager_eye/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 709b9faacf1729a719b9d6a2b5a76b6896433ceacaea4f155f0454256211cec4
|
|
4
|
+
data.tar.gz: 320a664b2d85dadbb97c04b073ad7ad6a6136077fad2b9c32479273f438287a7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a24335ee136add109f4484a07b4e45888308275965a0cb2213d348ca42fca6ac2395d0f09e99f3a3bc9e8109048a9cb69af35b2edc453f607562582ff3bbfddf
|
|
7
|
+
data.tar.gz: 4e2294859302a6afc52bf833e5aa5fcad684febf7bb73b7f2e8c6a68b6fdf250b909f9315020cc8ad09ba29dd665ce01f287af3b84ba7425709b22e67be0c8b7
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.3.3] - 2026-07-09
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **Repackage 1.3.2, which shipped without `lib/eager_eye/source_parser.rb`.**
|
|
15
|
+
The 1.3.2 gem was built from a tree where the new `source_parser.rb` had not
|
|
16
|
+
yet been committed, so `git ls-files` (which drives `spec.files`) omitted it
|
|
17
|
+
and every `require "eager_eye"` raised `LoadError: cannot load such file --
|
|
18
|
+
eager_eye/source_parser`. 1.3.3 contains the identical 1.3.2 changes with the
|
|
19
|
+
file included — no source changes beyond the version bump. The gemspec now
|
|
20
|
+
also fails the build if any `lib/**/*.rb` file is missing from the package,
|
|
21
|
+
so this cannot recur.
|
|
22
|
+
|
|
10
23
|
## [1.3.2] - 2026-07-09
|
|
11
24
|
|
|
12
25
|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Require the grammar matching the running Ruby's minor version (parser/ruby33
|
|
4
|
+
# for any 3.3.x) instead of parser/current, which insists on an exact *patch*
|
|
5
|
+
# match and warns on every load otherwise ("parser/current is loading
|
|
6
|
+
# parser/ruby33, which recognizes 3.3.4-compliant syntax, but you are running
|
|
7
|
+
# 3.3.1"). Grammar only changes between minor versions, so the versioned
|
|
8
|
+
# require is exactly as correct — and is the parser gem's documented way to
|
|
9
|
+
# opt out of the warning. Unknown future Rubies fall back to parser/current.
|
|
10
|
+
begin
|
|
11
|
+
require "parser/ruby#{RUBY_VERSION.split(".").first(2).join}"
|
|
12
|
+
rescue LoadError
|
|
13
|
+
require "parser/current"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
module EagerEye
|
|
17
|
+
# Single entry point for turning Ruby source into an AST. Differs from
|
|
18
|
+
# `Parser::CurrentRuby.parse` in two ways that matter for a CLI tool:
|
|
19
|
+
#
|
|
20
|
+
# * No stderr side effects. The default parser prints every lexer/parser
|
|
21
|
+
# diagnostic straight to $stderr — so one unparseable file (e.g. a model
|
|
22
|
+
# holding a binary string literal whose escapes are invalid UTF-8) dumps
|
|
23
|
+
# a raw three-line diagnostic once per analysis pass. Diagnostics stay
|
|
24
|
+
# quiet here; failures surface only as the raised exception.
|
|
25
|
+
# * The buffer is named after the real file, so callers can report
|
|
26
|
+
# "app/models/coupon.rb", not "(string)".
|
|
27
|
+
#
|
|
28
|
+
# Raises like the original — Parser::SyntaxError, EncodingError, or
|
|
29
|
+
# Parser::UnknownEncodingInMagicComment (an ArgumentError, NOT a
|
|
30
|
+
# SyntaxError, raised for e.g. `# encoding: utf8` typos); callers decide
|
|
31
|
+
# whether and how to report.
|
|
32
|
+
module SourceParser
|
|
33
|
+
PARSER_CLASS =
|
|
34
|
+
begin
|
|
35
|
+
Parser.const_get(:"Ruby#{RUBY_VERSION.split(".").first(2).join}", false)
|
|
36
|
+
rescue NameError
|
|
37
|
+
Parser::CurrentRuby
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def self.parse(source, file_path = "(string)")
|
|
41
|
+
parser = PARSER_CLASS.new
|
|
42
|
+
parser.diagnostics.all_errors_are_fatal = true
|
|
43
|
+
parser.diagnostics.ignore_warnings = true
|
|
44
|
+
|
|
45
|
+
buffer = Parser::Source::Buffer.new(file_path, 1)
|
|
46
|
+
buffer.source = source.dup.force_encoding(parser.default_encoding)
|
|
47
|
+
parser.parse(buffer)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
data/lib/eager_eye/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: eager_eye
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
4
|
+
version: 1.3.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- hamzagedikkaya
|
|
@@ -99,6 +99,7 @@ files:
|
|
|
99
99
|
- lib/eager_eye/schema_parser.rb
|
|
100
100
|
- lib/eager_eye/scope_parser.rb
|
|
101
101
|
- lib/eager_eye/serializer_usage_parser.rb
|
|
102
|
+
- lib/eager_eye/source_parser.rb
|
|
102
103
|
- lib/eager_eye/validation_parser.rb
|
|
103
104
|
- lib/eager_eye/version.rb
|
|
104
105
|
- sig/eager_eye.rbs
|