Module: Spurious::Ruby::Awssdk::Helper
- Defined in:
- lib/spurious/ruby/awssdk/helper.rb,
lib/spurious/ruby/awssdk/helper/version.rb
Constant Summary collapse
- VERSION =
"0.2.2"
Class Method Summary collapse
- .config(type) ⇒ Object
- .configure(type = :cli, strategy = nil) ⇒ Object
- .docker_config ⇒ Object
- .port_config ⇒ Object
Class Method Details
.config(type) ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'lib/spurious/ruby/awssdk/helper.rb', line 42 def self.config(type) case type when :cli port_config when :docker docker_config end end |
.configure(type = :cli, strategy = nil) ⇒ Object
51 52 53 54 |
# File 'lib/spurious/ruby/awssdk/helper.rb', line 51 def self.configure(type = :cli, strategy = nil) strategy ||= Spurious::Ruby::Awssdk::Strategy.new(true) strategy.apply(config(type)) end |
.docker_config ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/spurious/ruby/awssdk/helper.rb', line 19 def self.docker_config { "spurious-dynamo" => [ { "Host" => ENV['SPURIOUS.DYNAMODB.LOCAL_NAME'].split('/').last, "HostPort" => URI(ENV['SPURIOUS.DYNAMODB.LOCAL_PORT']).port } ], "spurious-sqs" => [ { "Host" => ENV['SPURIOUS.SQS.LOCAL_NAME'].split('/').last, "HostPort" => URI(ENV['SPURIOUS.SQS.LOCAL_PORT']).port } ], "spurious-s3" => [ { "Host" => ENV['SPURIOUS.S3.LOCAL_NAME'].split('/').last, "HostPort" => URI(ENV['SPURIOUS.S3.LOCAL_PORT']).port } ] } end |
.port_config ⇒ Object
12 13 14 15 16 17 |
# File 'lib/spurious/ruby/awssdk/helper.rb', line 12 def self.port_config config = `spurious ports --json` JSON.parse(config) rescue Exception raise("The spurious CLI tool didn't return the port configuration") end |