Giter Club home page Giter Club logo

cry's Introduction

CRY

Evaluate crystal code from files and command lines similar to edit in ruby pry.

Installation

Source


curl -L https://github.com/elorest/cry/archive/master.tar.gz | tar xz
cd cry-master/
make install

OSX Homebrew


brew install elorest/crystal/cry

Usage

  1. inline mode: inline code specified in the command line as a string argument
    • cry Time.now
  2. editor mode: a terminal-based code editor is opened and the resulting code is executed once you save and exit
    • cry... edit code in Vim... code runs.
  3. file mode: code within an existing .cr file is copied to a tmp file for editing and run once editor is closed.
    • cry scripts/stuff.cr
  4. back: open and previous run in editor mode.
    • cry -b 1 ... copies previous run to tmp file for editing and runs when editor is closed.
  5. loop: continuously edit and execute code.
    • cry -r -b 1 ... copies previous run to tmp file for editing and runs when editor is closed in a loop.
  6. log: show a log of all previous runs.
    • cry --log

Here is a list of the commands available:

command [OPTIONS] [CODE]

Arguments:
  CODE  Crystal code or .cr file to execute within the application scope
        (default: )

Options:
  -b, --back    Runs prevous command files: 'amber exec -b [times_ago]'
                (default: 0)
  -e, --editor  Prefered editor: [vim, nano, pico, etc], only used when no code or .cr file is specified
                (default: vim)
  -l, --log     Prints results of previous run
  -r, --repeat    Runs editor in a loop (can be combined with -b 1)

Contributing

  1. Fork it ( https://github.com/elorest/cry/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

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.