firespring_dev_commands 2.1.21.pre.alpha.2 → 2.1.21.pre.alpha.3

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: 87e1ba4de217508ebdec8d17da4156baaab7bfb45154519d5b5aa930d8f8755b
4
- data.tar.gz: 9b208c659543d76dc89b7b9e92d21991445056d9cae72bf7616bed2b5169d6b8
3
+ metadata.gz: 23ad8131b620682ed6d6e9b496934646615c3aca3c0656886a624e03c73f0041
4
+ data.tar.gz: 936887064f1e8e3c71193af00a105b3808ede716b5bf72cc959c7db63d459ac0
5
5
  SHA512:
6
- metadata.gz: a6c7ef9927e5b2cd60a0f21ebd50d6a2b0f96aa383c69d9b8196c2d4c4c11700350e231dcb34b5e1bf83f5953cc999ebbf6b7edcc8d0a9ee200275e936fda4cd
7
- data.tar.gz: e97e145d2820c3ecd8143fafcf5a730edb39351fdfb2bf61b95344039e0ae54801c0029dccb6d1b313cd093aa195bcd775674145a23b2ba6a6838b77b3cf4297
6
+ metadata.gz: 89cd73bbf3342e5ff66a9762311bfd07a5c78f18aa7dc92d3edaef96d55277054a887b011b672a3a9d2689870a98c1a1784ee5061f6539bba8a95856fe86d095
7
+ data.tar.gz: e0a8077e578697502912063cdf9004d21c993cb32b54cbfb46b158f59b7f7a37ac6362358606070451113ead000bf7759859999cc9818eddbbeba7cdda43965f
@@ -1,5 +1,7 @@
1
1
  module Dev
2
+ # Module containing different classes for interfacing with coverage files
2
3
  module Coverage
4
+ # Class for checking code coverage using cobertura
3
5
  class Cobertura
4
6
  attr_reader :local_filename, :container_filename, :filename, :threshold
5
7
 
@@ -8,15 +10,18 @@ module Dev
8
10
  @local_filename = File.join(local_path || '.', @filename)
9
11
  @container_filename = File.join(container_path || '.', @filename)
10
12
  @threshold = threshold.to_f
13
+ end
11
14
 
15
+ # Remove any previous versions of the local file that will be output
16
+ # return the phpunit options needed to regenerate the cobertura xml file
17
+ def php_options
12
18
  # Remove any previous coverage info
13
19
  FileUtils.rm_f(local_filename, verbose: true)
14
- end
15
20
 
16
- def options
17
21
  %W(--coverage-cobertura #{container_filename})
18
22
  end
19
23
 
24
+ # Parse the cobertura file as a hash and check the total coverage against the desired threshold
20
25
  def check
21
26
  report = Ox.load(File.read(local_filename), mode: :hash)
22
27
  attrs, = report[:coverage]
@@ -95,7 +95,7 @@ module Dev
95
95
  def test_command
96
96
  test = []
97
97
  test << './vendor/bin/phpunit'
98
- test << coverage.options if coverage
98
+ test << coverage.php_options if coverage
99
99
  test.concat(Dev::Common.new.tokenize(ENV['OPTS'].to_s))
100
100
  test
101
101
  end
@@ -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.2'.freeze
9
+ VERSION = '2.1.21.pre.alpha.3'.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.2
4
+ version: 2.1.21.pre.alpha.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Firespring