amazing_print 1.7.2 → 1.8.0
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 +4 -0
 - data/README.md +2 -2
 - data/lib/amazing_print/core_ext/awesome_method_array.rb +2 -2
 - data/lib/amazing_print/ext/mongo_mapper.rb +2 -2
 - data/lib/amazing_print/formatter.rb +1 -1
 - data/lib/amazing_print/formatters/base_formatter.rb +2 -2
 - data/lib/amazing_print/formatters/hash_formatter.rb +2 -2
 - data/lib/amazing_print/formatters/object_formatter.rb +1 -1
 - data/lib/amazing_print/formatters/struct_formatter.rb +1 -1
 - data/lib/amazing_print/inspector.rb +2 -2
 - data/lib/amazing_print/version.rb +1 -1
 - metadata +4 -4
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: ab76db037a1c38f0bd372838a92ae03e453f2d81eb73e9c9df5c272b600747dc
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 45a2b9d7de1d5b9f04a57277364646762fd0b84021e91ee71d7a01e966a9e6e7
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: ba4f13b020e16874a0313582279b5e8d5e32455da5d8cdb6ccfac4fd21a150e6061000099558e5ae280c01ddd8c460bf8b2a1ea40301dec4e87fc47046678013
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 1f60c6eb6b2b302aabb011323dae7d78ec37855b727d884c5b83256d075b416de84c87b35e6eb6d21d72e9a5670f53331f639a8310e8bbee285235e24a9c5782
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    
| 
         @@ -56,7 +56,7 @@ module AwesomeMethodArray # :nodoc: 
     | 
|
| 
       56 
56 
     | 
    
         
             
                # the comment :-)
         
     | 
| 
       57 
57 
     | 
    
         
             
                #
         
     | 
| 
       58 
58 
     | 
    
         
             
                arr = if blk
         
     | 
| 
       59 
     | 
    
         
            -
                        super 
     | 
| 
      
 59 
     | 
    
         
            +
                        super do |match|
         
     | 
| 
       60 
60 
     | 
    
         
             
                          #
         
     | 
| 
       61 
61 
     | 
    
         
             
                          # The binding can only be used with Ruby-defined methods, therefore
         
     | 
| 
       62 
62 
     | 
    
         
             
                          # we must rescue potential "ArgumentError: Can't create Binding from
         
     | 
| 
         @@ -75,7 +75,7 @@ module AwesomeMethodArray # :nodoc: 
     | 
|
| 
       75 
75 
     | 
    
         
             
                          yield match
         
     | 
| 
       76 
76 
     | 
    
         
             
                        end
         
     | 
| 
       77 
77 
     | 
    
         
             
                      else
         
     | 
| 
       78 
     | 
    
         
            -
                        super 
     | 
| 
      
 78 
     | 
    
         
            +
                        super
         
     | 
| 
       79 
79 
     | 
    
         
             
                      end
         
     | 
| 
       80 
80 
     | 
    
         
             
                arr.instance_variable_set(:@__awesome_methods__, instance_variable_get(:@__awesome_methods__))
         
     | 
| 
       81 
81 
     | 
    
         
             
                arr.select! { |item| item.is_a?(Symbol) || item.is_a?(String) } # grep block might return crap.
         
     | 
| 
         @@ -19,8 +19,8 @@ module AmazingPrint 
     | 
|
| 
       19 
19 
     | 
    
         
             
                  cast = cast_without_mongo_mapper(object, type)
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
                  if defined?(::MongoMapper::Document)
         
     | 
| 
       22 
     | 
    
         
            -
                    if object.is_a?(Class) && ! 
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
      
 22 
     | 
    
         
            +
                    if object.is_a?(Class) && !object.ancestors.intersect?([::MongoMapper::Document,
         
     | 
| 
      
 23 
     | 
    
         
            +
                                                                            ::MongoMapper::EmbeddedDocument]).nil?
         
     | 
| 
       24 
24 
     | 
    
         
             
                      cast = :mongo_mapper_class
         
     | 
| 
       25 
25 
     | 
    
         
             
                    elsif object.is_a?(::MongoMapper::Document) || object.is_a?(::MongoMapper::EmbeddedDocument)
         
     | 
| 
       26 
26 
     | 
    
         
             
                      cast = :mongo_mapper_instance
         
     | 
| 
         @@ -48,7 +48,7 @@ module AmazingPrint 
     | 
|
| 
       48 
48 
     | 
    
         
             
                  elsif (hash = convert_to_hash(object))
         
     | 
| 
       49 
49 
     | 
    
         
             
                    awesome_hash(hash)
         
     | 
| 
       50 
50 
     | 
    
         
             
                  else
         
     | 
| 
       51 
     | 
    
         
            -
                    awesome_simple(object.inspect.to_s, type, @inspector)
         
     | 
| 
      
 51 
     | 
    
         
            +
                    awesome_simple(object.inspect.to_s, type, @inspector) # rubocop:disable Lint/RedundantTypeConversion
         
     | 
| 
       52 
52 
     | 
    
         
             
                  end
         
     | 
| 
       53 
53 
     | 
    
         
             
                end
         
     | 
| 
       54 
54 
     | 
    
         | 
| 
         @@ -107,10 +107,10 @@ module AmazingPrint 
     | 
|
| 
       107 
