Forum: Ruby asciiart 0.0.6 released

05517bd3a30b42f902ef032ba21de93a?d=identicon&s=25 Stephen Schor (Guest)
on 2013-11-16 21:28
(Received via mailing list)
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("
https://f.cloud.github.com/assets/54012/36827/2081...
")
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:       https://github.com/eastmedia/asciiart
Rubygems: http://rubygems.org/gems/asciiart

Please use, file issues, and fork away.

Thanks,
Andrew, Ross, & Stephen from Eastmedia
91e1fb8bd265b7629491ab64c42f0906?d=identicon&s=25 Reid Thompson (Guest)
on 2013-11-18 16:53
(Received via mailing list)
On Sat, 2013-11-16 at 15:27 -0500, Stephen Schor 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>
05517bd3a30b42f902ef032ba21de93a?d=identicon&s=25 Stephen Schor (Guest)
on 2013-11-18 17:02
(Received via mailing list)
Hey Reid.

I haven't had anyone else report this issue - would you be able to file
a
ticket in github(https://github.com/eastmedia/asciiart/issues) 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
E088bb5c80fd3c4fd02c2020cdacbaf0?d=identicon&s=25 "Jesús Gabriel y Galán" <jgabrielygalan@gmail.com> (Guest)
on 2013-11-18 17:14
(Received via mailing list)
On Mon, Nov 18, 2013 at 5:02 PM, Stephen Schor
<beholdthepanda@gmail.com> wrote:
> Hey Reid.
>
> I haven't had anyone else report this issue - would you be able to file a
> ticket in github(https://github.com/eastmedia/asciiart/issues) 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.
91e1fb8bd265b7629491ab64c42f0906?d=identicon&s=25 Reid Thompson (Guest)
on 2013-11-18 20:26
(Received via mailing list)
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
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.