Giter Site home page Giter Site logo

rapture-io's Introduction

Build Status Rapture I/O

Version 0.8.1 (beta) for Scala 2.10.2

Rapture I/O is a general purpose I/O library for Scala, providing much of the functionality of java.io and java.net, plus comprehensive support for working with JSON.

See rapture.io for more information, examples and documentation.

Building Rapture I/O

Rapture I/O has no dependencies (apart from Scala), and you can build it from source with just a few simple commands.

Using Scala 2.10.2 (or later), compile Rapture I/O as follows:

    git clone https://github.com/propensive/rapture-io.git
    cd rapture-io
    scalac -d bin src/*.scala
    jar cf io.jar -C bin rapture

Just include io.jar on your classpath to use Rapture I/O.

Building Rapture I/O using Maven

Thanks to Michel Daviot, you can also use Maven to compile the project using:

    git clone https://github.com/propensive/rapture-io.git
    cd rapture-io
    mvn clean scala:compile package

To use Rapture I/O in your own projects, just include io.jar on your classpath andimport rapture.io._.

For most functionality, you will also need to specify a strategy for handling exceptions. Import one of the following return-type strategies:

  • strategy.throwExceptions
  • strategy.captureExceptions
  • strategy.returnTry
  • strategy.returnFutures

Now, you're ready to go! Try this:

    $ scala -cp io.jar
    Welcome to Scala version 2.10.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_24).
    Type in expressions to have them evaluated.
    Type :help for more information.

    scala> import rapture.io._
    import rapture.io._

    scala> import strategy.throwExceptions
    throwExceptions

    scala> json"""{ "foo": "Hello world!" }"""
    res0: rapture.io.Json = 
    {
     "foo": "Hello world!"
    }

rapture-io's People

Contributors

propensive avatar evantill avatar tyrcho avatar ramn avatar aethersurfer avatar pbzdyl avatar

Watchers

James Cloos 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.