ecs_compose 0.1.0.pre33 → 0.1.0.pre34

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: e1b662e5ea62353ac04d0e9ee50e1313de11d695
4
- data.tar.gz: 67d9a799bd6f614682483f6406dd36aefdadcd1e
3
+ metadata.gz: e53ba48d1b6bf3d23dcccfddad36405ff5e72104
4
+ data.tar.gz: d37288d632cd3741327c525259813cb6d7224024
5
5
  SHA512:
6
- metadata.gz: 189c8b0be79bd46b9d45179dabd8449100d9a1f46e1c9492da5c0be369955771bb47043dfcb4b5c96c01b238b549fa63e6ecd70d1b51cba9e5a582ad4c66f186
7
- data.tar.gz: b69b19dd4afd5b83fdd06fab4cc3d1a549a5923624025ed601018c1f4e4a559d43168990392beed787847ed5e831d318d002d7be0819c9b4a69c332e3c17fe02
6
+ metadata.gz: a83f90f37847dd28dbb201a8d786aed7f52cca8a922eef6879f17b0baf1f869ea318650a057fc6167e5e38ed0134ef5b332a1a4003f3ef07b93a56cedc175c55
7
+ data.tar.gz: a2293736fd99d92a546a1b92b68605ddf85a41b95bfd12563310610aac1ae95c2f078f677776e682864a81784776d2e07533139c23bbf46db802f7a2e7263944
@@ -162,11 +162,19 @@ module EcsCompose
162
162
  # Parse a Docker-style port mapping and convert to ECS format.
163
163
  def port_mapping(port)
164
164
  case port.to_s
165
- when /\A(\d+)\z/
165
+ when /\A(\d+)(?:\/([a-z]+))?\z/
166
166
  port = $1.to_i
167
- { "hostPort" => port, "containerPort" => port }
168
- when /\A(\d+):(\d+)\z/
169
- { "hostPort" => $1.to_i, "containerPort" => $2.to_i }
167
+ {
168
+ "hostPort" => port,
169
+ "containerPort" => port,
170
+ "protocol" => $2 || "tcp"
171
+ }
172
+ when /\A(\d+):(\d+)(?:\/([a-z]+))?\z/
173
+ {
174
+ "hostPort" => $1.to_i,
175
+ "containerPort" => $2.to_i,
176
+ "protocol" => $3 || "tcp"
177
+ }
170
178
  else
171
179
  raise "Cannot parse port specification: #{port}"
172
180
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecs_compose
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre33
4
+ version: 0.1.0.pre34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Kidd
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-12 00:00:00.000000000 Z
11
+ date: 2016-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt