Created
December 6, 2012 19:21
-
-
Save coderoshi/4227447 to your computer and use it in GitHub Desktop.
Riak Ruby Client Usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
client['roflcopter']['key0'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
roflcopter = client.bucket("roflcopter") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
client = Riak::Client.new(:nodes => [ | |
{ :host => 'TBA' }, | |
{ :host => 'TBA', :pb_port => 1234 }, | |
{ :host => 'TBA', :http_port => 5678 } | |
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shiny_new_object = Riak::RObject.new(roflcopter, "riakRock.js") | |
shiny_new_object.content_type = "application/javascript" | |
shiny_new_object.raw_data = "document.write('For those about to Riak, we salute you');" | |
shiny_new_object.store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shiny_new_object.reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment