firespring_dev_commands 2.1.21.pre.alpha.4 → 2.1.21.pre.alpha.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 831bd71e091dc6ad04f4ce368c343207845a6d9ae175fe12f40e36dee14717c3
|
4
|
+
data.tar.gz: 5eb6f226edc9309bb1a6873127decc4b678aea8d3e8005c5686d9c082096b05d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 :
|
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
|
-
|
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
|
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
|