uri_s3 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7fa10becf6d24c40b7d11b3595518fee37d316f8
4
+ data.tar.gz: 0b73b3f3c78d00779b21f1e3c6c0abe104e24849
5
+ SHA512:
6
+ metadata.gz: a06bd7d61066a73a1af0e067d6cd0a015ad0d73a2b9fa66040f479aabe4d97eb8225a69313deb932e5d3c0fd0784e68c886c5a61f5736c44956b207c54f98499
7
+ data.tar.gz: 18a1e6a8d27a5cfa1ba309a8362d6d8dbd703b6985536c608b4d94662284a2d45544d25eafc565f2d4d111b6aad0a5a47cf0ed52b547fa667ed06cf2e34b9abf
data/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,37 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ s3_uri (0.1.0)
5
+ aws-sdk-s3 (~> 1)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ aws-eventstream (1.0.1)
11
+ aws-partitions (1.141.0)
12
+ aws-sdk-core (3.46.2)
13
+ aws-eventstream (~> 1.0)
14
+ aws-partitions (~> 1.0)
15
+ aws-sigv4 (~> 1.0)
16
+ jmespath (~> 1.0)
17
+ aws-sdk-kms (1.13.0)
18
+ aws-sdk-core (~> 3, >= 3.39.0)
19
+ aws-sigv4 (~> 1.0)
20
+ aws-sdk-s3 (1.30.1)
21
+ aws-sdk-core (~> 3, >= 3.39.0)
22
+ aws-sdk-kms (~> 1)
23
+ aws-sigv4 (~> 1.0)
24
+ aws-sigv4 (1.0.3)
25
+ jmespath (1.4.0)
26
+ rake (10.5.0)
27
+
28
+ PLATFORMS
29
+ ruby
30
+
31
+ DEPENDENCIES
32
+ bundler (~> 2.0)
33
+ rake (~> 10.0)
34
+ s3_uri!
35
+
36
+ BUNDLED WITH
37
+ 2.0.1
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # S3Uri
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/uri_s3`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'uri_s3'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install uri_s3
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/uri_s3.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "s3_uri"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/lib/uri/s3.rb ADDED
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'uri'
4
+
5
+ module URI
6
+ class S3 < Generic
7
+ def s3_bucket(options = {})
8
+ @s3_bucket ||= s3_resource(options).bucket(host)
9
+ end
10
+
11
+ def s3_object(options = {})
12
+ @s3_object ||= s3_bucket(options).object(URI.decode_www_form_component(path[1..-1]))
13
+ end
14
+
15
+ private
16
+
17
+ def s3_resource(options = {})
18
+ @s3_resource ||= Aws::S3::Resource.new(options)
19
+ end
20
+ end
21
+
22
+ @@schemes['S3'] = S3
23
+ end
@@ -0,0 +1,3 @@
1
+ module S3Uri
2
+ VERSION = "0.1.0"
3
+ end
data/lib/uri_s3.rb ADDED
@@ -0,0 +1,6 @@
1
+ require "uri_s3/version"
2
+ require "uri/s3"
3
+
4
+ module UriS3
5
+ class Error < StandardError; end
6
+ end
data/uri_s3.gemspec ADDED
@@ -0,0 +1,28 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "uri_s3/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "uri_s3"
8
+ spec.version = S3Uri::VERSION
9
+ spec.authors = ["Scott Brickner"]
10
+ spec.email = ["scottb@mercuryanalytics.com"]
11
+
12
+ spec.summary = "URI class for parsing s3 URIs."
13
+ spec.homepage = "https://github.com/mercuryanalytics/uri_s3"
14
+
15
+ # Specify which files should be added to the gem when it is released.
16
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
17
+ spec.files = Dir.chdir(__dir__) do
18
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
+ end
20
+ spec.bindir = "exe"
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.require_paths = ["lib"]
23
+
24
+ spec.add_dependency "aws-sdk-s3", "~> 1"
25
+
26
+ spec.add_development_dependency "bundler", "~> 2.0"
27
+ spec.add_development_dependency "rake", "~> 10.0"
28
+ end
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: uri_s3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Scott Brickner
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-03-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aws-sdk-s3
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description:
56
+ email:
57
+ - scottb@mercuryanalytics.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - Gemfile
64
+ - Gemfile.lock
65
+ - README.md
66
+ - Rakefile
67
+ - bin/console
68
+ - bin/setup
69
+ - lib/uri/s3.rb
70
+ - lib/uri_s3.rb
71
+ - lib/uri_s3/version.rb
72
+ - uri_s3.gemspec
73
+ homepage: https://github.com/mercuryanalytics/uri_s3
74
+ licenses: []
75
+ metadata: {}
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubyforge_project:
92
+ rubygems_version: 2.5.2.3
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: URI class for parsing s3 URIs.
96
+ test_files: []