spurious-ruby-awssdk-helper 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +10 -0
- data/README.md +41 -3
- data/Rakefile +3 -0
- data/lib/spurious/ruby/awssdk/helper/version.rb +1 -1
- data/spec/strategy_spec.rb +11 -6
- data/spurious-ruby-awssdk-helper.gemspec +2 -1
- metadata +22 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c81d258107cec71268b9225fc1b0c15a33eeed1
|
4
|
+
data.tar.gz: 11c9e8dee50768286df55051432b977b6feededd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64709e8d94cbfab2dbb08bdf92a5e7e0d75739ac93be87cb15fa72ffc18f3ad16e015a5229a9162d33b35caf13d9802e444f4929b3316c284f46275033307cc5
|
7
|
+
data.tar.gz: de423bf9a666b95da9e50240f2994b3aed3c16c2f7dde0b3b42da708bfc5aaa6ad6582fccdf7754b6da6c7cde60c86a25c42af0ba5eb1c2873f3ed493a96f0e2
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Spurious::Ruby::Awssdk::Helper
|
2
2
|
|
3
|
-
|
3
|
+
[![Build Status](https://travis-ci.org/spurious-io/ruby-awssdk-helper.png?branch=master)](https://travis-ci.org/spurious-io/ruby-awssdk-helper)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/spurious-ruby-awssdk-helper.png)](http://badge.fury.io/rb/spurious-ruby-awssdk-helper)
|
5
|
+
|
6
|
+
A ruby helper class for configuring the ruby `aws-sdk` to
|
7
|
+
talk to the spurious services.
|
4
8
|
|
5
9
|
## Installation
|
6
10
|
|
@@ -18,11 +22,45 @@ Or install it yourself as:
|
|
18
22
|
|
19
23
|
## Usage
|
20
24
|
|
21
|
-
|
25
|
+
You can configure the `aws-sdk` two different ways:
|
26
|
+
|
27
|
+
1. Shelling out to the CLI tool for the current port mappings
|
28
|
+
2. Getting current port mappings from linked docker containers
|
29
|
+
|
30
|
+
## CLI strategy
|
31
|
+
|
32
|
+
Generally you have this setup done at the entry point of your
|
33
|
+
application or in a di container:
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
require 'spurious/ruby/awssdk/helper'
|
37
|
+
|
38
|
+
Spurious::Ruby::Awssdk::Helper.configure
|
39
|
+
```
|
40
|
+
|
41
|
+
|
42
|
+
## Docker strategy
|
43
|
+
|
44
|
+
If you're running you application in a container on the same host
|
45
|
+
as spurious then you can pass in the following linked containers:
|
46
|
+
|
47
|
+
```bash
|
48
|
+
docker run ... --link sprious-s3:s3.spurious.localhost --link spurious
|
49
|
+
-sqs:sqs.spurious.localhost --link spurious-dynamodb:dynamodb.spurious.localhost
|
50
|
+
```
|
51
|
+
|
52
|
+
then inside your application:
|
53
|
+
|
54
|
+
```ruby
|
55
|
+
require 'spurious/ruby/awssdk/helper'
|
56
|
+
|
57
|
+
Spurious::Ruby::Awssdk::Helper.configure :docker
|
58
|
+
|
59
|
+
```
|
22
60
|
|
23
61
|
## Contributing
|
24
62
|
|
25
|
-
1. Fork it ( https://github.com/
|
63
|
+
1. Fork it ( https://github.com/spurious-io/ruby-awssdk-helper/fork )
|
26
64
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
65
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
66
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/Rakefile
CHANGED
data/spec/strategy_spec.rb
CHANGED
@@ -8,19 +8,22 @@ describe Spurious::Ruby::Awssdk::Strategy do
|
|
8
8
|
'spurious-sqs' => [
|
9
9
|
{
|
10
10
|
'GuestPort' => 123,
|
11
|
-
'HostPort' => 456
|
11
|
+
'HostPort' => 456,
|
12
|
+
'Host' => 'foo'
|
12
13
|
}
|
13
14
|
],
|
14
15
|
'spurious-s3' => [
|
15
16
|
{
|
16
17
|
'GuestPort' => 789,
|
17
|
-
'HostPort' => 101
|
18
|
+
'HostPort' => 101,
|
19
|
+
'Host' => 'foo'
|
18
20
|
}
|
19
21
|
],
|
20
22
|
'spurious-dynamo' => [
|
21
23
|
{
|
22
24
|
'GuestPort' => 121,
|
23
|
-
'HostPort' => 314
|
25
|
+
'HostPort' => 314,
|
26
|
+
'Host' => 'foo'
|
24
27
|
}
|
25
28
|
]
|
26
29
|
}
|
@@ -31,7 +34,7 @@ describe Spurious::Ruby::Awssdk::Strategy do
|
|
31
34
|
subject.sqs
|
32
35
|
subject.s3
|
33
36
|
|
34
|
-
expect(AWS).to receive(:config).exactly(
|
37
|
+
expect(AWS).to receive(:config).exactly(7).times
|
35
38
|
subject.apply(config)
|
36
39
|
|
37
40
|
end
|
@@ -39,7 +42,7 @@ describe Spurious::Ruby::Awssdk::Strategy do
|
|
39
42
|
it "only applys a subset of the options" do
|
40
43
|
subject.dynamo(true, true)
|
41
44
|
|
42
|
-
expect(AWS).to receive(:config).exactly(
|
45
|
+
expect(AWS).to receive(:config).exactly(3).times
|
43
46
|
subject.apply(config)
|
44
47
|
|
45
48
|
end
|
@@ -47,7 +50,9 @@ describe Spurious::Ruby::Awssdk::Strategy do
|
|
47
50
|
it "only sets the port for one service" do
|
48
51
|
subject.dynamo(true)
|
49
52
|
|
50
|
-
expect(AWS).to receive(:config).
|
53
|
+
expect(AWS).to receive(:config).with(:dynamo_db_port => 314)
|
54
|
+
expect(AWS).to receive(:config).with(:dynamo_db_endpoint => "foo")
|
55
|
+
expect(AWS).to receive(:config).with({:use_ssl=>false, :s3_force_path_style=>true})
|
51
56
|
subject.apply(config)
|
52
57
|
|
53
58
|
end
|
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.6"
|
22
22
|
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "rake-rspec", ">= 0.0.2"
|
23
24
|
|
24
|
-
spec.add_runtime_dependency "aws-sdk"
|
25
|
+
spec.add_runtime_dependency "aws-sdk", "~> 1"
|
25
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spurious-ruby-awssdk-helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Jack
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -39,19 +39,33 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rake-rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
48
|
-
type: :
|
47
|
+
version: 0.0.2
|
48
|
+
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.0.2
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: aws-sdk
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1'
|
55
69
|
description: Helper gem for configuring the AWS ruby SDK with spurious details
|
56
70
|
email:
|
57
71
|
- stevenmajack@gmail.com
|
@@ -60,6 +74,7 @@ extensions: []
|
|
60
74
|
extra_rdoc_files: []
|
61
75
|
files:
|
62
76
|
- .gitignore
|
77
|
+
- .travis.yml
|
63
78
|
- Gemfile
|
64
79
|
- LICENSE.txt
|
65
80
|
- README.md
|
@@ -90,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
105
|
version: '0'
|
91
106
|
requirements: []
|
92
107
|
rubyforge_project:
|
93
|
-
rubygems_version: 2.
|
108
|
+
rubygems_version: 2.2.2
|
94
109
|
signing_key:
|
95
110
|
specification_version: 4
|
96
111
|
summary: Helper gem for configuring the AWS ruby SDK with spurious details
|