spurious-ruby-awssdk-helper 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a2746fa5ba8f1e44823065b5273a04d471ca1bb5
4
- data.tar.gz: 1a1665ce05fb24d6909d4179b7f97318f75ec9fe
3
+ metadata.gz: 147465f284c6ac19ac5e5993e8af02dbc0b06799
4
+ data.tar.gz: 8ec50a34e59fc6d204089f94564b75042db3d2db
5
5
  SHA512:
6
- metadata.gz: 80aa20f0b4db6d4b88456d87b00814d96adc0baa5ee9de7e7b164da088dd7cdc624b5e2f39f902acb7e0b2916175d50e0cb231d0b6ba6cb7ca2586ade5f825af
7
- data.tar.gz: 102941dde655a588669823c03e3700bfbe3daa1e8c27196227168a5aba2bbfd0ec15461e19bcf00180d2ecca02d4c658826d3a4afa1edeb24ebd0c6369539b52
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.configure(strategy = nil)
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(port_config)
57
+ strategy.apply(config(type))
21
58
  end
22
59
 
23
60
  end
@@ -2,7 +2,7 @@ module Spurious
2
2
  module Ruby
3
3
  module Awssdk
4
4
  module Helper
5
- VERSION = "0.1.3"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
8
8
  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.1.3
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 00:00:00.000000000 Z
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.3
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