Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Clean up example, add notes file

  • Loading branch information...
commit a8ba23197a7e6cdee96a8bcfe0939ef2b16004bc 1 parent 4746480
Lincoln Stoll authored
Showing with 11 additions and 9 deletions.
  1. +4 −9 1_ripple_basics.rb
  2. +7 −0 TIPS.md
13 1_ripple_basics.rb
View
@@ -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.
@@ -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 TIPS.md
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.