Sha256: 98055ecbda63a70d790facea8c7ca9bc6155c1d2ae3e46c6c90d30ba06e900db

Contents?: true

Size: 592 Bytes

Versions: 14

Compression:

Stored size: 592 Bytes

Contents

module Minke
  module Docker
    class Network
      def initialize network_name, shell_runner
        @network_name = network_name
        @shell_runner = shell_runner
      end

      def create
        @shell_runner.execute("docker network create #{@network_name}") if find_network.to_s == ''
      end

      def remove
        @shell_runner.execute("docker network rm #{@network_name}", true) unless find_network.to_s == ''
      end

      private 
      def find_network
        @shell_runner.execute_and_return("docker network ls | grep #{@network_name}")
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
minke-1.14.1 lib/minke/docker/network.rb
minke-1.14.0 lib/minke/docker/network.rb
minke-1.13.20 lib/minke/docker/network.rb
minke-1.13.19 lib/minke/docker/network.rb
minke-1.13.18 lib/minke/docker/network.rb
minke-1.13.16 lib/minke/docker/network.rb
minke-1.13.15 lib/minke/docker/network.rb
minke-1.13.14 lib/minke/docker/network.rb
minke-1.13.13 lib/minke/docker/network.rb
minke-1.13.12 lib/minke/docker/network.rb
minke-1.13.11 lib/minke/docker/network.rb
minke-1.13.10 lib/minke/docker/network.rb
minke-1.13.9 lib/minke/docker/network.rb
minke-1.13.8 lib/minke/docker/network.rb