Giter Club home page Giter Club logo

s3x's Introduction

S3x

Gem Version Test Coverage Status

Found something spicy? Want to check it out? Here is the tool for ya ๐Ÿ˜Ž

Zero dependencies, no AWS SDK bloat, pure Ruby.

Installation

Install the gem and add to Gemfile:

bundle add s3x

Or install it manually:

gem install s3x

Configuration

Initialize a bucket of interest:

bucket = S3x::Bucket.new("http://ftp.ruby-lang.org/")

You can set prefix to pre-filter items and/or override default page_size:

bucket = S3x::Bucket.new(
  "http://ftp.ruby-lang.org/",
  prefix: "pub/ruby/binaries", # default: nil
  page_size: 666               # default: 1000
)

Usage

Get first X (page_size) items:

bucket.items
# => [{
#   key:           "pub/media/irb_multiline.mp4",
#   etag:          "03fa58ca64375c23cb567be6b129ab11",
#   size:          239988,
#   storage_class: "INTELLIGENT_TIERING",
#   last_modified: 2019-04-20 09:10:30 UTC
# }, ...]

Get next page items:

bucket.next_items
# => [{...}, ...]

Check if the next page actually exists:

bucket.next_items?
# => true/false

Get all items in one take:

bucket.all_items
# => [{...}, ...]

Download selected item using its key:

bucket.download("pub/misc/ci_versions/cruby-jruby.json")
# => "[\"3.1\",\"3.2\",\"3.3\",\"head\",\"jruby\",\"jruby-head\"]\n"

Return bucket name:

bucket.name
# => "ftp.r-l.o"

Development

bin/setup         # install deps
bin/console       # interactive prompt to play around
rake spec         # run tests!
rake spec:no_vcr  # run tests with VCR cassettes disabled!
rake rubocop      # lint code!
rake rubocop:md   # lint docs!

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ocvit/s3x.

License

The gem is available as open source under the terms of the MIT License.

s3x's People

Contributors

ocvit avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.