Giter Club home page Giter Club logo

ripple's People

Contributors

adamhunter avatar aphyr avatar ashley-woodard avatar be9 avatar benmills avatar bkerley avatar cstar avatar danhodge avatar dreverri avatar duff avatar fluxx avatar jcoyne avatar jneen avatar johnae avatar johnthethird avatar misaka avatar myabc avatar myronmarston avatar ntalbott avatar outerim avatar roidrage avatar rustyio avatar saarons avatar seancribbs avatar shayfrendt avatar technorama avatar tmcgilchrist avatar tomlion avatar tylerhunt avatar woahdae avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ripple's Issues

JSON constant improperly namespaced, should be ActiveSupport::JSON

I have a Riak 0.8 server now running at [email protected] but now I get:

users-Mac-Pro:~ root# irb

require 'riak'
=> true
client = Riak::Client.new
=> #<Riak::Client http://127.0.0.1:8098>
client.host = "192.168.1.6"
=> "192.168.1.6"
bucket = client.bucket("riak_client_test")
NameError: uninitialized constant Riak::Bucket::JSON
from /Library/Ruby/Gems/1.8/gems/ripple-0.5.0/lib/riak/bucket.rb:49:in load' from /Library/Ruby/Gems/1.8/gems/ripple-0.5.0/lib/riak/client.rb:120:inbucket'
from (irb):4

Can't configure Ripple's client

I know there's the Ripple.config, but it don't seems to work:

>> Ripple.client.prefix
=> "/raw/"
>> Ripple.config = {:prefix => 'riak'}
=> {:prefix=>"riak"}
>> Ripple.client.prefix
=> "/raw/"
>> Ripple.client.port
=> 8098
>> Ripple.config = {:port => '9000'}
=> {:port=>"9000"}
>> Ripple.client.port
=> 8098
>

I think you have a bad spec. In ripple_spec.rb you have:

it "should reset the client when the configuration changes" do
  c = Ripple.client
  Ripple.config = {:port => 9000}
  Ripple.client.should_not == c
end

In IRB, I tried it:

>> c = Ripple.client
=> #<Riak::Client http://127.0.0.1:8098>
>> Ripple.config = {:port => 9000}
=> {:port=>9000}
>> Ripple.client == c
=> false
>> Ripple.client
=> #<Riak::Client http://127.0.0.1:8098>
>> c
=> #<Riak::Client http://127.0.0.1:8098>
>>

With this spec the test break:

it "should reset the client when the configuration changes" do
    c = Ripple.client
    Ripple.config = {:port => 9000}
    Ripple.client.port.should == 9000
end

Process config/ripple.yml using ERB

To follow the rule of least surprise, I think the configuration file should be processed using ERB a la database.yml. ashley-woodard/ripple@d24f3f3

return HashWithIndifferentAccess

Falls along the line of a feature, and not sure if this is possible or desired, but an option to cast data coming back from the Riak Client as a HashWithIndifferentAccess instead of just a Hash since the ActiveSupport library is already a dependency.

Thoughts? Tomatoes?

typecast nil to Date issue

When you save a nil for a property set as Date, it tries to typecast the nil back to Date and raises an exception. Apparently this is fixed on the associations branch. Can we port it over here somehow?

typecast nil to Date issue

When you save a nil for a property set as Date, it tries to typecast the nil back to Date and raises an exception. Apparently this is fixed on the associations branch. Can we port it over here somehow?

Add get siblings method to Riak::RObject

Allow extracting siblings when an object is in conflict, and picking between those, with the new vclock automatically set so storing the sibling will resolve the conflict.

The default behavior for client.bucket("some-bucket") fetches all keys

Fetching a bucket in any manner:

b = client.bucket["bucket-1"]
or
b = client["bucket-1"]

defaults its behavior to fetching every key present in that bucket. This may be undesirable behavior in cases where a user simply wants to add store a new item and doesn't fit well with the notion of high-write-availability because this is a horribly long operation if there are lots of keys in that bucket.

