Coder Social home page Coder Social logo

corazza's Introduction

Corazza

Corazza is a library to create interactive Swift scripts or command line tools. It enables to ask questions on standard output and read answers from standard input.

A simple example Swift script usage can be found in the Example folder.

Examples

Asks which kind of turtles is your favourite:

Do you like turtles?
[Y]es or [N]o? (default: Y) > y

Which one is your favourite?
------------------------------------
1		Chelonoidis nigra
2		Dermochelys coriacea
3		Chelydra serpentina
4		Trachemys scripta elegans
------------------------------------
Choose an option > 2

I love Dermochelys coriacea!

How to use Corazza in your script

Just add import Corazza to your script

In order to be able to import it, you need to have the Corazza in the Swift search path. You can achieve this by compiling it yourself or downloading a binary version from a release. You need to invoke Swift with the -F argument, pointing to the folder where Corazza is stored.

Carthage integration

Corazza can be downloaded locally with Carthage.

Just add

github "marcoconti83/Corazza"

to your Cartfile. After running

carthage update

you would be able to run any swift file with

swift -F Carthage/Build/Mac

The -F flag can also be included in the shebang line of the script, so that you can just invoke the script directly (e.g. $> do.swift). This is the approach used in the examples included with this project.

Without Carthage

You can download the framework binary from the GitHub latest release

corazza's People

Contributors

daehn avatar marcoconti83 avatar noppefoxwolf avatar regexident avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

noppefoxwolf

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.