Giter Club home page Giter Club logo

rm-redgreen's Introduction

rm-redgreen

RedGreen clone (colorful rake spec) for RubyMotion. The project includes a ported version of ansiterm & can auto-test using Guard.

The motion-redgreen Gem

Please see https://github.com/farcaller/motion-redgreen for the gem version! Thank you Vladimir for creating the gem!

Github Pages URL

http://mdks.github.com/rm-redgreen/

Features

  • Autotest functionality with Guard
  • A ported ansiterm.rb for terminal colors
  • 3 styles of colorized Bacon output (00-redgreen.rb)
  • nearly-headless iOS Simulator via an AppleScript in the Guardfile

Instructions

  • Copy 00-redgreen.rb into spec/
  • Load rm-ansiterm.rb in your app/
  • Run rake spec

For using Guard I have prepared a Gemfile & Guardfile

  • Add the Gemfile & Guardfile to your project
  • Run bundle install
  • Run guard
  • Red, green, refactor!

Output Styles

There are currently 3 styles, settable at the top of 00-redgreen.rb

Default style is :focused

Extras

# string.rb
class String
  def method_missing(sym, *args, &block)
    Term::ANSIColor.send(sym) { self } rescue super
  end
end
# kernel.rb
class Kernel
  def p(arg, style=nil)
    if Term.nil?
      NSLog arg
    else
      NSLog(style ? arg.send(style) : arg)
    end
  end
end

With code like the above, you can do colorful NSLog output in this way:

p "I like Cyan", :cyan
p "Sometimes this is hard to read...", :blue
p [{:oh=>"this"}, "is", :convenient].inspect, :yellow

Pull requests are appreciated!

rm-redgreen's People

Contributors

kfatehi 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

Watchers

 avatar  avatar  avatar

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.