Code Monkey home page Code Monkey logo

ansi's People

Contributors

apotheon avatar deepj avatar grosser avatar junegunn avatar sixeight avatar trans avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ansi's Issues

Un-bold, or "normal" code?

I searched through the API but couldn't figure out how to display an ANSI "normal" weight code... for instance, after bolding, going back to normal. Is this implemented?

Doesn't work under windows command line 6.0.6001

Actual colour codes are displayed throughout the command line:
←[33m ERROR←[0m testPasswordChange (1.50s)

I did notice that the RUBY_PLATFORM check to load Win32/Console/ANSI is looking for win32 in the string but my RUBY_PLATFORM = i386-mingw32

A deactivation flag or variable that can be set disabling it for all gems that require colours would be nice.

ANSI::Terminal fails to detect Windows

I am on Windows XP.

When I type:

require "ansi"
ANSI::Terminal.terminal_width

I have the message: No such file or directory - stty size

In https://github.com/rubyworks/ansi/blob/master/lib/ansi/terminal.rb, the code seems to require successively ansi/terminal/stty, ansi/terminal/curses, ansi/terminal/termios and ansi/terminal/win32 until one of these require does not raises.

I guess that stty is supposed to raise on Windows, to avoid using this library. However when I require manually ansi/terminal/stty, it does not raises.

In fact, when I read the code of ansi/terminal/stty I do not see anything that can raise on Windows (or on any platform).

win32console deprecated (windows)

First the issue, even with win32console I can't get colors on windows:

irb(main):001:0> require 'ansi/code'
ansi: 'gem install win32console' to use color on Windows

The reason is that win32console is deprecated (and does not load on recent ruby versions). The good news is that, to the best of the my knowledge, it is no longer needed in ruby 2.0+.

The fix is very simple: don't require 'win32console' when ruby version is 2.0+ (assuming I am not missing anything here).

I verified this by changing code.rb, line 9 to:
if RUBY_PLATFORM =~ /(win32|w32)/ && RUBY_VERSION < "2.0"
This seems to work fine for me.

Inverse Closes colors

puts ANSI.yellow{ "Foo" + ANSI.invert{ "∙∙∙" } + "bar" }

You can see the bar at the end isn't yellow, but you'd expect it to be. I'm using invert to make whitespace visible in a text based game.

The actual output is:

"\e[33mFoo\e[7m∙∙∙\e[0mbar\e[0m"

Expected:

- "\e[33mFoo\e[7m∙∙∙\e[0mbar\e[0m"
+ "\e[33mFoo\e[7m∙∙∙\e[27mbar\e[0m"

05_27_15 at 12 30 22pm

Non-Color ANSI::Diff option

Now that ANSI::Diff is in the picture, the class is going to need an an alternate non-color version for when color needs to be turned off.

I figure rather than colors use underlining with "=" and "-" and maybe "^".

Kudos

Hi guys,

Just wanted to give you a hat tip for a well written Notice file with all of the contained licenses.
Only change required is Highline's homepage moved to https://github.com/JEG2/highline.

All the best

Unable to run test or tasks

Please add some info the the readme on how to do this, standard would be bundle && bundle exec rake but that does not work...

methods broken?

Why are all these methods broken?

> ANSI::Code.hex '000000'
NoMethodError: undefined method `rgb_value` for ANSI::Code:Module
> ANSI::Code.rgb(0,255,0)
NoMethodError: undefined method `rgb_value` for ANSI::Code:Module
> ANSI::Code.rgb_256(0,255,0)
NoMethodError: private method `rgb_256` called for ANSI::Code:Module
> ANSI::Code.send(:rgb_256, 0,255,0)
NoMethodError: undefined method `rgb_valid` for ANSI::Code:Module

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.