107 
     | 
    
         
             
                    "#{align(awesome_key, width)}#{colorize(' => ', :hash)}#{inspector.awesome(value)}"
         
     | 
| 
       108 
108 
     | 
    
         
             
                  end
         
     | 
| 
       109 
109 
     | 
    
         | 
| 
       110 
     | 
    
         
            -
                  def plain_single_line(& 
     | 
| 
      
 110 
     | 
    
         
            +
                  def plain_single_line(&)
         
     | 
| 
       111 
111 
     | 
    
         
             
                    plain = options[:plain]
         
     | 
| 
       112 
112 
     | 
    
         
             
                    options[:plain] = true
         
     | 
| 
       113 
     | 
    
         
            -
                    single_line(& 
     | 
| 
      
 113 
     | 
    
         
            +
                    single_line(&)
         
     | 
| 
       114 
114 
     | 
    
         
             
                  ensure
         
     | 
| 
       115 
115 
     | 
    
         
             
                    options[:plain] = plain
         
     | 
| 
       116 
116 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -68,7 +68,7 @@ module AmazingPrint 
     | 
|
| 
       68 
68 
     | 
    
         
             
                    # We need to ensure that the original Kernel#format is used here instead of the one
         
     | 
| 
       69 
69 
     | 
    
         
             
                    # defined above.
         
     | 
| 
       70 
70 
     | 
    
         
             
                    # rubocop:disable Style/ColonMethodCall
         
     | 
| 
       71 
     | 
    
         
            -
                    str + Kernel::format(':0x%08x',  
     | 
| 
      
 71 
     | 
    
         
            +
                    str + Kernel::format(':0x%08x', object.__id__ * 2)
         
     | 
| 
       72 
72 
     | 
    
         
             
                    # rubocop:enable Style/ColonMethodCall
         
     | 
| 
       73 
73 
     | 
    
         
             
                  end
         
     | 
| 
       74 
74 
     | 
    
         | 
| 
         @@ -61,7 +61,7 @@ module AmazingPrint 
     | 
|
| 
       61 
61 
     | 
    
         
             
                    # We need to ensure that the original Kernel#format is used here instead of the one defined
         
     | 
| 
       62 
62 
     | 
    
         
             
                    # above.
         
     | 
| 
       63 
63 
     | 
    
         
             
                    # rubocop:disable Style/ColonMethodCall
         
     | 
| 
       64 
     | 
    
         
            -
                    Kernel::format("#{struct.class.superclass}:#{struct.class}:0x%08x",  
     | 
| 
      
 64 
     | 
    
         
            +
                    Kernel::format("#{struct.class.superclass}:#{struct.class}:0x%08x", struct.__id__ * 2)
         
     | 
| 
       65 
65 
     | 
    
         
             
                    # rubocop:enable Style/ColonMethodCall
         
     | 
| 
       66 
66 
     | 
    
         
             
                  end
         
     | 
| 
       67 
67 
     | 
    
         | 
| 
         @@ -79,8 +79,8 @@ module AmazingPrint 
     | 
|
| 
       79 
79 
     | 
    
         
             
                  indentator.indentation
         
     | 
| 
       80 
80 
     | 
    
         
             
                end
         
     | 
| 
       81 
81 
     | 
    
         | 
| 
       82 
     | 
    
         
            -
                def increase_indentation(& 
     | 
| 
       83 
     | 
    
         
            -
                  indentator.indent(& 
     | 
| 
      
 82 
     | 
    
         
            +
                def increase_indentation(&)
         
     | 
| 
      
 83 
     | 
    
         
            +
                  indentator.indent(&)
         
     | 
| 
       84 
84 
     | 
    
         
             
                end
         
     | 
| 
       85 
85 
     | 
    
         | 
| 
       86 
86 
     | 
    
         
             
                # Dispatcher that detects data nesting and invokes object-aware formatter.
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: amazing_print
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.8.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Michael Dvorkin
         
     | 
| 
       8 
8 
     | 
    
         
             
            - Kevin McCormackPatrik Wenger
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 1980-01-02 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       13 
13 
     | 
    
         
             
            description: 'Great Ruby debugging companion: pretty print Ruby objects to visualize
         
     | 
| 
       14 
14 
     | 
    
         
             
              their structure. Supports custom object formatting via plugins'
         
     | 
| 
         @@ -69,14 +69,14 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       69 
69 
     | 
    
         
             
              requirements:
         
     | 
| 
       70 
70 
     | 
    
         
             
              - - ">="
         
     | 
| 
       71 
71 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       72 
     | 
    
         
            -
                  version: 3. 
     | 
| 
      
 72 
     | 
    
         
            +
                  version: 3.1.0
         
     | 
| 
       73 
73 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       74 
74 
     | 
    
         
             
              requirements:
         
     | 
| 
       75 
75 
     | 
    
         
             
              - - ">="
         
     | 
| 
       76 
76 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       77 
77 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       78 
78 
     | 
    
         
             
            requirements: []
         
     | 
| 
       79 
     | 
    
         
            -
            rubygems_version: 3.6. 
     | 
| 
      
 79 
     | 
    
         
            +
            rubygems_version: 3.6.7
         
     | 
| 
       80 
80 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       81 
81 
     | 
    
         
             
            summary: Pretty print Ruby objects with proper indentation and colors
         
     | 
| 
       82 
82 
     | 
    
         
             
            test_files: []
         
     |