This is an automated email from the ASF dual-hosted git repository.

erickguan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new d178fd65a doc(bindinds/ruby): add examples and links (#6609)
d178fd65a is described below

commit d178fd65a5c13482cefa6ce879d09982e0f345b1
Author: Erick Guan <[email protected]>
AuthorDate: Wed Oct 1 07:54:25 2025 +0200

    doc(bindinds/ruby): add examples and links (#6609)
---
 bindings/ruby/README.md           | 134 ++++++++++++++++++++++++++++++++++++--
 website/docs/20-bindings/ruby.mdx |   2 +-
 2 files changed, 131 insertions(+), 5 deletions(-)

diff --git a/bindings/ruby/README.md b/bindings/ruby/README.md
index ea1606aaf..409679837 100644
--- a/bindings/ruby/README.md
+++ b/bindings/ruby/README.md
@@ -1,14 +1,132 @@
-# Apache OpenDAL™ Ruby Binding (WIP)
+# Apache OpenDAL™ Ruby Binding
 
-[![](https://img.shields.io/badge/status-unreleased-red)](https://opendal.apache.org/bindings/ruby/)
+![Gem Version](https://img.shields.io/gem/v/opendal)
+![Gem Downloads (for latest version)](https://img.shields.io/gem/dtv/opendal)
 
-This crate intends to build a native ruby binding.
+OpenDAL's Ruby gem.
 
 
![](https://github.com/apache/opendal/assets/5351546/87bbf6e5-f19e-449a-b368-3e283016c887)
 
+Read OpenDAL's [ruby](https://opendal.apache.org/docs/ruby/) documentation.
+
+You can find Rust documentation 
[here](https://docs.rs/opendal/latest/opendal/index.html).
+
+## Get started
+
+### Installation
+
+Install gem:
+
+```shell
+bundle add opendal
+```
+
+or add it in Gemfile:
+
+```ruby
+# Gemfile
+
+source "https://rubygems.org";
+
+gem 'opendal'
+```
+
+### Examples
+
+#### File operations with an in-memory storage 
+
+```ruby
+require 'opendal'
+
+op = OpenDal::Operator.new("memory", {})
+op.write("file", "hello world")
+puts op.read("file") # => "hello world"
+puts ""
+
+puts "List:", op.list("").map { |e| e.path }
+puts ""
+
+puts "Stat"
+puts op.stat("file").inspect # => #<OpenDal::Metadata mode: File,         
content_type: ,         content_length: 11>
+puts ""
+
+puts "Deleting 'file'"
+op.delete("/file")
+puts ""
+
+puts "Exist?", op.exist?("/file") # => false
+puts ""
+
+puts "Info:", op.info.inspect # => #<OpenDal::OperatorInfo scheme: "memory", 
root: "/">
+```
+
+#### A S3 operator
+
+```ruby
+require 'opendal'
+
+op = OpenDal::Operator.new("s3", {
+  "endpoint" => "http://localhost:9000";,
+  "access_key_id" => "minioadmin" ,
+  "secret_access_key" => "minioadmin",
+  "bucket" => "test",
+  "region" => "us-east-1",
+})
+op.write("file", "hello world")
+puts op.read("file") # => "hello world"
+puts ""
+
+puts "List:", op.list("").map { |e| e.path }
+puts ""
+
+puts "Stat"
+puts op.stat("file").inspect # => #<OpenDal::Metadata mode: File,         
content_type: binary/octet-stream,         content_length: 11>
+puts ""
+
+puts "Deleting 'file'"
+op.delete("file")
+puts ""
+
+puts "Exist?", op.exist?("file") # => false
+puts ""
+
+puts "Info:", op.info.inspect # => #<OpenDal::OperatorInfo scheme: "s3", root: 
"/">
+```
+
+#### Use middleware
+
+```ruby
+require 'opendal'
+
+op = OpenDal::Operator.new("s3", {
+  "endpoint" => "http://localhost:9000";,
+  "access_key_id" => "minioadmin" ,
+  "secret_access_key" => "minioadmin",
+  "bucket" => "test",
+  "region" => "us-east-1",
+})
+
+op.middleware(OpenDal::Middleware::ConcurrentLimit.new(5))
+op.middleware(OpenDal::Middleware::Retry.new)
+op.middleware(OpenDal::Middleware::Timeout.new(1, 2))
+
+op.list("/").map do |e|
+  puts e.inspect
+end
+```
+
+## Documentation
+
+More detailed documentation is a work in progress.
+
+- OpenDAL's [ruby](https://opendal.apache.org/docs/ruby/) documentation
+- Rust [documentation](https://docs.rs/opendal/latest/opendal/index.html)
+- Rust documentation for 
[services](https://docs.rs/opendal/latest/opendal/services/index.html)
+- Rust documentation for 
[layers](https://docs.rs/opendal/latest/opendal/layers/index.html) (middlewares 
in Ruby)
+
 ## Development
 
-Install gems:
+Install gem and its dependencies:
 
 ```shell
 bundle
@@ -26,6 +144,14 @@ Run tests:
 bundle exec rake test
 ```
 
+Run linters:
+
+```shell
+bundle exec rake standard:fix
+rustfmt --config-path ../../rustfmt.toml src/*.rs # Run rustfmt for Rust files
+cargo clippy --fix --all-targets # Run rust linter clippy
+```
+
 ## License and Trademarks
 
 Licensed under the Apache License, Version 2.0: 
http://www.apache.org/licenses/LICENSE-2.0
diff --git a/website/docs/20-bindings/ruby.mdx 
b/website/docs/20-bindings/ruby.mdx
index d75287ca5..64ccc80c0 100644
--- a/website/docs/20-bindings/ruby.mdx
+++ b/website/docs/20-bindings/ruby.mdx
@@ -1,5 +1,5 @@
 ---
-title: Ruby 🚧
+title: Ruby
 ---
 
 import GitHubReadme from '@site/components/GitHubReadme';

Reply via email to