firespring_dev_commands 2.0.1.pre.alpha.1 → 2.0.1.pre.alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74827accfb664c9f4170d5e6f0daa426963d0ae1aed9ebccae0b2d971c34923a
4
- data.tar.gz: 4dc09342dd87e31c76b68675b910787f6f4a23752a0a9546d15b80e67befdee3
3
+ metadata.gz: 7ab3da39b3b9d7336453745fafa4a50563e03a90e785c29d3bf7cd17543322da
4
+ data.tar.gz: 79b31dec877f099d7ef6d7444ce44563828bd305a790bd943da3d55ca29f2044
5
5
  SHA512:
6
- metadata.gz: ae83b7b87ab131bca8958bd6c2e84e5a14bda7b0588f107d8199d93684fe47146683c3097f6d5add843db1caa1c7f511d321916dac9142528fd22a7326962f5d
7
- data.tar.gz: da782857eb8a4a06b0468e66bf3565a908961bd18fe7e9d3b12779feab97d2f5b4fa53997d3fad169c9c99e46a777707619616c188353d77888517906107befc
6
+ metadata.gz: 79c3ddcc441e1a943b2fe9ca412e1b3a00eb85d49e7469b67720fc910dfdab492b40d6f9148e76c265922458734e382ffb8b45d38993e1661b95e2dd81dbebdc
7
+ data.tar.gz: bf74bb5fc32c3841c6c41562aac41ecc6d2f145f615f8759fe18a79b3bbeb6da9bb77eefa84bd6a638fa4529b436627a70c802cbc08a31c3edc74f0603508698
@@ -7,14 +7,16 @@ module Dev
7
7
  class Docker
8
8
  # Class containing methods for interfacing with the docker compose cli
9
9
  class Compose
10
+ # The name of the docker compose executable
11
+ EXECUTABLE_NAME = %w(docker compose).freeze
12
+
10
13
  # Config object for setting top level docker compose config options
11
- Config = Struct.new(:executable_name, :project_dir, :project_name, :compose_files, :min_version, :max_version) do
14
+ Config = Struct.new(:project_dir, :project_name, :compose_files, :min_version, :max_version) do
12
15
  def initialize
13
- self.executable_name = EXECUTABLE_NAME
14
16
  self.project_dir = DEV_COMMANDS_ROOT_DIR
15
17
  self.project_name = DEV_COMMANDS_PROJECT_NAME
16
18
  self.compose_files = ["#{DEV_COMMANDS_ROOT_DIR}/docker-compose.yml"]
17
- self.min_version = nil
19
+ self.min_version = '2.0.0'
18
20
  self.max_version = nil
19
21
  end
20
22
  end
@@ -34,14 +36,11 @@ module Dev
34
36
 
35
37
  # Returns the version of the docker-compose executable on the system
36
38
  def version
37
- @version ||= `#{EXECUTABLE_NAME} --version`.match(/version v?([0-9.]+)/)[1]
39
+ version_cmd = EXECUTABLE_NAME.dup << 'version'
40
+ @version ||= `#{version_cmd.join(' ')}`.match(/version v?([0-9.]+)/)[1]
38
41
  end
39
42
  end
40
43
 
41
- # @todo Change this to "docker compose" when everyone is off v1
42
- # The name of the docker compose executable
43
- EXECUTABLE_NAME = 'docker-compose'.freeze
44
-
45
44
  attr_accessor :capture, :compose_files, :environment, :options, :project_dir, :project_name, :services, :user, :volumes
46
45
 
47
46
  def initialize(
@@ -71,11 +70,11 @@ module Dev
71
70
  def check_version
72
71
  min_version = self.class.config.min_version
73
72
  version_too_low = min_version && !Dev::Common.new.version_greater_than(min_version, self.class.version)
74
- raise "requires #{self.class.config.executable_name} version >= #{min_version} (found #{self.class.version})" if version_too_low
73
+ raise "requires docker compose version >= #{min_version} (found #{self.class.version})" if version_too_low
75
74
 
76
75
  max_version = self.class.config.max_version
77
76
  version_too_high = max_version && Dev::Common.new.version_greater_than(max_version, self.class.version)
78
- raise "requires #{self.class.config.executable_name} version < #{max_version} (found #{self.class.version})" if version_too_high
77
+ raise "requires docker compose version < #{max_version} (found #{self.class.version})" if version_too_high
79
78
  end
80
79
 
81
80
  # Pull in supported env settings and call build
@@ -239,7 +238,7 @@ module Dev
239
238
 
240
239
  # Build the compose command with the given inputs
241
240
  private def build_command(action, *cmd)
242
- command = self.class.config.executable_name.split(/\s+/)
241
+ command = EXECUTABLE_NAME.dup
243
242
  command << '--project-directory' << project_dir
244
243
  command << '-p' << project_name if project_name
245
244
  Array(compose_files).compact.each { |file| command << '-f' << file }
@@ -6,6 +6,6 @@ module Dev
6
6
  # Use 'v.v.v.pre.alpha.v' for pre-release vesions
7
7
  # Use 'v.v.v.beta.v for beta versions
8
8
  # Use semantic versioning for any releases (https://semver.org/)
9
- VERSION = '2.0.1.pre.alpha.1'.freeze
9
+ VERSION = '2.0.1.pre.alpha.2'.freeze
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firespring_dev_commands
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1.pre.alpha.1
4
+ version: 2.0.1.pre.alpha.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Firespring
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-07 00:00:00.000000000 Z
11
+ date: 2023-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport