docker-compose 1.0.0rc2 → 1.0.0rc3

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: 0ac6123a9b77b5d0ff6902f5e89467fd17ed34fe
4
- data.tar.gz: 585201f65eb1fb6d654af2a484a09e2f8f27ba75
3
+ metadata.gz: 5f54bf97c62e651b2fafd4c8983891c4432f765d
4
+ data.tar.gz: f71754cf9158c49496842855919ff21b6888bd63
5
5
  SHA512:
6
- metadata.gz: 4517ccd9c0f2e9aef88e4c30a8fd653cc27cc3aa2b11759e191569a687ae03d8358c9d2db5dc8a74f24435add97ac7007121ab9a504804642438437c2f0b5e8d
7
- data.tar.gz: 07c4f04f8417b07fa8b9dda91026c512186840b0cfb9ffed0d9ecfe2d8562b34a62948397004cf7f69c6a26c2c56bf73c1cc475edc4ca43fa758f8dd7eb1a17a
6
+ metadata.gz: 32a4092bfa5f11f01f2444f2e7911b5a5d86883d7caafbaff3fcd1ceb2e345620ffe07faefcec4f7bbde9061187d4968799d6268ae7bad4b0e1fe8ac477b784c
7
+ data.tar.gz: a91add327817914365a8e5bb5d4c66398a0f2e1aed87ad03dd4754af7d9f508b0ead4ab89ff180d47bb9321087824e9cdfd7358818aa382a29167102ddc6e7b8
data/.ruby-version CHANGED
@@ -1 +1,2 @@
1
- 2.2.2
1
+ 2.3.1
2
+
data/.travis.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.0
3
+ - 2.1
4
+ - 2.3.1
4
5
  before_install: gem install bundler -v 1.10.6
data/Gemfile CHANGED
@@ -3,7 +3,7 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in docker-compose.gemspec
4
4
  gemspec
5
5
 
6
- gem 'backticks', '1.0.0rc1'
6
+ gem 'backticks', '1.0.0rc2'
7
7
 
8
8
  group :development do
9
9
  gem 'pry'
@@ -19,9 +19,9 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ['lib']
21
21
 
22
- spec.required_ruby_version = Gem::Requirement.new("~> 2.0")
22
+ spec.required_ruby_version = Gem::Requirement.new('~> 2.1')
23
23
 
24
- spec.add_dependency 'backticks', '>= 1.0.0rc1'
24
+ spec.add_dependency 'backticks', '>= 1.0.0rc2'
25
25
 
26
26
  spec.add_development_dependency 'bundler', '~> 1.10'
27
27
  spec.add_development_dependency 'rake', '~> 10.0'
@@ -10,7 +10,7 @@ module Docker::Compose
10
10
  @status = status
11
11
  @detail = detail
12
12
 
13
- brief = detail.split("\n").first || '(no output)'
13
+ brief = detail.split(/[\r\n]+/).select { |l| !l.empty? }.first || '(no output)'
14
14
 
15
15
  case status
16
16
  when Numeric
@@ -100,12 +100,19 @@ module Docker::Compose
100
100
  # @raise [NoService] if service is not up or does not publish port
101
101
  # @return [Array] (String, Integer) pair of host address and port number
102
102
  def host_and_port(service, port)
103
- result = @session.port(service, port).chomp
103
+ result = @session.port(service, port)
104
+ if result
105
+ result.chomp!
106
+ else
107
+ raise NoService,
108
+ "Service '#{service}' not running, or does not " \
109
+ "publish port '#{port}'"
110
+ end
111
+
104
112
  host, port = result.split(':')
105
113
  host = @override_host if @override_host
114
+
106
115
  [host, Integer(port)]
107
- rescue RuntimeError, TypeError
108
- raise NoService, "Service '#{service}' not running, or does not publish port '#{port}'"
109
116
  end
110
117
 
111
118
  private
@@ -15,7 +15,11 @@ module Docker::Compose
15
15
  # allowed by the docker-compose CLI, and that options are sometimes renamed
16
16
  # for clarity, e.g. the "-d" flag always becomes the "detached:" kwarg.
17
17
  class Session
18
- attr_reader :dir, :file
18
+ # Working directory (determines compose project name); default is Dir.pwd
19
+ attr_reader :dir
20
+
21
+ # Project file; default is 'docker-compose.yml'
22
+ attr_reader :file
19
23
 
20
24
  def initialize(shell = Backticks::Runner.new(buffered: [:stderr], interactive: true),
21
25
  dir: Dir.pwd, file: 'docker-compose.yml')
@@ -110,6 +114,11 @@ module Docker::Compose
110
114
  run!('run', o, *env_params, service, cmd)
111
115
  end
112
116
 
117
+ def restart(*services, timeout:10)
118
+ o = opts(timeout: [timeout, 10])
119
+ run!('restart', o, *services)
120
+ end
121
+
113
122
  # Pause running services.
114
123
  # @param [Array] services list of String service names to run
115
124
  def pause(*services)
@@ -216,14 +225,13 @@ module Docker::Compose
216
225
  [{ file: @file.to_s }]
217
226
  end
218
227
 
219
- Dir.chdir(@dir) do
220
- cmd = @shell.run('docker-compose', *file_args, *args).join
221
- status = cmd.status
222
- out = cmd.captured_output
223
- err = cmd.captured_error
224
- status.success? || fail(Error.new(args.first, status, err))
225
- out
226
- end
228
+ @shell.chdir = dir
229
+ cmd = @shell.run('docker-compose', *file_args, *args).join
230
+ status = cmd.status
231
+ out = cmd.captured_output
232
+ err = cmd.captured_error
233
+ status.success? || fail(Error.new(args.first, status, out+err))
234
+ out
227
235
  end
228
236
 
229
237
  private
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module Docker
3
3
  module Compose
4
- VERSION = '1.0.0rc2'
4
+ VERSION = '1.0.0rc3'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-compose
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0rc2
4
+ version: 1.0.0rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Spataro
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-22 00:00:00.000000000 Z
11
+ date: 2016-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backticks
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.0rc1
19
+ version: 1.0.0rc2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.0rc1
26
+ version: 1.0.0rc2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -114,7 +114,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '2.0'
117
+ version: '2.1'
118
118
  required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  requirements:
120
120
  - - ">"
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  version: 1.3.1
123
123
  requirements: []
124
124
  rubyforge_project:
125
- rubygems_version: 2.4.5
125
+ rubygems_version: 2.5.1
126
126
  signing_key:
127
127
  specification_version: 4
128
128
  summary: Wrapper docker-compose with added Rake smarts.