coveralls-lcov 0.0.1 → 1.0.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.
data/README.md CHANGED
@@ -25,7 +25,7 @@ In .travis.yml
25
25
  ```
26
26
  install:
27
27
  - sudo apt-get install -y lcov
28
- - sudo gem install coveralls-lcov
28
+ - gem install coveralls-lcov
29
29
  before_script:
30
30
  - ./autogen.sh
31
31
  - ./configure --enable-coverage
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["okimoto@clear-code.com"]
11
11
  spec.summary = %q{Post coverage information to coveralls.io}
12
12
  spec.description = %q{Post coverage information to coveralls.io}
13
- spec.homepage = ""
13
+ spec.homepage = "https://github.com/okkez/coveralls-lcov"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
@@ -13,6 +13,8 @@ module Coveralls
13
13
  def initialize(argv)
14
14
  @argv = argv
15
15
  @repo_token = nil
16
+ @n_times = 3
17
+ @delay = 3
16
18
  @verbose = false
17
19
  @dry_run = false
18
20
  @parser = OptionParser.new(@argv)
@@ -25,6 +27,12 @@ BANNER
25
27
  @parser.on("-t", "--repo-token=TOKEN", "Repository token") do |token|
26
28
  @repo_token = token
27
29
  end
30
+ @parser.on("--retry=N", Integer, "Retry to POST N times (default: 3)") do |n_times|
31
+ @n_times = n_times
32
+ end
33
+ @parser.on("--delay=N", Integer, "Delay in N secs when retry (default: 3)") do |delay|
34
+ @delay = delay
35
+ end
28
36
  @parser.on("-v", "--verbose", "Print payload") do
29
37
  @verbose = true
30
38
  end
@@ -47,12 +55,17 @@ BANNER
47
55
  payload_json = payload.to_json
48
56
  puts payload_json if @verbose
49
57
  unless @dry_run
50
- post(payload_json)
58
+ @n_times.times do
59
+ response = post(payload_json)
60
+ break if response.is_a?(Net::HTTPSuccess)
61
+ sleep @delay
62
+ end
51
63
  end
52
64
  end
53
65
 
54
66
  def post(payload)
55
67
  Net::HTTP.version_1_2
68
+ response = nil
56
69
 
57
70
  http = Net::HTTP.new(HOST, 443)
58
71
  http.use_ssl = true
@@ -71,6 +84,8 @@ BODY
71
84
  p response
72
85
  puts response.body
73
86
  end
87
+
88
+ response
74
89
  end
75
90
  end
76
91
  end
@@ -1,5 +1,5 @@
1
1
  module Coveralls
2
2
  module Lcov
3
- VERSION = "0.0.1"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coveralls-lcov
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 1.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-27 00:00:00.000000000 Z
12
+ date: 2014-01-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -62,7 +62,7 @@ files:
62
62
  - lib/coveralls/lcov/converter.rb
63
63
  - lib/coveralls/lcov/runner.rb
64
64
  - lib/coveralls/lcov/version.rb
65
- homepage: ''
65
+ homepage: https://github.com/okkez/coveralls-lcov
66
66
  licenses:
67
67
  - MIT
68
68
  post_install_message: