docker-compose 1.1.12 → 1.1.13

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: b6f9ab42897fdf854ec681861c54d8ab2a948143
4
- data.tar.gz: fdaf0db0d9118a46d2c56d95dac7ee3efb175cd9
2
+ SHA256:
3
+ metadata.gz: e6262f4b5327a6262a8ce2444095d7e8ef3d146d1c51a8274bfd630316283319
4
+ data.tar.gz: 1c55d47ce905b4bd05e107c14e5526aa4639eea8855e9fe570b55baacc5db078
5
5
  SHA512:
6
- metadata.gz: 450d0a1d707cfc1b9464020ca89690afa55bcb976b97c3fb01ac70ba841b68354d1d939a3949d9ec4056c43d20d93d728a9dcfc9c20ccc71ebab6da731227d20
7
- data.tar.gz: 46845b7b4d45ecae7d229739706a0dc7978754d5f067a3a02911e0aa46d84645ee9bd12ffba747161e68a53c88d54c23a8bd80024807ed044e756239a7d4a818
6
+ metadata.gz: e32beed052983ef9da71bc0e2fbb34cdf7f91933f4a711f2afe601087832e449d2a09ca487534d2e23f2206eb5e2c3d49baccceb1d421347037d3afa6fbb0a7b
7
+ data.tar.gz: ce78f94fd2d0a4c6a35f39edfe6d4a93423df3126036ee4bd16d037d5b26f403e2b5609cc0c408858ec3cc4bd4e1acc8dc2853b469bea7cdff16a6db712b6feb
data/.rubocop.yml CHANGED
@@ -2,22 +2,25 @@
2
2
  # - any cop that can be auto-corrected with `rubocop -a` is mandatory
3
3
  # - other cops may be enabled if committer fixes all issues
4
4
  AllCops:
5
+ NewCops: enable
5
6
  Exclude:
6
- - features/**/*
7
- - spec/**/*
7
+ - features/**/*
8
+ - spec/**/*
8
9
  Style/Encoding:
9
10
  Enabled: true
10
11
  Style/FormatString:
11
12
  Enabled: false
12
13
  Style/GuardClause:
13
14
  Enabled: false
15
+ Layout/LineLength:
16
+ Enabled: false
14
17
  Lint/AmbiguousRegexpLiteral:
15
18
  Enabled: false
16
19
  Metrics/AbcSize:
17
20
  Enabled: false
18
- Metrics/ClassLength:
21
+ Metrics/BlockLength:
19
22
  Enabled: false
20
- Metrics/LineLength:
23
+ Metrics/ClassLength:
21
24
  Enabled: false
22
25
  Metrics/MethodLength:
23
26
  Enabled: false
data/.ruby-version CHANGED
@@ -1,2 +1 @@
1
- 2.3.3
2
-
1
+ 3.0.0
data/.travis.yml CHANGED
@@ -3,4 +3,6 @@ rvm:
3
3
  - 2.0
4
4
  - 2.1
5
5
  - 2.3.1
6
+ - 2.7.1
7
+ - 3.0.0
6
8
  before_install: gem install bundler -v 1.10.6
data/Gemfile CHANGED
@@ -7,6 +7,8 @@ group :development do
7
7
  gem 'pry'
8
8
  gem 'pry-byebug'
9
9
  gem 'rubocop'
10
+ gem 'rubocop-rake'
11
+ gem 'rubocop-rspec'
10
12
  end
11
13
 
12
14
  group :test do
@@ -19,11 +19,11 @@ 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.0', '< 4.0')
23
23
 
24
24
  spec.add_dependency 'backticks', '~> 1.0'
25
25
 
26
- spec.add_development_dependency 'bundler', '~> 1.10'
26
+ spec.add_development_dependency 'bundler', '~> 2.3'
27
27
  spec.add_development_dependency 'rake', '~> 10.0'
28
28
  spec.add_development_dependency 'rspec'
29
29
  end
@@ -17,6 +17,10 @@ module Docker::Compose
17
17
  # @return [String]
18
18
  attr_accessor :dir
19
19
 
20
+ # Set the project name. Default is not to pass a custom name.
21
+ # @return [String]
22
+ attr_accessor :project_name
23
+
20
24
  # Set the name of the docker-compose file. Default is`docker-compose.yml`.
21
25
  # @return [String]
22
26
  attr_accessor :file
@@ -57,6 +61,7 @@ module Docker::Compose
57
61
  # can be configured by calling #server_env=, #file= and so forth.
58
62
  def initialize
59
63
  self.dir = Rake.application.original_dir
64
+ self.project_name = nil
60
65
  self.file = 'docker-compose.yml'
61
66
  self.host_env = {}
62
67
  self.extra_host_env = {}
@@ -64,7 +69,7 @@ module Docker::Compose
64
69
  yield self if block_given?
65
70
 
66
71
  @shell = Backticks::Runner.new
