Coder Social home page Coder Social logo

simperium-ruby's Introduction

simperium-ruby

Simperium is a simple way for developers to move data as it changes, instantly and automatically. This is the Ruby library. You can browse the documentation.

You can sign up for a hosted version of Simperium. There are Simperium libraries for other languages too.

This is not yet a full Simperium library for parsing diffs and changes. It's a wrapper for our HTTP API intended for scripting and basic backend development.

Testing

Before running tests you will need to hunt down and install some prerequisites:

First Run

To run the tests, clone the repository and bundle install to install all of the dependencies.

$> git clone https://github.com/simperium/simperium-ruby
$> bundle install

Go to simperium.com and register a new app. Set your shell's environment variables SIMPERIUM_CLIENT_TEST_APPNAME and SIMPERIUM_CLIENT_TEST_APIKEY to your new app's "App ID" and "API Key" respectively.

Thereafter running tests should only require:

$> bundle exec rake test

License

The Simperium Ruby library is available for free and commercial use under the MIT license.

simperium-ruby's People

Contributors

beaucollins avatar chengfred avatar mikejohnstn avatar nioq avatar sporkmonger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

simperium-ruby's Issues

Missing # symbol

User report:

I found a bug in the delete function in simperium.rb for version 0.0.2.4

Line 292 is missing a "#" before {item}

It should read:
url = "#{@appname}/#{@bucket}/i/#{item}"

Release a new gem?

The current gem appears to have a stray puts debug line in simperium.rb. Issue is at line 49 of simperium.rb. This appears to have already been resolved in the repo, but the resolution is not reflected in the current release of the gem.

Ruby api.changes method fails because it passes an extra parameter to _request

Moved this issue from an old repository. Originally submitted by https://github.com/ALev as Simperium/simperium-ios#35


The api.changes method passes five parameters to the _request method.

One of these, "timeout", is an extra parameter that _request doesn't know how to handle.

As a result, _request fails with an error.

The fix would be to stop .changes from passing that parameter to the _request call or update the method definition on _request to allow the parameter, IE:

    def _request(url, data=nil, headers=nil, method=nil)

    would be updated to 

    def _request(url, data=nil, headers=nil, method=nil, timeout=nil)

For consistency, and to achieve the intended functionality (provide a custom timeout for requests done through the .changes method), we would also want to update line 131 to read:

return Simperium._request(url, data=data, headers=headers, method=method, timeout=timeout)

api.bucket_name.new issue

I was following along with the Ruby API reference and I got to the api.bucket_name.new example,

api.todo.new({'title' => 'Create a startup to kill email', 'done' => false})

which gave me

NoMethodError: undefined method `empty?' for nil:NilClass

the new method on line 284 has ccid = nil by default on line 282 , so I get an issue when line 244 tries

unless options.empty?

Unfortunately, I didn't see a Ruby API Reference explaining the ccid, but I did just now notice it in the HTTP API Reference. I was thinking this was an error caused by post calling nil.empty? at line 244 because of the
def new(data, ccid=nil) method on 282,
but then again, any help with getting around this error would be cool

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.