spurious-ruby-awssdk-helper 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/spurious/ruby/awssdk/helper.rb +40 -3
- data/lib/spurious/ruby/awssdk/helper/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 147465f284c6ac19ac5e5993e8af02dbc0b06799
|
4
|
+
data.tar.gz: 8ec50a34e59fc6d204089f94564b75042db3d2db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 801a3a11e9071d014862a9895f2cf797600832d5222010fdfe926a00ef86c23f000afae2f5a1517d72d217c6d0b63ed6553ab9c0c946b30914fd2599befbed96
|
7
|
+
data.tar.gz: b8abcde6b2f33cc190b9ce901effd86efd4d3614d71005e5084906143054aef352edd85de4b4d65d84113565df858407d6ff194d1baedac9f9c05af46237d9a8
|
@@ -8,16 +8,53 @@ module Spurious
|
|
8
8
|
module Awssdk
|
9
9
|
module Helper
|
10
10
|
|
11
|
-
def self.port_config
|
11
|
+
def self.port_config
|
12
12
|
config = `spurious ports --json`
|
13
13
|
JSON.parse(config)
|
14
14
|
rescue Exception
|
15
15
|
raise("The spurious CLI tool didn't return the port configuration")
|
16
16
|
end
|
17
17
|
|
18
|
-
def self.
|
18
|
+
def self.docker_config
|
19
|
+
regex = /\/(?<host>[0-9\.]+):(?<port>[0-9]+)/
|
20
|
+
dynamo_db = regex.match(ENV['SPURIOUS_DYNAMODB_PORT'])
|
21
|
+
s3 = regex.match(ENV['SPURIOUS_S3_PORT'])
|
22
|
+
sqs = regex.match(ENV['SPURIOUS_SQS_PORT'])
|
23
|
+
|
24
|
+
{
|
25
|
+
"spurious-dynamo" => [
|
26
|
+
{
|
27
|
+
"Host" => dynamo_db[:host],
|
28
|
+
"HostPort" => dynamo_db[:port]
|
29
|
+
}
|
30
|
+
],
|
31
|
+
"spurious-sqs" => [
|
32
|
+
{
|
33
|
+
"Host" => sqs[:host],
|
34
|
+
"HostPort" => sqs[:port]
|
35
|
+
}
|
36
|
+
],
|
37
|
+
"spurious-s3" => [
|
38
|
+
{
|
39
|
+
"Host" => s3[:host],
|
40
|
+
"HostPort" => s3[:port]
|
41
|
+
}
|
42
|
+
]
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.config(type)
|
47
|
+
case type
|
48
|
+
when :cli
|
49
|
+
port_config
|
50
|
+
when :docker
|
51
|
+
docker_config
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.configure(type = :cli, strategy = nil)
|
19
56
|
strategy ||= Spurious::Ruby::Awssdk::Strategy.new(true)
|
20
|
-
strategy.apply(
|
57
|
+
strategy.apply(config(type))
|
21
58
|
end
|
22
59
|
|
23
60
|
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.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Jack
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07
|
11
|
+
date: 2014-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
version: '0'
|
91
91
|
requirements: []
|
92
92
|
rubyforge_project:
|
93
|
-
rubygems_version: 2.0.
|
93
|
+
rubygems_version: 2.0.14
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: Helper gem for configuring the AWS ruby SDK with spurious details
|