Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make inspect console friendly #130

Merged
merged 1 commit into from
Sep 6, 2021
Merged

Conversation

lulalala
Copy link
Contributor

@lulalala lulalala commented Aug 31, 2021

When learning the library, often ruby IRB console would print never-ending object inspect message, because object attribute contains books' content/ binary data. This made learning/debugging difficult.

I modified the own inspect method:

  • Omit long strings
  • Print only class name for non standard types

For example now it can print

#<GEPUB::Item 
  @attributes={"id"=>"core.css", "href"=>"css/core.css", "media-type"=>"text/css"} 
  @parent=#<GEPUB::Manifest> 
  @content=(omitted)>

Do you think this is okay? Thanks.

Copy link
Owner

@skoji skoji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rake 'lib/gepub/metadata_add.rb' fails on the CI. Please add the following line as the first line of tools/generate_function.rb

require_relative '../lib/gepub/inspect_mixin.rb'

@lulalala
Copy link
Contributor Author

lulalala commented Sep 2, 2021

Thanks! Let me see if tests passes.

- Omit long strings
- Print only class name for non standard types
@skoji skoji merged commit 5b413e7 into skoji:main Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants