Sha256: 7151eef10e4a842e3c44a9fcc78432f78b0f46734689f1a9f92b4b4737794aff

Contents?: true

Size: 880 Bytes

Versions: 2

Compression:

Stored size: 880 Bytes

Contents

module Httpotemkin
  class Client
    def initialize(containers)
      @containers = containers
    end

    def execute(cmd, working_directory: nil)
      @out = @containers.exec_client(cmd, working_directory: working_directory)
    end

    def exit_code
      0
    end

    def out
      @out
    end

    def err
      ""
    end

    def inject_tarball(filename)
      Cheetah.run(["cat", filename], ["docker", "cp", "-", "client:/"])
    end

    def install_gem_from_spec(specfile)
      Dir.chdir(File.dirname(specfile)) do
        out = Cheetah.run(["gem", "build", File.basename(specfile)],
          stdout: :capture)
        gemfile = out[/File: (.*)\n/, 1]
        @containers.run_docker(["cp", gemfile, "client:/tmp"])
        @containers.run_docker(["exec", "client", "gem", "install", "--local",
          File.join("/tmp", gemfile)])
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
httpotemkin-0.0.2 lib/client.rb
httpotemkin-0.0.1 lib/client.rb