betterp 0.1.7 → 0.1.8
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/Gemfile.lock +2 -1
- data/betterp.gemspec +1 -0
- data/lib/betterp/output.rb +7 -1
- data/lib/betterp/version.rb +1 -1
- data/lib/betterp.rb +1 -0
- metadata +16 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 8ea0ef4e30131dd17a73ccf0a81c9597b78f5d7538bbaf17e5aae17eae0216d6
         | 
| 4 | 
            +
              data.tar.gz: 3546052c741f0687e386488a4e6e435344dffb8d725ec6d9270006434b453d44
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 2776e06b838c9f24a3a62828cb1a0994ebb1971bc86ca1e551d7833cd5617a97e7da7ba196982767248a7916214336ef759ad16ff9a222b69d74a9ad9c1908da
         | 
| 7 | 
            +
              data.tar.gz: 71c3479e6eabe34c9bacefb184a58dec62e7c5e68cb2e0ec426ff985ad180a0b404a82c3b1b7cd35507fbc06b398fae2a30fe44e39a963db9a675913028a09cb
         | 
    
        data/Gemfile.lock
    CHANGED
    
    
    
        data/betterp.gemspec
    CHANGED
    
    
    
        data/lib/betterp/output.rb
    CHANGED
    
    | @@ -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,  | 
| 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 |  | 
    
        data/lib/betterp/version.rb
    CHANGED
    
    
    
        data/lib/betterp.rb
    CHANGED
    
    
    
        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. | 
| 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- | 
| 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:
         |