Sha256: 5e0e6458b847cb439a4299e97ae9c50fdd203b8f578d8bde536128fabaaa868c

Contents?: true

Size: 930 Bytes

Versions: 18

Compression:

Stored size: 930 Bytes

Contents

require 'rubygems'
require 'pho'

# Create the store object
store = Pho::Store.new("http://api.talis.com/stores/ldodds-dev1", "ldodds", "XXXXXXX")

# Using StringIO object here, but could more usually provide a File object
data = StringIO.new("Some data to store")

puts "Uploading item..."
resp = store.upload_item(data, "text/plain", "/items/test.txt")

puts "Status code after storage is: #{resp.status}"

puts "Retrieving data..."
resp = store.get_item("http://api.talis.com/stores/ldodds-dev1/items/test.txt")

puts "Status code after retrieval is #{resp.status}"
# Should output "Some data to store"
puts "Retrieved data is: #{resp.content}"

puts "Deleting item..."
resp = store.delete_item("/items/test.txt")

puts "Status code after deletion is #{resp.status}"

puts "Retrieving data..."
resp = store.get_item("http://api.talis.com/stores/ldodds-dev1/items/test.txt")

puts "Status code after deletion is: #{resp.status}"

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
pho-0.7.9 examples/contentbox.rb
pho-0.7.8 examples/contentbox.rb
pho-0.7.7 examples/contentbox.rb
pho-0.7.5 examples/contentbox.rb
pho-0.7.4 examples/contentbox.rb
pho-0.7.3 examples/contentbox.rb
pho-0.7.2 examples/contentbox.rb
pho-0.7.1 examples/contentbox.rb
pho-0.7 examples/contentbox.rb
pho-0.6.2 examples/contentbox.rb
pho-0.6.1 examples/contentbox.rb
pho-0.6 examples/contentbox.rb
pho-0.1 examples/contentbox.rb
pho-0.2 examples/contentbox.rb
pho-0.4.1 examples/contentbox.rb
pho-0.4 examples/contentbox.rb
pho-0.3 examples/contentbox.rb
pho-0.5 examples/contentbox.rb