awesome-print / awesome_print

Pretty print your Ruby objects with style -- in full color and with proper indentation
http://github.com/michaeldv/awesome_print
MIT License
4.07k stars 454 forks source link

Multiline not working, color working partially #365

Closed goldylucks closed 3 years ago

goldylucks commented 5 years ago

As you can in the image, some of the coloring works, and multiline doesn't work at all

image

Some info on my setup/system

$ ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]

$ rails -v
Rails 5.2.3

$ gem -v                   
3.0.3

$ bundle -v                                  
Bundler version 2.0.1

$ spring -v  
Spring version 2.0.2 

$ cat ~/.irbrc                              
require 'awesome_print'
AwesomePrint.irb!

$ cat ~/.pryrc
require 'awesome_print'
AwesomePrint.pry!
▶ bundle show
▶ bundle show Gems included by the bundle: The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`. * aasm (5.0.5) * actioncable (5.2.3) * actionmailer (5.2.3) * actionpack (5.2.3) * actionview (5.2.3) * active_admin_role (0.2.2) * active_material (1.4.2) * active_model_serializers (0.10.9) * activeadmin (2.1.0) * activeadmin_addons (1.7.1) * activejob (5.2.3) * activemodel (5.2.3) * activerecord (5.2.3) * activestorage (5.2.3) * activesupport (5.2.3) * arbre (1.2.1) * arel (9.0.0) * awesome_print (1.8.0) * aws-eventstream (1.0.3) * aws-partitions (1.174.0) * aws-sdk-core (3.54.2) * aws-sdk-kms (1.21.0) * aws-sdk-s3 (1.42.0) * aws-sigv4 (1.1.0) * babel-source (5.8.35) * babel-transpiler (0.7.0) * bcrypt (3.1.13) * best_in_place (3.1.1) * bootsnap (1.4.4) * builder (3.2.3) * bundler (2.0.1) * byebug (11.0.1) * cancancan (3.0.1) * case_transform (0.2) * coderay (1.1.2) * concurrent-ruby (1.1.5) * crass (1.0.4) * devise (4.6.2) * dotenv (2.7.2) * dotenv-rails (2.7.2) * erubi (1.8.0) * execjs (2.7.0) * ffi (1.11.1) * formtastic (3.1.5) * formtastic_i18n (0.6.0) * geocoder (1.5.1) * globalid (0.4.2) * has_scope (0.7.2) * i18n (1.6.0) * image_processing (1.9.0) * inherited_resources (1.10.0) * jmespath (1.4.0) * jquery-rails (4.3.3) * jsonapi-renderer (0.2.1) * kaminari (1.1.1) * kaminari-actionview (1.1.1) * kaminari-activerecord (1.1.1) * kaminari-core (1.1.1) * listen (3.1.5) * loofah (2.2.3) * mail (2.7.1) * marcel (0.3.3) * method_source (0.9.2) * mimemagic (0.3.3) * mini_magick (4.9.3) * mini_mime (1.0.1) * mini_portile2 (2.4.0) * minitest (5.11.3) * msgpack (1.2.10) * nio4r (2.3.1) * nokogiri (1.10.3) * orm_adapter (0.5.0) * pg (1.1.4) * prettier (0.12.3) * pry (0.12.2) * puma (3.12.1) * rack (2.0.7) * rack-cors (1.0.3) * rack-test (1.1.0) * rails (5.2.3) * rails-dom-testing (2.0.3) * rails-html-sanitizer (1.0.4) * railties (5.2.3) * rake (12.3.2) * ransack (2.1.1) * rb-fsevent (0.10.3) * rb-inotify (0.10.0) * require_all (1.5.0) * responders (2.4.1) * ruby-vips (2.0.14) * ruby_dep (1.5.0) * sass (3.7.4) * sass-listen (4.0.0) * sass-rails (5.0.7) * sassc (2.0.1) * sassc-rails (2.1.1) * select2-rails (4.0.3) * spring (2.0.2) * spring-watcher-listen (2.0.1) * sprockets (3.7.2) * sprockets-es6 (0.9.2) * sprockets-rails (3.2.1) * thor (0.20.3) * thread_safe (0.3.6) * tilt (2.0.9) * tzinfo (1.2.5) * warden (1.2.8) * websocket-driver (0.7.1) * websocket-extensions (0.1.4) * will_paginate (3.1.7) * xdan-datetimepicker-rails (2.5.4)
▶ cat Gemfile source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '2.6.3' gem 'awesome_print', :require => 'ap' gem 'rails', '~> 5.2' gem 'pg', '~> 1.1' gem 'puma', '~> 3.11' gem 'active_model_serializers', '~> 0.10' gem 'will_paginate', '~> 3.1' gem 'geocoder', '~> 1.5' gem 'aws-sdk-s3', '~> 1' gem 'image_processing', '~> 1.9' gem 'activeadmin' gem 'devise' gem 'best_in_place' gem 'aasm' gem 'activeadmin_addons' gem 'sass-rails' gem 'active_admin_role' # Use ActiveStorage variant # gem 'mini_magick', '~> 4.8' # Use Capistrano for deployment # gem 'capistrano-rails', group: :development # Reduces boot times through caching; required in config/boot.rb gem 'bootsnap', '>= 1.1.0', require: false # Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible gem 'rack-cors' group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'pry', '~> 0.12.2' gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] gem 'dotenv-rails' end group :development do gem 'listen', '>= 3.0.5', '< 3.2' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] gem "prettier", "~> 0.12.3"

Anything I could be missing?

Thanks in advance for any help (and a great gem!)

paulodiovani commented 4 years ago

Have you tried this? https://github.com/pry/pry/wiki/FAQ#awesome_print

goldylucks commented 4 years ago

I'm not using pry, I'm using irb by running $ rails console

paulodiovani commented 4 years ago

Well, no idea. It works for me with a very similar configuration. I've also removed pry form my Gemfile and added required: 'ap' to match yours.

Just a note: once you're using AwesomePrint.irb! or AwesomePrint.pry! you don't need to call ab on the console, it will format every output.

goldylucks commented 4 years ago

gotcha, well, if you can't reproduce. might as well close this issue? or label it?

thank you for the help regardless :)

BryanH commented 3 years ago

Do me a favor and make an SSCCE. The example you posted has too much noise to be able to diagnose.

goldylucks commented 3 years ago

closing as I'm no longer working with this