lib/scryglass/config.rb in scryglass-1.1.0 vs lib/scryglass/config.rb in scryglass-2.0.0

- old
+ new

@@ -24,18 +24,27 @@ ## UX self.cursor_tracking = [:flexible_range, :dead_center][0] # One or the other self.lenses = [ # Custom lenses can easily be added as name+lambda hashes! Or comment some out to turn them off. { name: 'Pretty Print (`pp`)', lambda: ->(o) { Hexes.capture_io(char_limit: 20_000) { pp o } } }, + { name: 'Amazing Print (`ap`)', + lambda: ->(o) { Hexes.capture_io(char_limit: 20_000) { ap o } } }, # This has colors! { name: 'Inspect (`.inspect`)', lambda: ->(o) { Hexes.capture_io(char_limit: 20_000) { puts o.inspect } } }, { name: 'Yaml Print (`y`)', lambda: ->(o) { Hexes.capture_io(char_limit: 20_000) { require 'yaml' ; y o } } }, # OR: `puts o.to_yaml` { name: 'Puts (`puts`)', lambda: ->(o) { Hexes.capture_io(char_limit: 20_000) { puts o } } }, - # { name: 'Method Showcase', - # lambda: ->(o) { Scryglass::LensHelper.method_showcase_for(o) } }, + { name: 'Method Showcase', + lambda: ->(o) { Scryglass::LensHelper.method_showcase_for(o) } }, ] + + ## AmazingPrint defaults, if the user has not set their own: + ::AmazingPrint.defaults ||= { + index: false, # (Don't display array indices). + raw: true, # (Recursively format instance variables). + } + # See https://github.com/amazing-print/amazing_print ## Building ActiveRecord association sub-rows: self.include_empty_associations = true self.include_through_associations = false self.include_scoped_associations = false