README.md in jot-ruby-0.1.3 vs README.md in jot-ruby-0.1.4

- old
+ new

@@ -1,26 +1,9 @@ # Jot::Ruby Library connecting JOT implementations and ruby runtime -## Installation - -Add this lines to your application's Gemfile: - -```ruby -gem 'mini_racer' # or 'therubyracer' for example -gem 'jot-ruby-js' # available under GPLv3 license, you may use your own implementation instead -``` - -And then execute: - - $ bundle - -Or install it yourself as: - - $ gem install jot-ruby - ## Usage ```ruby require 'jot/ruby' ``` @@ -29,11 +12,11 @@ - NO_OP - Creates operation that does nothing - SET and LIST – General purpose operations - MATH - Math ops - SPLICE, ATINDEX, MAP - Strings and Arrays ops - PUT, REM, APPLY - Object operations -- COPY - May not work as expected at this time according to https://github.com/JoshData/jot/issues/12 +- COPY ```ruby # creating a new operation Jot::Ruby.PUT("0", "1") ``` @@ -56,27 +39,25 @@ - compose - Composes an operation with another one and returns another operation (i.e. LIST operation) - rebase - receives another operation and raise an exception if there is a conflict, or may additionally receive initial version of document as second argument to make a conflictless rebase ```ruby op = jot.LIST([jot.APPLY("title", jot.SPLICE(5, 3, "small")), jot.APPLY("count", jot.MATH('add', -10))]) -op.apply({title: "It's big", count: 20}) # => {"title"=>"It's small", "count"=>10} +op.apply({title: "It's big", count: 20}) # => {"title"=>"It's small", "count"=>10} ``` ### Additional info Use same arguments format as original implementation does For example, LIST operation receives an Array but not a list of arguments ```ruby Jot::Ruby.LIST([ - Jot::Ruby.APPLY("title", Jot::Ruby.SPLICE(0, 5, "It's small")), + Jot::Ruby.APPLY("title", Jot::Ruby.SPLICE(0, 5, "It's small")), Jot::Ruby.APPLY("count", Jot::Ruby.MATH("add", 10)) ]) # Works as expected Jot::Ruby.LIST( - Jot::Ruby.APPLY("title", Jot::Ruby.SPLICE(0, 5, "It's small")), + Jot::Ruby.APPLY("title", Jot::Ruby.SPLICE(0, 5, "It's small")), Jot::Ruby.APPLY("count", Jot::Ruby.MATH("add", 10)) ) # Raises a Jot::Ruby::Errors::ImplError exception ``` - -#### For further docs read https://github.com/JoshData/jot readme ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.