davetron5000 / optparse-plus

Start your command line scripts off right in Ruby
http://davetron5000.github.com/optparse-plus
Apache License 2.0
521 stars 54 forks source link

Issue in documentation for CLILogger? #73

Closed bachya closed 10 years ago

bachya commented 10 years ago

In your documentation, you mention this as the method for writing to a file:

logger = CLILogger.new('logfile.txt')
logger.debug("Starting up") # => logfile.txt gets this
logger.error("Something went wrong!") # => BOTH logfile.txt AND the standard error get this

However, in Ruby 2.1.0., running this code returns this error message:

error: undefined method `tty?' for "logfile.txt":String

The following changes make it work:

logger CLILogger.new(File.open("logfile.txt", File::WRONLY|File::CREAT))

Not sure if this is intended, already-known, etc. – just wanted to make you aware of it. :)

davetron5000 commented 10 years ago

Interesting. I don't think it's a 2.1 thing. Seems like Logger is OK with a filename, but CLILogger is not handling that properly.

Will look into fixing this.

bachya commented 10 years ago

Solid copy. Let me know if I can provide anything further.

davetron5000 commented 10 years ago

once the build passes on Travis, I'll release a new version. Thanks for finding this!

davetron5000 commented 10 years ago

fixed in 1.3.2

bachya commented 10 years ago

Nice work! Thank you!

---Sent from Boxer | http://getboxer.com

On February 23, 2014 at 9:25:37 AM MST, David Copeland notifications@github.com wrote:once the build passes on Travis, I'll release a new version. Thanks for finding this! —Reply to this email directly or view it on GitHub.