xcov 1.2.0 → 1.3.0

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
  SHA1:
3
- metadata.gz: 370aac073a31396ddcdb03d122c2c3a790da75b8
4
- data.tar.gz: 20fdf2918d966c630f15a74a7d507f1c21514eec
3
+ metadata.gz: 0eb5cb1a9c18c7941ba1cf8f21202898a8e0c741
4
+ data.tar.gz: f6df9408fdec967b5ffe3c513648a7cdde661483
5
5
  SHA512:
6
- metadata.gz: eead7135a4b6f7750e3ae056e178e8f3e6c13f14ba48047645fc7a7e0e7a51d31843fb9bc34e20131fd402c5908507f4e24d7e13fc85208be24904fa669c9b35
7
- data.tar.gz: 2af7c8515a79c6dad885a528afa4d72f295758d111951fa3cd7936f4a5a5762ce15d8d35b5fd421d1ecd0b22b7b00fdbe299e86172d798d4fc3d434eec258873
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
- report_output = Tempfile.new("report.json")
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
- coveralls_json_file = Tempfile.new("coveralls_report.json")
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
@@ -13,7 +13,7 @@ module Xcov
13
13
  def create_displayable_coverage
14
14
  return "-" if @ignored
15
15
 
16
- "%.0f%%" % [(@coverage*100)]
16
+ "%.2f%%" % [(@coverage*100)]
17
17
  end
18
18
 
19
19
  def create_coverage_color
@@ -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
@@ -65,7 +65,6 @@ module Xcov
65
65
  executable = Target.calculate_number_of_executable_lines(non_ignored_files)
66
66
  covered = Target.calculate_number_of_covered_lines(non_ignored_files)
67
67
 
68
-
69
68
  Target.new(name, executable, covered, files)
70
69
  end
71
70
 
data/lib/xcov/options.rb CHANGED
@@ -8,7 +8,6 @@ module Xcov
8
8
  containing = FastlaneCore::Helper.fastlane_enabled? ? './fastlane' : '.'
9
9
 
10
10
  return [
11
-
12
11
  # Project options
13
12
  FastlaneCore::ConfigItem.new(
14
13
  key: :workspace,
data/lib/xcov/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Xcov
2
2
 
3
- VERSION = "1.2.0"
3
+ VERSION = "1.3.0"
4
4
  DESCRIPTION = "xcov is a friendly visualizer for Xcode's code coverage files"
5
5
 
6
6
  end
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.2.0
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-04-11 00:00:00.000000000 Z
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