Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ PATH
specs:
testcontainers-core (0.2.0)
docker-api (~> 2.2)
java-properties (~> 0.3.0)

PATH
remote: elasticsearch
Expand Down Expand Up @@ -104,6 +105,7 @@ GEM
ruby2_keywords (>= 0.0.4)
faraday-net_http (3.0.2)
ffi (1.15.5)
java-properties (0.3.0)
json (2.6.3)
language_server-protocol (3.17.0.3)
lint_roller (1.0.0)
Expand Down
8 changes: 4 additions & 4 deletions core/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@ PATH
specs:
testcontainers-core (0.2.0)
docker-api (~> 2.2)
properties-ruby (~> 0.0.4)
java-properties (~> 0.3.0)

GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
coderay (1.1.3)
docker-api (2.2.0)
excon (>= 0.47.0)
multi_json
excon (0.99.0)
java-properties (0.3.0)
json (2.6.3)
language_server-protocol (3.17.0.3)
lint_roller (1.0.0)
logeasy (0.0.8)
method_source (1.1.0)
minitest (5.18.0)
minitest-hooks (1.5.0)
minitest (> 5.3)
multi_json (1.15.0)
parallel (1.23.0)
parser (3.2.2.1)
ast (~> 2.4.1)
properties-ruby (0.0.4)
logeasy (>= 0.0.4)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.8.0)
Expand Down
8 changes: 5 additions & 3 deletions core/lib/testcontainers/docker_container.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'properties-ruby'
require 'java-properties'

module Testcontainers
# The DockerContainer class is used to manage Docker containers.
# It provides an interface to create, start, stop, and manipulate containers
Expand Down Expand Up @@ -473,8 +474,9 @@ def use
# @raise [ConnectionError] If the connection to the Docker daemon fails.
# @raise [NotFoundError] If Docker is unable to find the image.
def start
properties = Utils::Properties.load_from_file(File.expand_path('~/.testcontainers.properties'))
tc_host = properties.get(:"tc.host")
properties = JavaProperties.load(File.expand_path('~/.testcontainers.properties'))

tc_host = ENV["TESTCONTAINERS_HOST"] || properties[:"tc.host"]

if tc_host && !tc_host.empty?
Docker.url = tc_host
Expand Down
2 changes: 1 addition & 1 deletion core/testcontainers-core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Gem::Specification.new do |spec|

# Uncomment to register a new dependency of your gem
spec.add_dependency "docker-api", "~> 2.2"
spec.add_dependency "properties-ruby", "~> 0.0.4"
spec.add_dependency "java-properties", "~> 0.3.0"

spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "minitest", "~> 5.0"
Expand Down
Loading