Skip to content

Commit

Permalink
Clean up example, add notes file
Browse files Browse the repository at this point in the history
  • Loading branch information
lstoll committed Feb 17, 2010
1 parent 4746480 commit a8ba231
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
13 changes: 4 additions & 9 deletions 1_ripple_basics.rb
Expand Up @@ -5,18 +5,13 @@ def gen_id
UUID.create.to_s.gsub('-','')
end

# Until issue http://github.com/seancribbs/ripple/issues#issue/8 is fixed, force
# the Net::HTTP backend
class Riak::Client
def http
@http ||= NetHTTPBackend.new(self)
end
end

# Connect and get a bucket instance
client = Riak::Client.new
bucket = client.bucket("test1")

# Ensure bucket is empty. When bugfixed, pass block direct to bucket
bucket.keys.each {|k| bucket.get(k).delete}

# Create and save a simple JSON object
new_one = Riak::RObject.new(bucket, gen_id)
new_one.content_type = "application/json" # You must set the content type.
Expand All @@ -39,7 +34,7 @@ def http
# Empty Bucket
#bucket.keys {|k| bucket.get(k).delete}

keys = bucket.keys
keys = bucket.keys(:reload => true)

keys.each {|k| p bucket.get(k)}
keys.each {|k| bucket.get(k).delete}
7 changes: 7 additions & 0 deletions TIPS.md
@@ -0,0 +1,7 @@
= Some hints

== Submit a query

curl -X POST -H "content-type: application/json" http://localhost:8098/mapred --data @-

Then enter the query json, return, ^D

0 comments on commit a8ba231

Please sign in to comment.