blackwinter / ruby-filemagic

Ruby bindings to the magic(4) library, revised.
https://blackwinter.github.iom/ruby-filemagic
146 stars 34 forks source link

Embed README example's output? #22

Closed wconrad closed 7 years ago

wconrad commented 7 years ago

I think the README would be easier to understand if the example embedded the output of the p commands. For example:

p fm.file(__FILE__, true)    # => "text/plain"

I can run the example myself, of course, but the output isn't labeled, so not the easiest to parse:

ruby /tmp/foo.rb
"0.7.1"
"5.22"
[]
[:mime_type, :mime_encoding]
"text/plain; charset=us-ascii"
"text/plain"
[:continue, :raw]
[]
[:mime_type, :mime_encoding]

Would you accept a patch that embeds the example's output inline like I showed at the top of this issue?

blackwinter commented 7 years ago

Sure, go ahead. It's probably best to put them on a new line below the one they're referring to.

blackwinter commented 7 years ago

Thanks!