Turn images on your hard drive or on the internet to asciiart…even
colorized asciiart.
New In This Version: Verbose, Copy & Paste-able HTML output .
In Code:
require ‘asciiart’
a = AsciiArt.new(“/Users/sschor/Desktop/uncle_larry.jpg”)
#or
a = AsciiArt.new("
")
puts a.to_ascii_art
=> …untold glory follows
#or
puts a.to_ascii_art(color: true)
=> …now you’re cooking with gas
puts a.to_ascii_art(color: true, format: ‘html’)
=> …Oh no you din.
From The Command Line using the ‘asciiart’ executable:
$ asciiart ~/Desktop/uncle_larry.jpg or even
$ asciiart http://www.google.com/images/srpr/logo3w.png
$ asciiart -h
Usage: asciiart [options] <path_or_url>
-w, --width WIDTH Width of the finished Ascii Art (Default: 100)
-f, --format [text/html] output format (Default: text)
-c, --color Switch to use colored terminal output (Default: false)
-i, --invert-chars Invert the character map. Depending on your terminal
and
image this can make the image clearer (or a lot worse)
-v, --version Show AsciiArt version
-h, --help Show this message
Dependencies:
It relies on rmagick, so…you know…make sure your have imagemagick
installed.
Where:
Github: GitHub - nodanaonlyzuul/asciiart
Rubygems: asciiart | RubyGems.org | your community gem host
Please use, file issues, and fork away.
Thanks,
Andrew, Ross, & Stephen from Eastmedia
sdsykes
November 18, 2013, 4:53pm
2
On Sat, 2013-11-16 at 15:27 -0500, Stephen S. wrote:
require 'asciiart'
irb(main):001:0> require ‘asciiart’
SyntaxError:
/usr/local/lib64/ruby/gems/1.8/gems/asciiart-0.0.6/lib/asciiart.rb:18:
odd number list for Hash
options = { width: 100, color: false, format: "t…
^
/usr/local/lib64/ruby/gems/1.8/gems/asciiart-0.0.6/lib/asciiart.rb:18:
syntax error, unexpected ‘:’, expecting ‘}’
options = { width: 100, color: false, format: "t…
^
/usr/local/lib64/ruby/gems/1.8/gems/asciiart-0.0.6/lib/asciiart.rb:18:
Can’t assign to false
… = { width: 100, color: false, format: “text” }.merge(option…
^
/usr/local/lib64/ruby/gems/1.8/gems/asciiart-0.0.6/lib/asciiart.rb:18:
syntax error, unexpected ‘:’, expecting ‘=’
…th: 100, color: false, format: “text” }.merge(options)
^
/usr/local/lib64/ruby/gems/1.8/gems/asciiart-0.0.6/lib/asciiart.rb:18:
syntax error, unexpected ‘}’, expecting kEND
…color: false, format: “text” }.merge(options)
^
from
/usr/lib64/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:110:in
`gem_original_require’
from
/usr/lib64/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:110:in
`require’
from (irb):1
irb(main):002:0>
sdsykes
November 18, 2013, 5:14pm
3
On Mon, Nov 18, 2013 at 5:02 PM, Stephen S.
[email protected] wrote:
Hey Reid.
I haven’t had anyone else report this issue - would you be able to file a
ticket in github(Issues · nodanaonlyzuul/asciiart · GitHub ) with a
detailed code snippet?
Please include the version of the gem (and make make sure you don’t have
competing versions of the gem installed).
SyntaxError:
/usr/local/lib64/ruby/gems/1.8/gems/asciiart-0.0.6/lib/asciiart.rb:18: odd
number list for Hash
options = { width: 100, color: false, format: "t…
^
It looks like he is using Ruby 1.8 to run it, and that is the “new”
Hash syntax introduced in 1.9.
Jesus.
sdsykes
November 18, 2013, 8:26pm
4
On Mon, 2013-11-18 at 17:13 +0100, Jesús Gabriel y Galán wrote:
SyntaxError:
/usr/local/lib64/ruby/gems/1.8/gems/asciiart-0.0.6/lib/asciiart.rb:18: odd
number list for Hash
options = { width: 100, color: false, format: "t…
^
It looks like he is using Ruby 1.8 to run it, and that is the “new”
Hash syntax introduced in 1.9.
Jesus.
correct 1.8.7 doesn’t understand the new syntax
sdsykes
November 18, 2013, 5:02pm
5
Hey Reid.
I haven’t had anyone else report this issue - would you be able to file
a
ticket in github(Issues · nodanaonlyzuul/asciiart · GitHub ) with a
detailed code snippet?
Please include the version of the gem (and make make sure you don’t have
competing versions of the gem installed).
Thanks for the report,
Stephen