From e9bcb0607da8ed2cfd6485f75e574b17718cde68 Mon Sep 17 00:00:00 2001 From: Shireesh Anjal Date: Sat, 25 Apr 2020 16:33:23 +0530 Subject: [PATCH] Document the implemented methods Namely: - list_buckets - make_bucket - bucket_exists? - put_object - get_object - remove_bucket --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/README.md b/README.md index e47ba37..3448f3c 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,44 @@ Or install it yourself as: gem install minio-ruby ``` +## Usage + +### Initialize the client + +``` +require 'minio' + +MinioRuby::Client.configure do |cfg| + cfg.endpoint = "" + cfg.access_key = "" + cfg.secret_key = "" +end +client = MinioRuby::Client.new +``` + +### Interact with the MinIO server + +``` +# List the buckets +client.list_buckets + +# Create new bucket +client.make_bucket "my-bucket-1" + +# Check if bucket exists +client.bucket_exists? "my-bucket-1" + +# Put object +client.put_object("my-bucket-1", "my-file.txt", File.read("my-object.txt")) + +# Get object +client.get_object "my-bucket-1", "my-file.txt" + +# remove bucket +client.remove_bucket "my-bucket-1" + +``` + ## Development To build the minio gem yourself