百度智能云

All Product Document

          Object Storage

          SDK Installation

          Runtime Environment

          The running environment required by Ruby SDK package shall at least be Ruby 2.0.

          Install SDK

          Method 1: Install by Gem

          gem install baidubce-sdk

          Method 2: Install by Bundler

          1.Confirm that bundler is installed at first, with the installation command: gem install bundler 2.Add to Gemfile in your application: gem baidubce-sdk, '~> 0.9.0', and then run bundle install

          Note: After the user installs gem, input irb to enter Ruby interactive command line, enter require baidubce/services/bos/bos_client, SDK has been successfully installed if "true" is displayed. github source code link

          SDK's directory structure

          │──baidubce-sdk.gemspec         //The third-party's gem relied on 
          ├──lib
          │   └── baidubce
          │       ├── auth                //BCE signature related 
          │       ├── http                //BCE's http communication
          │       ├── services
          │       │   └── bos                   //BOS master catalogue 
          │       │       ├── bos_client.rb     //BOS operation class, all operations can be completed via BosClient class
          │       │       ├── bos_constants.rb  //BOS constant
          │       │   └── sts                   //STS master catalogue
          │       │       ├── sts_client.rb     //STS operation class 
          │       ├── exception.rb              //BCE client exception
          │       ├── retry_policy.rb           //BCE retry mechanism at Client
          │       ├── bce_base_client.rb        //BCE common Client
          │       └── utils                //BCE utility 
          └──samples                      //Use case 

          Uninstall SDK

          When uninstalling SDK, execute gem uninstall baidubce-sdk, ad delete require and include statement from the script.

          Previous
          Overview
          Next
          Initialization