kplay 0.1.1 → 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
- SHA1:
3
- metadata.gz: 5180ff7f8cd05626876ebf6c9354137a8b3fa5cd
4
- data.tar.gz: d258a93821772f38a7e3bb2813a7735acde81fca
2
+ SHA256:
3
+ metadata.gz: 515860b760fb32f630f8de69febfae4d21a1b682fd7b7930390656c9cab9a927
4
+ data.tar.gz: 39e66a13e481351ab4b9e0b232de6469d1600c9f2a7443a390a41f4b5ac31f27
5
5
  SHA512:
6
- metadata.gz: ef83b0c6c793d7b2fc0dc22589ccca59b7cd8edbf12ea031cc74f1724eb254ab6b28e64309972abdb8b7746fd0298e8dbb17259e4f3d1bc63ff17f868ee15029
7
- data.tar.gz: bb4c2ee638f81e59b3e9fc4d4c38a245085744a67269d3a956c84054b4d6f473d22c9fa48c909019782cf655b2e76a33db8e601f65ca04e4051f0996ef12b0a8
6
+ metadata.gz: 7783d816fb7bece2a39ac02697a26d165ff5fc9e09cb38c32df6174d6663d6d7ce3f9a6775217a3b0a2dabbea15f43d3454c277418c34e16a5f3a1826e76e89f
7
+ data.tar.gz: 85c90bdebec4dab9bb3a0cbf0d38e5581e6e8f6fec652b1e11535313d93c80fccb16e2bd6e1e1175aee0862dc8e9c1ffb58ff6c384e82c1f46c0b2b94db21bcc
data/exe/kplay CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'bundler/setup'
4
3
  require 'kplay'
5
4
 
6
5
  using Rainbow
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  require 'rainbow/refinement'
3
+ require 'pathname'
3
4
 
4
5
  require 'kplay/version'
5
6
  require_relative 'kplay/system'
@@ -12,7 +12,8 @@ module Kplay
12
12
  'mount_path' => '/${name}',
13
13
  'shell' => '/bin/bash',
14
14
  'shell_args' => ['-c', 'cd /${name}; exec "${SHELL:-sh}"'],
15
- 'stop_grace_period' => 5
15
+ 'stop_grace_period' => 5,
16
+ 'etc_hosts' => [] # <ip> <alias1> [<alias2> ...]
16
17
  }.freeze
17
18
 
18
19
  attr_reader :path, :data
@@ -34,11 +34,16 @@ module Kplay
34
34
  # @return [Hash]
35
35
  #
36
36
  def configuration
37
+ host_aliases = config[:etc_hosts].map do |host|
38
+ ip, *hostnames = host.strip.split(' ')
39
+ { 'ip' => ip, 'hostnames' => hostnames }
40
+ end
37
41
  {
38
42
  'apiVersion' => 'v1',
39
43
  'kind' => 'Pod',
40
44
  'metadata' => { 'name' => name },
41
45
  'spec' => {
46
+ 'hostAliases' => host_aliases,
42
47
  'containers' => [
43
48
  {
44
49
  'name' => name,
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kplay
3
- VERSION = '0.1.1'
3
+ VERSION = '0.2.0'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kplay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Kukushkin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-20 00:00:00.000000000 Z
11
+ date: 2018-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  version: '0'
146
146
  requirements: []
147
147
  rubyforge_project:
148
- rubygems_version: 2.5.1
148
+ rubygems_version: 2.7.6
149
149
  signing_key:
150
150
  specification_version: 4
151
151
  summary: Starts your project within a container in minikube