Eager indices

Let Document create indexes on simple properties in separate buckets, with links back to the original object. Generate finder methods for these eager indices that uses simple link walking.

Providing multiple riak endpoints in case of failure

Sorry if in case I've overlooked something (I've just started to look into this gem and riak itself)...

Is there a way to provide a list of known riak nodes? I know that you can fetch data from any given node, but I've you provide only one host and that host is down, you are screwed, right?

Can't create a new object without a key.

I am trying to let riak create a key for my objects, but I keep getting a NoMethodError.

client = Riak::Client.new
bucket = client.bucket('howtos')
new_obj = Riak::RObject.new(bucket)
NoMethodError: private method `gsub' called for nil:NilClass
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/uri/common.rb:289:in `escape'
    from /Users/matt/Projects/mpdb/vendor/gems/gems/ripple-0.6.1/lib/riak/util/escape.rb:8:in `escape'
    from /Users/matt/Projects/mpdb/vendor/gems/gems/ripple-0.6.1/lib/riak/robject.rb:219:in `inspect'
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb.rb:302:in `output_value'
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb.rb:151:in `eval_input'
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb.rb:263:in `signal_status'
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb.rb:147:in `eval_input'
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb.rb:146:in `eval_input'
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb.rb:70:in `start'
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb.rb:69:in `catch'
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb.rb:69:in `start'
    from /usr/bin/irb:13

Docs:
http://seancribbs.github.com/ripple/Riak/RObject.html#initialize-instance_method

According to the docs, the 'key' param defaults to nil and if it is nil a key will be assigned.

What am I missing?

THanks,
Matt

Could I recommend the use of msgpack for the serialisation of attributes to data?

Could I recommend the use of msgpack for the serialisation of attributes to data? From what I have read of the source it would appear currently the attribute data is converted to json before it is stored however this process is potentially time consuming plus expensive from a transfer point of view. Therefore could it be discussed that a binary serialisation format be used? If so could I recommend the use of msgpack which is significantly quick

Incompatibility with ActiveModel 3.0.0.beta2

With ripple 0.6.1, I am getting an error creating an instance of a class that uses the Ripple::Document. The example taken from the wiki:

require 'ripple'

class Email
  include Ripple::Document
  property :from,    String, :presence => true
  property :to,      String, :presence => true
  property :sent,    Time,   :default => proc { Time.now }
  property :body,    String
end

Then I create an Email and get the following error:

reply = Email.new
NameError: undefined local variable or method `changed_attributes' for #<Email:0x102683be0>
from /Users/nparker/.gem/ruby/1.8/gems/activemodel-3.0.0.beta2/lib/active_model/attribute_methods.rb:358:in `method_missing'
from /Library/Ruby/Gems/1.8/gems/ripple-0.6.1/lib/ripple/document/attribute_methods.rb:87:in `method_missing'
from /Library/Ruby/Gems/1.8/gems/ripple-0.6.1/lib/ripple/document/attribute_methods/dirty.rb:41:in `initialize'
from (irb):9:in `new'
from (irb):9

Have you seen this before?

Booleans can't be used in models

uninitialized constant User::Boolean is raised when I define property :admin, Boolean in class User include Ripple::Document.

My current workaround is to copy/paste Ripple's module Boolean just before the model class declaration.

Error during failsafe response: 
ActionView::Template::Error (Session contains objects whose class definition isn't available.
Remember to require the classes for all objects kept in the session.
(Original exception: uninitialized constant User::Boolean [NameError])
) in /Users/ftreacy/.rvm/gems/ruby-1.9.1-p378/gems/actionpack-3.0.0.beta3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb:



127.0.0.1 - - [02/Jul/2010 11:50:48] "GET /users/[email protected] HTTP/1.0" 500 - 0.2028

Test harness

We should have support for cucumber, RSpec, Test::Unit, Shoulda, etc.

Add dynamic finders

Generate methods and map-reduce jobs for finding documents. Load documents and objects from the map-reduce form.

Empty tag when using RObject#to_link can't be stored in Riak

The following code yields an exception

item = client['items']['item']
catalog = client['catalogs']['test']
link = item.to_link
catalog.links << link
catalog.store

(...)
/Users/ftreacy/.rvm/gems/ruby-1.9.1-p378/gems/riak-client-0.7.0/lib/riak/client/curb_backend.rb:63:in
perform': Expected [200, 204, 300] from Riak but received 400. Invalid Link header. Links must be of the form (Riak::FailedRequest) </riak/BUCKET/KEY>; riaktag="TAG" from /Users/ftreacy/.rvm/gems/ruby-1.9.1-p378/gems/riak-client-0.7.0/lib/riak/client/http_backend.rb:92:in put'
from /Users/ftreacy/.rvm/gems/ruby-1.9.1-p378/gems/riak-client-0.7.0/lib/riak/robject.rb:122:in
`store'

