attempt 0.2.1 → 0.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: f0a8fa37fd280121c41746a996a7cb580aa445e6
4
- data.tar.gz: 6bf3f7d60a87a1776fc94f862813f64c6a975960
3
+ metadata.gz: 5dd75bdd6f69b8859f13e74beeeb881457369934
4
+ data.tar.gz: 3796124b03b73321a74c88e1042f7608caed95ca
5
5
  SHA512:
6
- metadata.gz: 7363a53147eaa6d0369e2665dd669cf39b28649bc16f89f64144de4a0e8f5d3fe5424b57b6d415dfb3d4a26647fc2bcf8e2e7c5b0f961101ebc44fa1884c4796
7
- data.tar.gz: 3472ef9f158ffb6ef130c1300bbafd6df46b09cc993b9f7c8d9fd81ef6d9fce100fa314be466128cf7348a46afa47542cfb6838e9a938e8642cbde77254b9956
6
+ metadata.gz: fa3275bbd299112fa5c9b56d19528ea7ecd4bcafae071a267c04b682b45f9c0c6d74c4e2da171c02bca45e48346b97110e413028f69a2d45d174c67625206604
7
+ data.tar.gz: a8fbd29c2b48d14c112d20d1d9fd87fac16251dc715ff65bac1cb687fdd26f470f575fb01286ffe728c3850b76a71cd736b05c8031051c844519edba3a1b64dc
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGES CHANGED
@@ -1,3 +1,9 @@
1
+ == 0.3.0 - 27-Mar-2017
2
+ * The structured_warnings gem requirement was updated to 0.3.0 or later. This
3
+ is necessary if you are using Ruby 2.4 or later.
4
+ * The VERSION string is now frozen.
5
+ * Updated the certs file.
6
+
1
7
  == 0.2.1 - 13-Dec-2015
2
8
  * This gem is now signed.
3
9
  * Updates to the Rakefile and gemspec.
data/README CHANGED
@@ -39,6 +39,9 @@
39
39
  Also, this library uses the timeout library internally, which has some
40
40
  known issues. See Future Plans, below.
41
41
 
42
+ As of version 0.3.0, this library requires structured_warnings 0.3.0 or
43
+ later. This is necessary because of changes in Ruby 2.4.
44
+
42
45
  == Future Plans
43
46
  Add the ability to set an absolute maximum number of seconds to prevent
44
47
  nested sleep/retry from delaying attempts longer than expected.
@@ -57,7 +60,7 @@
57
60
  Artistic 2.0
58
61
 
59
62
  == Copyright
60
- (C) 2006-2015, Daniel J. Berger
63
+ (C) 2006-2017, Daniel J. Berger
61
64
  All Rights Reserved
62
65
 
63
66
  == Author
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'attempt'
5
- spec.version = '0.2.1'
5
+ spec.version = '0.3.0'
6
6
  spec.author = 'Daniel J. Berger'
7
7
  spec.license = 'Artistic 2.0'
8
8
  spec.email = 'djberg96@gmail.com'
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
 
15
15
  spec.extra_rdoc_files = ['README','CHANGES','MANIFEST']
16
16
 
17
- spec.add_dependency('structured_warnings')
17
+ spec.add_dependency('structured_warnings', '~> 0.3.0')
18
18
  spec.add_development_dependency('test-unit')
19
19
 
20
20
  spec.description = <<-EOF
@@ -1,21 +1,21 @@
1
1
  -----BEGIN CERTIFICATE-----
2
2
  MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAhkamJl
3
3
  cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
4
- MB4XDTE1MDkwMjIwNDkxOFoXDTE2MDkwMTIwNDkxOFowPzERMA8GA1UEAwwIZGpi
4
+ MB4XDTE2MDkxOTAzNDY0NVoXDTE3MDkxOTAzNDY0NVowPzERMA8GA1UEAwwIZGpi
5
5
  ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
