mirror of
https://gitea.invidious.io/iv-org/shard-backtracer.cr.git
synced 2024-08-15 00:53:13 +00:00
Bump ameba dependency and fix found issues
This commit is contained in:
parent
8410b11478
commit
a7eed4b230
5 changed files with 11 additions and 7 deletions
3
.ameba.yml
Normal file
3
.ameba.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Lint/NotNil:
|
||||||
|
Excluded:
|
||||||
|
- spec/backtracer/backtrace/frame/parser_spec.cr
|
|
@ -7,7 +7,7 @@ authors:
|
||||||
development_dependencies:
|
development_dependencies:
|
||||||
ameba:
|
ameba:
|
||||||
github: crystal-ameba/ameba
|
github: crystal-ameba/ameba
|
||||||
version: ~> 1.2.0
|
version: ~> 1.4.0
|
||||||
|
|
||||||
crystal: ">= 0.35.0"
|
crystal: ">= 0.35.0"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
require "../../../spec_helper"
|
require "../../../spec_helper"
|
||||||
|
|
||||||
def with_foo_context
|
def with_foo_context(&)
|
||||||
yield Backtracer::Backtrace::Frame::Context.new(
|
yield Backtracer::Backtrace::Frame::Context.new(
|
||||||
lineno: 10,
|
lineno: 10,
|
||||||
pre: %w[foo bar baz],
|
pre: %w[foo bar baz],
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
require "spec"
|
require "spec"
|
||||||
require "../src/backtracer"
|
require "../src/backtracer"
|
||||||
|
|
||||||
def with_configuration(shared = true)
|
def with_configuration(shared = true, &)
|
||||||
yield shared ? Backtracer.configuration : Backtracer::Configuration.new
|
yield shared ? Backtracer.configuration : Backtracer::Configuration.new
|
||||||
end
|
end
|
||||||
|
|
||||||
def with_backtrace(backtrace, **options)
|
def with_backtrace(backtrace, **options, &)
|
||||||
yield Backtracer::Backtrace::Parser.parse(backtrace, **options)
|
yield Backtracer::Backtrace::Parser.parse(backtrace, **options)
|
||||||
end
|
end
|
||||||
|
|
||||||
def with_frame(method, path = nil, lineno = nil, column = nil, **options)
|
def with_frame(method, path = nil, lineno = nil, column = nil, **options, &)
|
||||||
line = String.build do |io|
|
line = String.build do |io|
|
||||||
if path
|
if path
|
||||||
io << path
|
io << path
|
||||||
|
@ -28,7 +28,8 @@ def with_foo_frame(
|
||||||
path = "#{__DIR__}/foo.cr",
|
path = "#{__DIR__}/foo.cr",
|
||||||
lineno = 1,
|
lineno = 1,
|
||||||
column = 7,
|
column = 7,
|
||||||
**options
|
**options,
|
||||||
|
&
|
||||||
)
|
)
|
||||||
with_frame(method, path, lineno, column, **options) do |frame|
|
with_frame(method, path, lineno, column, **options) do |frame|
|
||||||
yield frame
|
yield frame
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module Backtracer
|
module Backtracer
|
||||||
class_getter(configuration) { Configuration.new }
|
class_getter(configuration) { Configuration.new }
|
||||||
|
|
||||||
def self.configure : Nil
|
def self.configure(&) : Nil
|
||||||
yield configuration
|
yield configuration
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue