betterp 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 501b9d46dac9e320503237bdf36b11ff4cc8fc132e38544c8983ab88a011ce02
4
- data.tar.gz: 3a7c7f5f22b2c682efd2420fdb209ff7585bcaf45d8e172d2eabaaf435037e9a
3
+ metadata.gz: 8ea0ef4e30131dd17a73ccf0a81c9597b78f5d7538bbaf17e5aae17eae0216d6
4
+ data.tar.gz: 3546052c741f0687e386488a4e6e435344dffb8d725ec6d9270006434b453d44
5
5
  SHA512:
6
- metadata.gz: 1f7ced07d0ba538d63852fd208c10f5b1cc0bcc0f2748db0eb96bfec3d30d7d8b7d90d1820fcab60c13ebfc6f6e501663cfc4385dd7350ac81f287099ca104fe
7
- data.tar.gz: 28de19d8ab67d915a18c659938cd01936a6561ef8b4874e6c10983c081b94a4d448125732b0cb4d8f267d61b8cd846db4fb9fc93f90a0d9cd084da186c637823
6
+ metadata.gz: 2776e06b838c9f24a3a62828cb1a0994ebb1971bc86ca1e551d7833cd5617a97e7da7ba196982767248a7916214336ef759ad16ff9a222b69d74a9ad9c1908da
7
+ data.tar.gz: 71c3479e6eabe34c9bacefb184a58dec62e7c5e68cb2e0ec426ff985ad180a0b404a82c3b1b7cd35507fbc06b398fae2a30fe44e39a963db9a675913028a09cb
data/Gemfile.lock CHANGED
@@ -1,8 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- betterp (0.1.7)
4
+ betterp (0.1.8)
5
5
  paintbrush (~> 0.1.3)
6
+ rouge (~> 4.2)
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
data/betterp.gemspec CHANGED
@@ -27,6 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.require_paths = ['lib']
28
28
 
29
29
  spec.add_runtime_dependency 'paintbrush', '~> 0.1.3'
30
+ spec.add_runtime_dependency 'rouge', '~> 4.2'
30
31
 
31
32
  spec.metadata['rubygems_mfa_required'] = 'true'
32
33
  end
@@ -17,7 +17,7 @@ module Betterp
17
17
  def formatted(args)
18
18
  (@pretty ? args : args.map(&:inspect)).map do |arg|
19
19
  output = [
20
- header, colorized_prefix, colorized_duration, caller_code, colorized_pretty(arg)
20
+ header, colorized_prefix, colorized_duration, caller_code, highlighted(pretty(arg))
21
21
  ].compact.join(' ').chomp
22
22
  "#{output}\n"
23
23
  end
@@ -25,6 +25,12 @@ module Betterp
25
25
 
26
26
  private
27
27
 
28
+ def highlighted(output)
29
+ formatter = Rouge::Formatters::Terminal256.new
30
+ lexer = Rouge::Lexers::Ruby.new
31
+ formatter.format(lexer.lex(output))
32
+ end
33
+
28
34
  def colorized_duration
29
35
  return nil if @duration.nil?
30
36
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Betterp
4
- VERSION = '0.1.7'
4
+ VERSION = '0.1.8'
5
5
  end
data/lib/betterp.rb CHANGED
@@ -7,6 +7,7 @@ require 'stringio'
7
7
  require 'time'
8
8
 
9
9
  require 'paintbrush'
10
+ require 'rouge'
10
11
 
11
12
  require 'kernel'
12
13
  require 'betterp/configuration'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: betterp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Farrell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-25 00:00:00.000000000 Z
11
+ date: 2023-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paintbrush
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.1.3
27
+ - !ruby/object:Gem::Dependency
28
+ name: rouge
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '4.2'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '4.2'
27
41
  description: 'Overwrites Kernel#p to provide output with file path, line numbers,
28
42
  and profiling. '
29
43
  email: