a

Ruby code posted
created at 09 Apr 14:20

Edit | Back
1
2
3
4
5
6
7
reqeire 'fog'
service = Fog::Storage.new({: provider => 'OpenStack', : openstack_username => 'admin', : openstack_api_key => 'nomoresecrete', : openstack_auth_url => 'http://192.168.0.`:5000/v2.0/tokens'
})

slide_dir = service.directories.create: key => 'slide4096'
file = slide_dir.files.create: key => 'swiftconsolidator.rb', : body => (File.open "swiftconsolidator.rb")
puts file.public_url
400 Bytes in 2 ms with coderay