6
- bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMyTkvXqRp6hLs9eoJOS
7
- Hmi8kRYbq9Vkf15/hMxJpotYMgJVHHWrmDcC5Dye2PbnXjTkKf266Zw0PtT9h+lI
8
- S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GDVP1BNGFC+yXcb7u2GlK+nEMCORqzURbYPf7
16
- tL+/hzmePIRz7i30UM//64GI1NLv9jl7nIwjhPpXpf7/lu2I9hOTsvwSumb5UiKC
17
- /sqBxI3sfj9pr79Wpv4MuikX1XPik7Ncb7NPsJPw06Lvyc3Hkg5X2XpPtLtS+Gr2
18
- wKJnmzb5rIPS1cmsqv0M9LPWflzfwoZ/SpnmhagP+g05p8bRNKjZSA2iImM/GyYZ
19
- EJYzxdPOrx2n6NYR3Hk+vHP0U7UBSveI6+qx+ndQYaeyCn+GRX2PKS9h66YF/Q1V
20
- tGSHgAmcLlkdGgan182qsE/4kKM=
15
+ ggEBAIJWpqQOUMoYhpm0wJ4kfiYv9rZVbpZ3L2cFYt4O6+wgbpdWP8DBBgZfCSQW
16
+ 1J9miChMKdxZ8eOoeId79IMXN3IAcnalTFvD0Rp9ltaFZTXBfXMFqxQN3fHsIVwz
17
+ as/JSbwXo/PE8rULhjU+Utwcmji38cKEDWLAW4vsCBmwvBTwmAmcuHHKjnNvd8aR
18
+ YMrq9v505w8IjSysIO3KKysxCFuzoIPIYMdYswquvmtuTA+lpB9btWHr8n2FFsDp
19
+ A943I/wqE6xbYQpHxkndWo5uLDUbZh+XxG+fhZKpeqLIqHaFuU6wdO5odt32kB/B
20
+ nCjVswaVYlu1U2iLPCqE+MrjmTA=
21
21
  -----END CERTIFICATE-----
@@ -6,20 +6,20 @@ require 'structured_warnings'
6
6
  class Attempt
7
7
 
8
8
  # The version of the attempt library.
9
- VERSION = '0.2.1'
9
+ VERSION = '0.3.0'.freeze
10
10
 
11
11
  # Warning raised if an attempt fails before the maximum number of tries
12
12
  # has been reached.
13
- class Warning < StandardWarning; end
13
+ class Warning < StructuredWarnings::StandardWarning; end
14
14
 
15
- # Number of attempts to make before failing. The default is 3.
15
+ # Number of attempts to make before failing. The default is 3.
16
16
  attr_accessor :tries
17
17
 
18
- # Number of seconds to wait between attempts. The default is 60.
18
+ # Number of seconds to wait between attempts. The default is 60.
19
19
  attr_accessor :interval
20
20
 
21
21
  # A boolean value that determines whether errors that would have been
22
- # raised should be sent to STDERR as warnings. The default is true.
22
+ # raised should be sent to STDERR as warnings. The default is true.
23
23
  attr_accessor :warnings
24
24
 
25
25
  # If you provide an IO handle to this option then errors that would
@@ -50,10 +50,10 @@ class Attempt
50
50
  @increment = nil # Should be an int, if provided
51
51
  @timeout = nil # Wrap the code in a timeout block if provided
52
52
  @level = Exception # Level of exception to be caught
53
- @warnings = true # Errors sent to STDERR as warnings if true
53
+ @warnings = true # Errors are sent to STDERR as warnings if true
54
54
 
55
55
  yield self if block_given?
56
- end
56
+ end
57
57
 
58
58
  # Attempt to perform the operation in the provided block up to +tries+
59
59
  # times, sleeping +interval+ between each try.
@@ -112,9 +112,9 @@ module Kernel
112
112
  def attempt(tries = 3, interval = 60, timeout = nil, &block)
113
113
  raise 'no block given' unless block_given?
114
114
  Attempt.new{ |a|
115
- a.tries = tries
116
- a.interval = interval
117
- a.timeout = timeout if timeout
115
+ a.tries = tries
116
+ a.interval = interval
117
+ a.timeout = timeout if timeout
118
118
  }.attempt(&block)
119
119
  end
120
120
  end
@@ -23,7 +23,7 @@ class TC_Attempt < Test::Unit::TestCase
23
23
  end
24
24
 
25
25
  test "version constant is set to expected value" do
26
- assert_equal('0.2.1', Attempt::VERSION)
26
+ assert_equal('0.3.0', Attempt::VERSION)
27
27
  end
28
28
 
29
29
  test "attempt works as expected without arguments" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attempt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
@@ -12,40 +12,40 @@ cert_chain:
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAhkamJl
14
14
  cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtY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
31
+ nCjVswaVYlu1U2iLPCqE+MrjmTA=
32
32
  -----END CERTIFICATE-----
33
- date: 2015-12-13 00:00:00.000000000 Z
33
+ date: 2017-03-27 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: structured_warnings
37
37
  requirement: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ">="
39
+ - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '0'
41
+ version: 0.3.0
42
42
  type: :runtime
43
43
  prerelease: false
44
44
  version_requirements: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ">="
46
+ - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '0'
48
+ version: 0.3.0
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: test-unit
51
51
  requirement: !ruby/object:Gem::Requirement
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  version: '0'
106
106
  requirements: []
107
107
  rubyforge_project:
108
- rubygems_version: 2.5.1
108
+ rubygems_version: 2.6.11
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: A thin wrapper for begin + rescue + sleep + retry
metadata.gz.sig CHANGED
Binary file