coveralls-lcov 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 38c7702f34c589dac083b4da7f4bf15391f60d14
4
+ data.tar.gz: ccfd01dbe0f076cfc5060b4905b0a4720e0a386d
5
+ SHA512:
6
+ metadata.gz: 134888022e478fc306cdd9f3728d427cc3be1e25a775feafad4ed37b1f29e79da94f9c1c43b42747e91f92e842a8845b6afee1135c07c903f6d9ca35064d1baa
7
+ data.tar.gz: 0515640aef1e6a651429a38c295bc70c6586e6f555dac949c70d427b6efdaedbc6c9bfce545f67b167483b722a98b8aae0bf2fcb4f4542a9b98f28d60640183f
@@ -2,8 +2,9 @@
2
2
  module Coveralls
3
3
  module Lcov
4
4
  class Converter
5
- def initialize(tracefile)
5
+ def initialize(tracefile, source_encoding = Encoding::UTF_8)
6
6
  @tracefile = tracefile
7
+ @source_encoding = source_encoding
7
8
  end
8
9
 
9
10
  def convert
@@ -40,7 +41,7 @@ module Coveralls
40
41
  end
41
42
 
42
43
  def generate_source_file(filename, info)
43
- source = File.read(filename)
44
+ source = File.open(filename, "r:#{@source_encoding}"){|file| file.read }.encode("UTF-8")
44
45
  lines = source.lines
45
46
  coverage = Array.new(lines.to_a.size)
46
47
  source.lines.each_with_index do |line, index|
@@ -16,6 +16,7 @@ module Coveralls
16
16
  @repo_token = nil
17
17
  @n_times = 3
18
18
  @delay = 3
19
+ @source_encoding = Encoding::UTF_8
19
20
  @verbose = false
20
21
  @dry_run = false
21
22
  @parser = OptionParser.new(@argv)
@@ -34,6 +35,10 @@ BANNER
34
35
  @parser.on("--delay=N", Integer, "Delay in N secs when retry (default: 3)") do |delay|
35
36
  @delay = delay
36
37
  end
38
+ @parser.on("--source-encoding=ENCODING",
39
+ "Source files encoding (default: UTF-8)") do |encoding|
40
+ @source_encoding = Encoding.find(encoding)
41
+ end
37
42
  @parser.on("-v", "--verbose", "Print payload") do
38
43
  @verbose = true
39
44
  end
@@ -50,7 +55,7 @@ BANNER
50
55
  exit false
51
56
  end
52
57
  tracefile = @argv.shift
53
- converter = Converter.new(tracefile)
58
+ converter = Converter.new(tracefile, @source_encoding)
54
59
  payload = converter.convert
55
60
  payload[:repo_token] = @repo_token if @repo_token
56
61
  payload_json = payload.to_json
@@ -1,5 +1,5 @@
1
1
  module Coveralls
2
2
  module Lcov
3
- VERSION = "1.0.1"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,46 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coveralls-lcov
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
5
- prerelease:
4
+ version: 1.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Kenji Okimoto
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-03-15 00:00:00.000000000 Z
11
+ date: 2014-03-21 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '1.5'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
26
  version: '1.5'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  description: Post coverage information to coveralls.io
@@ -51,7 +46,7 @@ executables:
51
46
  extensions: []
52
47
  extra_rdoc_files: []
53
48
  files:
54
- - .gitignore
49
+ - ".gitignore"
55
50
  - Gemfile
56
51
  - LICENSE.txt
57
52
  - README.md
@@ -65,26 +60,25 @@ files:
65
60
  homepage: https://github.com/okkez/coveralls-lcov
66
61
  licenses:
67
62
  - MIT
63
+ metadata: {}
68
64
  post_install_message:
69
65
  rdoc_options: []
70
66
  require_paths:
71
67
  - lib
72
68
  required_ruby_version: !ruby/object:Gem::Requirement
73
- none: false
74
69
  requirements:
75
- - - ! '>='
70
+ - - ">="
76
71
  - !ruby/object:Gem::Version
77
72
  version: '0'
78
73
  required_rubygems_version: !ruby/object:Gem::Requirement
79
- none: false
80
74
  requirements:
81
- - - ! '>='
75
+ - - ">="
82
76
  - !ruby/object:Gem::Version
83
77
  version: '0'
84
78
  requirements: []
85
79
  rubyforge_project:
86
- rubygems_version: 1.8.23
80
+ rubygems_version: 2.2.0
87
81
  signing_key:
88
- specification_version: 3
82
+ specification_version: 4
89
83
  summary: Post coverage information to coveralls.io
90
84
  test_files: []