{"id":13463295,"url":"https://github.com/qoobaa/s3","last_synced_at":"2025-03-25T06:31:48.952Z","repository":{"id":600257,"uuid":"236072","full_name":"qoobaa/s3","owner":"qoobaa","description":"Library for accessing S3 objects and buckets, supports EU and US buckets","archived":false,"fork":false,"pushed_at":"2022-10-05T23:22:34.000Z","size":345,"stargazers_count":259,"open_issues_count":22,"forks_count":112,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-16T21:38:29.099Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qoobaa.png","metadata":{"files":{"readme":"README.rdoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-06-25T13:14:24.000Z","updated_at":"2025-03-02T13:50:23.000Z","dependencies_parsed_at":"2022-07-15T01:47:00.158Z","dependency_job_id":null,"html_url":"https://github.com/qoobaa/s3","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qoobaa%2Fs3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qoobaa%2Fs3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qoobaa%2Fs3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qoobaa%2Fs3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qoobaa","download_url":"https://codeload.github.com/qoobaa/s3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245414122,"owners_count":20611357,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T13:00:50.087Z","updated_at":"2025-03-25T06:31:48.680Z","avatar_url":"https://github.com/qoobaa.png","language":"Ruby","readme":"= S3\n\n{\u003cimg src=\"https://travis-ci.org/qoobaa/s3.svg?branch=master\" alt=\"Build Status\" /\u003e}[https://travis-ci.org/qoobaa/s3]\n\nS3 library provides access to {Amazon's Simple Storage Service}[http://aws.amazon.com/s3/].\n\nIt supports *all* S3 regions through the {REST API}[http://docs.amazonwebservices.com/AmazonS3/latest/API/APIRest.html].\n\n== Installation\n\n    gem install s3\n\n== Usage\n\n=== Initialize the service\n\n    require \"s3\"\n    service = S3::Service.new(:access_key_id =\u003e \"...\",\n                              :secret_access_key =\u003e \"...\")\n    #=\u003e #\u003cS3::Service:...\u003e\n\n=== List buckets\n\n    service.buckets\n    #=\u003e [#\u003cS3::Bucket:first-bucket\u003e,\n    #    #\u003cS3::Bucket:second-bucket\u003e]\n\n=== Find bucket\n\n    first_bucket = service.buckets.find(\"first-bucket\")\n    #=\u003e #\u003cS3::Bucket:first-bucket\u003e\n\nor\n\n    first_bucket = service.bucket(\"first-bucket\")\n    #=\u003e #\u003cS3::Bucket:first-bucket\u003e\n\n\u003ctt\u003eservice.bucket(\"first-bucket\")\u003c/tt\u003e does not check whether a bucket with the name \u003ctt\u003e\"first-bucket\"\u003c/tt\u003e exists, but it also does not issue any HTTP requests. Thus, the second example is much faster than \u003ctt\u003ebuckets.find\u003c/tt\u003e. You can use \u003ctt\u003efirst_bucket.exists?\u003c/tt\u003e to check whether the bucket exists after calling \u003ctt\u003eservice.bucket\u003c/tt\u003e.\n\n=== Create bucket\n\n    new_bucket = service.buckets.build(\"newbucketname\")\n    new_bucket.save(:location =\u003e :eu)\n\nRemember that bucket name for EU can't include \"_\" (underscore).\n\nPlease refer to: http://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html for more information about bucket name restrictions.\n\n=== List objects in a bucket\n\n    first_bucket.objects\n    #=\u003e [#\u003cS3::Object:/first-bucket/lenna.png\u003e,\n    #    #\u003cS3::Object:/first-bucket/lenna_mini.png\u003e]\n\n=== Find object in a bucket\n\n    object = first_bucket.objects.find(\"lenna.png\")\n    #=\u003e #\u003cS3::Object:/first-bucket/lenna.png\u003e\n\n=== Access object metadata (cached from find)\n\n    object.content_type\n    #=\u003e \"image/png\"\n\n=== Access object content (downloads the object)\n\n    object.content\n    #=\u003e \"\\x89PNG\\r\\n\\x1A\\n\\x00\\x00\\x00\\rIHDR\\x00...\"\n\n=== Delete an object\n\n    object.destroy\n    #=\u003e true\n\n=== Create an object\n\n    new_object = bucket.objects.build(\"bender.png\")\n    #=\u003e #\u003cS3::Object:/synergy-staging/bender.png\u003e\n\n    new_object.content = open(\"bender.png\")\n\n    new_object.acl = :public_read\n\n    new_object.save\n    #=\u003e true\n\nPlease note that new objects are created with \"private\" ACL by\ndefault.\n\n=== Request access to a private object\n\nReturns a temporary url to the object that expires on the timestamp given. Defaults to one hour expire time.\n\n    new_object.temporary_url(Time.now + 1800)\n\n=== Fetch ACL\n\n   object = bucket.objects.find('lenna.png')\n   object.request_acl # or bucket.request_acl\n\nThis will return hash with all users/groups and theirs permissions\n\n=== Modify ACL\n\n   object = bucket.objects.find(\"lenna.png\")\n   object.copy(:key =\u003e \"lenna.png\", :bucket =\u003e bucket, :acl =\u003e :public_read)\n\n=== Upload file direct to amazon\n\n==== Rails 3\n\nCheck the {example in this gist}[https://gist.github.com/3169039], which describes how to use\na simple form element to upload files directly to S3.\n\n== See also\n\n* rubygems[http://rubygems.org/gems/s3]\n* repository[http://github.com/qoobaa/s3]\n* {issue tracker}[http://github.com/qoobaa/s3/issues]\n* documentation[http://rubydoc.info/github/qoobaa/s3/master/frames]\n\n== Copyright\n\nCopyright (c) 2009 Jakub Kuźma, Mirosław Boruta. See LICENSE[http://github.com/qoobaa/s3/raw/master/LICENSE] for details.\n","funding_links":[],"categories":["Provision, Deploy \u0026 Host"],"sub_categories":["Amazon Web Services"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqoobaa%2Fs3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqoobaa%2Fs3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqoobaa%2Fs3/lists"}