firespring_dev_commands 2.1.21.pre.alpha.4 → 2.1.21.pre.alpha.5

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
  SHA256:
3
- metadata.gz: d35a98b66dfe013f7552c2d5baf17b373ad71e3893945844a24768620755bf5f
4
- data.tar.gz: faa627fca3af6b2c2ef417fd1442439b16d7acafa6a1a3dfa5da1fc01c26e327
3
+ metadata.gz: 831bd71e091dc6ad04f4ce368c343207845a6d9ae175fe12f40e36dee14717c3
4
+ data.tar.gz: 5eb6f226edc9309bb1a6873127decc4b678aea8d3e8005c5686d9c082096b05d
5
5
  SHA512:
6
- metadata.gz: 434c1348564f615f90438f4682080aa70a659693a264e2b47ac17f94e935fb0dfbace4875df3c76dcd5ac76d2ce44cdc7ded70ec10882e5fa4927f01e9e4fb0c
7
- data.tar.gz: a11c82d457d76e6eeca78217db40a62d7cc9c6eade77c2f07cb9c68ed89b4b1d274b6e7cad5e64abefa0c1814c23b29a03f2e4b0d837d9f9faece9b24ca5821b
6
+ metadata.gz: 7fb65d68db2549227de42ee2f5921e7a2586020aabfe9fcd54d1e923f089c9ba0e3e16338c8d800c0e526dc18e49d38819364df4a99db209140b13c19cb58680
7
+ data.tar.gz: e8da4354c580c083584c7e2850bce7865e99ecb4646224170e4a5b519e8a0b0d09557c6125e5fde99f29980eb917ec5b4218bd465c352250b101e564944bd835
@@ -3,13 +3,11 @@ module Dev
3
3
  module Coverage
4
4
  # Class for checking code coverage using cobertura
5
5
  class Cobertura
6
- attr_reader :local_path, :container_path, :filename, :threshold, :local_path, :local_filename, :container_path, :container_filename
6
+ attr_reader :local_filename, :container_filename, :filename, :threshold
7
7
 
8
8
  def initialize(filename: 'cobertura.xml', threshold: nil, container_path: nil, local_path: nil)
9
9
  @filename = filename
10
- @local_path = local_path
11
10
  @local_filename = File.join(local_path || '.', @filename)
12
- @container_path = container_path
13
11
  @container_filename = File.join(container_path || '.', @filename)
14
12
  @threshold = threshold.to_f
15
13
  end
@@ -29,8 +27,7 @@ module Dev
29
27
  # If an application has been specified and the file does not exist locally, attempt to copy it back from the docker container
30
28
  if application && !File.exist?(local_filename)
31
29
  container = Dev::Docker::Compose.new.container_by_name(application)
32
- workdir = Dev::Docker.new.default_working_dir(container)
33
- Dev::Docker.new.copy_from_container(container, File.join(workdir, filename), local_filename, required: true)
30
+ Dev::Docker.new.copy_from_container(container, container_filename, local_filename, required: true)
34
31
  end
35
32
 
36
33
  # Load the file from disk and parse with ox
@@ -139,12 +139,13 @@ module Dev
139
139
  end
140
140
 
141
141
  # Gets the default working dir of the container
142
- def default_working_dir(container)
142
+ def working_dir(container)
143
143
  container.json['Config']['WorkingDir']
144
144
  end
145
145
 
146
146
  # Copies the source path on your local machine to the destination path on the container
147
147
  def copy_to_container(container, source_path, dest_path)
148
+ dest_path = File.join(working_dir(container), dest_path) unless dest_path.start_with?(File::SEPARATOR)
148
149
  LOG.info "Copying #{source_path} to #{dest_path}... "
149
150
 
150
151
  container.archive_in(source_path, dest_path, overwrite: true)
@@ -159,6 +160,7 @@ module Dev
159
160
  # Copies the source path on the container to the destination path on your local machine
160
161
  # If required is set to true, the command will fail if the source path does not exist on the container
161
162
  def copy_from_container(container, source_path, dest_path, required: true)
163
+ source_path = File.join(working_dir(container), source_path) unless source_path.start_with?(File::SEPARATOR)
162
164
  LOG.info "Copying #{source_path} to #{dest_path}... "
163
165
 
164
166
  tar = StringIO.new
@@ -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.1.21.pre.alpha.4'.freeze
9
+ VERSION = '2.1.21.pre.alpha.5'.freeze
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firespring_dev_commands
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.21.pre.alpha.4
4
+ version: 2.1.21.pre.alpha.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Firespring