This is because a 'tag' is not set, but tags shouldn't be required.

Break into two gems

This will create two gems - riak-client (the basic HTTP client) and ripple (the document library). riak-client will use ActiveSupport >= 2.3.5, ripple will require Rails 3.

i18n loading on rails/activesupport 2.3.5 fails

For some reason, in lib/riak/i18n.rb, when it attempts to load active_support/i18n, rubygems tries to activate it and fails along the lines of:

You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.map
/home/michael/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems.rb:220:in activate' /home/michael/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35:inrequire'
/home/michael/Scripts/CrystalCommerce/frontend/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in require' /home/michael/Scripts/CrystalCommerce/frontend/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:innew_constants_in'
/home/michael/Scripts/CrystalCommerce/frontend/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in require' /home/michael/.rvm/gems/ruby-1.8.7-p249/gems/riak-client-0.7.1/lib/riak/i18n.rb:15 /home/michael/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require'
/home/michael/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require' /home/michael/Scripts/CrystalCommerce/frontend/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:inrequire'
/home/michael/Scripts/CrystalCommerce/frontend/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in new_constants_in' /home/michael/Scripts/CrystalCommerce/frontend/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:inrequire'
/home/michael/.rvm/gems/ruby-1.8.7-p249/gems/riak-client-0.7.1/lib/riak.rb:22
/home/michael/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' /home/michael/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire'

If I throw on a NoMethodError to the rescue LoadError, I am able to get around it, despite how ugly that is.

Transaction emulation

It would be cool if ripple could emulate transactions. Something like this:
transaction do
Foo.create(:answer => 42)
bar = Bar.find('Spam')
bar.content = 'Mayonnaise'
bar.save
# Here foo and bar have only run their before_* callbacks and validations
# but are not actually stored yet.
end
# If all validations for both Foo and Bar passed, both are stored now,
# otherwise the new Foo is discarded and bar was never updated.

Fix CurbBackend to use Multi

Document::all with a passed block fails because it invalidates the curl handle. Use multi or Typhoeus if possible.

JSON.parse fails in map job operating on data with carriage return control character

class Foo
  include Ripple::Document
  property :foo, String
end

# foo has a carriage return control character
Foo.create(:foo => "bar\rbaz")

# problem parsing data
Riak::MapReduce.new(Ripple.client).
                add("foos").
                map("function(v){ return [JSON.parse(v.values[0].data)]; }", :keep => true).run

# clean up
Foo.all{|f| f.destroy}

# no more carriage return
Foo.create(:foo => "bar baz")

# no problemo
Riak::MapReduce.new(Ripple.client).
                add("foos").
                map("function(v){ return [JSON.parse(v.values[0].data)]; }", :keep => true).run

# clean up 
Foo.all{|f| f.destroy}

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.