67
- @session = Docker::Compose::Session.new(@shell, dir: dir, file: file)
72
+ @session = Docker::Compose::Session.new(@shell, dir: dir, project_name: project_name, file: file)
68
73
  @net_info = Docker::Compose::NetInfo.new
69
74
  @shell_printer = Docker::Compose::ShellPrinter.new
70
75
 
@@ -80,7 +85,7 @@ module Docker::Compose
80
85
  @shell.interactive = false # suppress useless 'port' output
81
86
 
82
87
  tty = STDOUT.tty?
83
- tlt = Rake.application.top_level_tasks.include?('docker:compose:env')
88
+ tlt = Rake.application.top_level_tasks.include?(task_name('env'))
84
89
 
85
90
  # user invoked this task directly; print some helpful tips on
86
91
  # how we intend it to be used.
@@ -92,7 +97,7 @@ module Docker::Compose
92
97
  end
93
98
 
94
99
  desc 'Run command on host, linked to services in containers'
95
- task :host, [:command] => ['docker:compose:env'] do |_task, args|
100
+ task :host, [:command] => [task_name('env')] do |_task, args|
96
101
  if host_services
97
102
  @session.up(*host_services, detached: true)
98
103
  else
@@ -151,11 +156,16 @@ module Docker::Compose
151
156
  private :print_env
152
157
 
153
158
  def print_usage
154
- command = "rake #{rake_namespace}:env"
159
+ command = "rake #{task_name('env')}"
155
160
  command = 'bundle exec ' + command if defined?(Bundler)
156
161
  puts @shell_printer.comment('To export these variables to your shell, run:')
157
162
  puts @shell_printer.comment(@shell_printer.eval_output(command))
158
163
  end
159
164
  private :print_usage
165
+
166
+ def task_name(task)
167
+ [rake_namespace, task].join(':')
168
+ end
169
+ private :task_name
160
170
  end
161
171
  end
@@ -21,6 +21,9 @@ module Docker::Compose
21
21
  # Working directory (determines compose project name); default is Dir.pwd
22
22
  attr_reader :dir
23
23
 
24
+ # Project name; default is not to pass a custom name
25
+ attr_reader :project_name
26
+
24
27
  # Project file; default is 'docker-compose.yml'
25
28
  attr_reader :file
26
29
 
@@ -28,8 +31,9 @@ module Docker::Compose
28
31
  attr_reader :last_command
29
32
 
30
33
  def initialize(shell = Backticks::Runner.new(buffered: [:stderr], interactive: true),
31
- dir: Dir.pwd, file: 'docker-compose.yml')
34
+ dir: Dir.pwd, project_name: nil, file: 'docker-compose.yml')
32
35
  @shell = shell
36
+ @project_name = project_name
33
37
  @dir = dir
34
38
  @file = file
35
39
  @last_command = nil
@@ -250,6 +254,11 @@ module Docker::Compose
250
254
  # @return [String] output of the command
251
255
  # @raise [Error] if command fails
252
256
  def run!(*args)
257
+ project_name_args = if @project_name
258
+ [{ project_name: @project_name }]
259
+ else
260
+ []
261
+ end
253
262
  file_args = case @file
254
263
  when 'docker-compose.yml'
255
264
  []
@@ -263,7 +272,7 @@ module Docker::Compose
263
272
  end
264
273
 
265
274
  @shell.chdir = dir
266
- @last_command = @shell.run('docker-compose', *file_args, *args).join
275
+ @last_command = @shell.run('docker-compose', *project_name_args, *file_args, *args).join
267
276
  status = @last_command.status
268
277
  out = @last_command.captured_output
269
278
  err = @last_command.captured_error
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module Docker
3
3
  module Compose
4
- VERSION = '1.1.12'
4
+ VERSION = '1.1.13'
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.1.12
4
+ version: 1.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Spataro
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-23 00:00:00.000000000 Z
11
+ date: 2022-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backticks
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.10'
33
+ version: '2.3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.10'
40
+ version: '2.3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -106,24 +106,26 @@ homepage: https://github.com/xeger/docker-compose
106
106
  licenses:
107
107
  - MIT
108
108
  metadata: {}
109
- post_install_message:
109
+ post_install_message:
110
110
  rdoc_options: []
111
111
  require_paths:
112
112
  - lib
113
113
  required_ruby_version: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '2.0'
118
+ - - "<"
119
+ - !ruby/object:Gem::Version
120
+ version: '4.0'
118
121
  required_rubygems_version: !ruby/object:Gem::Requirement
119
122
  requirements:
120
123
  - - ">="
121
124
  - !ruby/object:Gem::Version
122
125
  version: '0'
123
126
  requirements: []
124
- rubyforge_project:
125
- rubygems_version: 2.5.2
126
- signing_key:
127
+ rubygems_version: 3.2.3
128
+ signing_key:
127
129
  specification_version: 4
128
130
  summary: Wrapper docker-compose with added Rake smarts.
129
131
  test_files: []