xcov 1.2.0 → 1.3.0
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 +4 -4
- data/lib/xcov-core.rb +5 -2
- data/lib/xcov/coveralls_handler.rb +4 -1
- data/lib/xcov/manager.rb +3 -1
- data/lib/xcov/model/base.rb +1 -1
- data/lib/xcov/model/report.rb +1 -1
- data/lib/xcov/model/target.rb +0 -1
- data/lib/xcov/options.rb +0 -1
- data/lib/xcov/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0eb5cb1a9c18c7941ba1cf8f21202898a8e0c741
|
|
4
|
+
data.tar.gz: f6df9408fdec967b5ffe3c513648a7cdde661483
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e4eccd0361bf98ef176466b843e1b759aaea1b233f93abe26eaceca2b348f9eb8f8e7ad4f6c5df50b3900f7b8fd2b8e9c6a89718c93f46037857be3bf26f2490
|
|
7
|
+
data.tar.gz: 631df2b5a060f47ab088a201d80837a52bb42c7144286d815e633413b3402f28078f1c41258c717718428f3e678f7b5b59ddbaac74823385a534e9603842eb10
|
data/lib/xcov-core.rb
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
require 'xcov-core/version'
|
|
2
2
|
require 'xcov'
|
|
3
3
|
require 'json'
|
|
4
|
+
require 'fileutils'
|
|
4
5
|
require 'tempfile'
|
|
5
6
|
require 'fastlane_core'
|
|
6
7
|
|
|
@@ -11,8 +12,10 @@ module Xcov
|
|
|
11
12
|
|
|
12
13
|
class Parser
|
|
13
14
|
|
|
14
|
-
def self.parse(file)
|
|
15
|
-
|
|
15
|
+
def self.parse(file, output_directory)
|
|
16
|
+
tmp_dir = File.join(output_directory, 'tmp')
|
|
17
|
+
FileUtils.mkdir_p(tmp_dir) unless File.directory?(tmp_dir)
|
|
18
|
+
report_output = Tempfile.new("report.json", tmp_dir)
|
|
16
19
|
command = "#{ENV['XCOV_CORE_LIBRARY_PATH'].shellescape} -s #{file.shellescape} -o #{report_output.path.shellescape} --include-lines-info"
|
|
17
20
|
description = [{ prefix: "Parsing .xccoverage file: " }]
|
|
18
21
|
execute_command(command, description)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
require 'fileutils'
|
|
1
2
|
require "tempfile"
|
|
2
3
|
|
|
3
4
|
module Xcov
|
|
@@ -51,7 +52,9 @@ module Xcov
|
|
|
51
52
|
require "json"
|
|
52
53
|
|
|
53
54
|
# Persist
|
|
54
|
-
|
|
55
|
+
tmp_dir = File.join(Xcov.config[:output_directory], 'tmp')
|
|
56
|
+
FileUtils.mkdir_p(tmp_dir) unless File.directory?(tmp_dir)
|
|
57
|
+
coveralls_json_file = Tempfile.new("coveralls_report.json", tmp_dir)
|
|
55
58
|
File.open(coveralls_json_file.path, "wb") do |file|
|
|
56
59
|
file.puts JSON.pretty_generate(json)
|
|
57
60
|
file.close
|
data/lib/xcov/manager.rb
CHANGED
|
@@ -31,6 +31,8 @@ module Xcov
|
|
|
31
31
|
report = generate_xcov_report(json_report)
|
|
32
32
|
validate_report(report)
|
|
33
33
|
submit_to_coveralls(report)
|
|
34
|
+
tmp_dir = File.join(Xcov.config[:output_directory], 'tmp')
|
|
35
|
+
FileUtils.rm_rf(tmp_dir) if File.directory?(tmp_dir)
|
|
34
36
|
end
|
|
35
37
|
|
|
36
38
|
def parse_xccoverage
|
|
@@ -43,7 +45,7 @@ module Xcov
|
|
|
43
45
|
end
|
|
44
46
|
|
|
45
47
|
# Convert .xccoverage file to json
|
|
46
|
-
json_report = Xcov::Core::Parser.parse(xccoverage_files.first)
|
|
48
|
+
json_report = Xcov::Core::Parser.parse(xccoverage_files.first, Xcov.config[:output_directory])
|
|
47
49
|
ErrorHandler.handle_error("UnableToParseXccoverageFile") if json_report.nil?
|
|
48
50
|
|
|
49
51
|
json_report
|
data/lib/xcov/model/base.rb
CHANGED
data/lib/xcov/model/report.rb
CHANGED
|
@@ -65,7 +65,7 @@ module Xcov
|
|
|
65
65
|
targets = Report.filter_targets dictionary["targets"]
|
|
66
66
|
|
|
67
67
|
# Create target objects
|
|
68
|
-
targets = targets.map { |target| Target.map(target)}
|
|
68
|
+
targets = targets.map { |target| Target.map(target) }.sort { |lhs, rhs| lhs.name <=> rhs.name }
|
|
69
69
|
|
|
70
70
|
Report.new(targets)
|
|
71
71
|
end
|
data/lib/xcov/model/target.rb
CHANGED
data/lib/xcov/options.rb
CHANGED
data/lib/xcov/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: xcov
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Carlos Vidal
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-07-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: fastlane
|
|
@@ -114,6 +114,20 @@ dependencies:
|
|
|
114
114
|
- - ">="
|
|
115
115
|
- !ruby/object:Gem::Version
|
|
116
116
|
version: '0'
|
|
117
|
+
- !ruby/object:Gem::Dependency
|
|
118
|
+
name: byebug
|
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
|
120
|
+
requirements:
|
|
121
|
+
- - ">="
|
|
122
|
+
- !ruby/object:Gem::Version
|
|
123
|
+
version: '0'
|
|
124
|
+
type: :development
|
|
125
|
+
prerelease: false
|
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
127
|
+
requirements:
|
|
128
|
+
- - ">="
|
|
129
|
+
- !ruby/object:Gem::Version
|
|
130
|
+
version: '0'
|
|
117
131
|
description: xcov is a friendly visualizer for Xcode's code coverage files
|
|
118
132
|
email:
|
|
119
133
|
- nakioparkour@gmail.com
|