twitter_retry 0.2.0 → 0.2.1

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
- SHA1:
3
- metadata.gz: ff0eab75ac0dbd4ea33d5f2eb2840ef01e617b6f
4
- data.tar.gz: 2c3dab70979cb3fecb5a4d81360b925ccf532efd
2
+ SHA256:
3
+ metadata.gz: 02f726d4104ff2c4421d2b8b1b5e572b33e5e05db41671765cf865227325b99c
4
+ data.tar.gz: 118e16092009ce4a6a0eb7d53f038147f89e7851ee2e5e2a669103127b52b22d
5
5
  SHA512:
6
- metadata.gz: 53971d3ac57744fbc9ccaadae99a6ed109ed6ce1ce2317a317cbc734c8855003520af22bee0010a4f8e6203e948daecef4c311a7623a80bdd94652a42f54ae92
7
- data.tar.gz: 3ee9a129f5c78ed08b0b6dca148ffb6dea9b7093c2eb34dd0840fd60a523aea50bc56b12ea0baed74cc0c093703a5efc4bf734ce81ac234abf572088f43d50bc
6
+ metadata.gz: 9e5c6b9327a0c5339d0c12397199df9d3297d8993a0702aeab8e4d30ec139ad7ddbf1b9002b10dbb0f391d2fb180a11ac116efc942af414f1ec657a4f0dc4944
7
+ data.tar.gz: 1d34a34c3b67f339839f48ea246ccaeae9ba8a8dcf179b0e3287ee8dc702c21c4f5b0c74aae1c5b39937e009068fdd02ad219893b27b4a052bc6df1655ec7a85
@@ -0,0 +1,95 @@
1
+ name: test
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ types:
9
+ - opened
10
+ - synchronize
11
+ - reopened
12
+ schedule:
13
+ - cron: "0 10 * * 5" # JST 19:00 (Fri)
14
+
15
+ env:
16
+ CI: "true"
17
+
18
+ jobs:
19
+ test:
20
+ runs-on: ubuntu-latest
21
+
22
+ container: ${{ matrix.ruby }}
23
+
24
+ strategy:
25
+ fail-fast: false
26
+
27
+ matrix:
28
+ ruby:
29
+ - ruby:2.2
30
+ - ruby:2.3
31
+ - ruby:2.4
32
+ - ruby:2.5
33
+ - ruby:2.6
34
+ - ruby:2.7
35
+ - ruby:3.0
36
+ - rubylang/ruby:master-nightly-bionic
37
+ include:
38
+ - ruby: rubylang/ruby:master-nightly-bionic
39
+ allow_failures: "true"
40
+
41
+ steps:
42
+ - uses: actions/checkout@v2
43
+
44
+
45
+ - name: Cache vendor/bundle
46
+ uses: actions/cache@v1
47
+ id: cache_gem
48
+ with:
49
+ path: vendor/bundle
50
+ key: v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ github.sha }}
51
+ restore-keys: |
52
+ v1-gem-${{ runner.os }}-${{ matrix.ruby }}-
53
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
54
+
55
+ - name: bundle update
56
+ run: |
57
+ set -xe
58
+ bundle config path vendor/bundle
59
+ bundle update --jobs $(nproc) --retry 3
60
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
61
+
62
+ - name: Run test
63
+ run: |
64
+ set -xe
65
+ bundle exec rspec
66
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
67
+
68
+ - name: Slack Notification (not success)
69
+ uses: lazy-actions/slatify@master
70
+ if: "! success()"
71
+ continue-on-error: true
72
+ with:
73
+ job_name: ${{ format('*build* ({0})', matrix.ruby) }}
74
+ type: ${{ job.status }}
75
+ icon_emoji: ":octocat:"
76
+ url: ${{ secrets.SLACK_WEBHOOK }}
77
+ token: ${{ secrets.GITHUB_TOKEN }}
78
+
79
+ notify:
80
+ needs:
81
+ - test
82
+
83
+ runs-on: ubuntu-latest
84
+
85
+ steps:
86
+ - name: Slack Notification (success)
87
+ uses: lazy-actions/slatify@master
88
+ if: always()
89
+ continue-on-error: true
90
+ with:
91
+ job_name: '*build*'
92
+ type: ${{ job.status }}
93
+ icon_emoji: ":octocat:"
94
+ url: ${{ secrets.SLACK_WEBHOOK }}
95
+ token: ${{ secrets.GITHUB_TOKEN }}
@@ -1,5 +1,11 @@
1
1
  ## Unreleased
2
- [full changelog](https://github.com/sue445/twitter_retry/compare/v0.2.0...master)
2
+ [full changelog](https://github.com/sue445/twitter_retry/compare/v0.2.1...master)
3
+
4
+ ## v0.2.1
5
+ [full changelog](https://github.com/sue445/twitter_retry/compare/v0.2.0...v0.2.1)
6
+
7
+ * Remove activesupport from dependency
8
+ * https://github.com/sue445/twitter_retry/pull/30
3
9
 
4
10
  ## v0.2.0
5
11
  [full changelog](https://github.com/sue445/twitter_retry/compare/v0.1.0...v0.2.0)
data/Gemfile CHANGED
@@ -7,3 +7,8 @@ if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.2.2")
7
7
  # NOTE: activesupport 5.x supports only ruby 2.2.2+
8
8
  gem "activesupport", "< 5.0.0"
9
9
  end
10
+
11
+ if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.5.0")
12
+ # NOTE: unparser v0.3.0+ requires Ruby 2.5+
13
+ gem "unparser", "< 0.3.0"
14
+ end
data/README.md CHANGED
@@ -3,10 +3,9 @@
3
3
  Twitter api awesome handling with retry
4
4
 
5
5
  [![Gem Version](https://badge.fury.io/rb/twitter_retry.svg)](http://badge.fury.io/rb/twitter_retry)
6
- [![Build Status](https://travis-ci.org/sue445/twitter_retry.svg?branch=master)](https://travis-ci.org/sue445/twitter_retry)
6
+ [![Build Status](https://github.com/sue445/twitter_retry/workflows/test/badge.svg?branch=master)](https://github.com/sue445/twitter_retry/actions?query=workflow%3Atest)
7
7
  [![Code Climate](https://codeclimate.com/github/sue445/twitter_retry/badges/gpa.svg)](https://codeclimate.com/github/sue445/twitter_retry)
8
8
  [![Coverage Status](https://coveralls.io/repos/sue445/twitter_retry/badge.svg?branch=master&service=github)](https://coveralls.io/github/sue445/twitter_retry?branch=master)
9
- [![Dependency Status](https://gemnasium.com/sue445/twitter_retry.svg)](https://gemnasium.com/sue445/twitter_retry)
10
9
 
11
10
  ## Requirements
12
11
  * Ruby 2.1+
@@ -6,10 +6,12 @@ require "twitter_retry/retryable"
6
6
  module TwitterRetry
7
7
  extend Retryable
8
8
 
9
+ # @return [TwitterRetry::Config]
9
10
  def self.config
10
11
  @config ||= Config.new
11
12
  end
12
13
 
14
+ # @yieldparam [TwitterRetry::Config]
13
15
  def self.configure
14
16
  yield config if block_given?
15
17
  end
@@ -1,6 +1,4 @@
1
1
  module TwitterRetry
2
- require "active_support/configurable"
3
-
4
2
  DEFAULT_RETRYABLE_ERRORS = [
5
3
  [Twitter::Error::ServiceUnavailable, "Over capacity"],
6
4
  [Twitter::Error::InternalServerError, "Internal error"],
@@ -14,16 +12,27 @@ module TwitterRetry
14
12
  ]
15
13
 
16
14
  class Config
17
- include ActiveSupport::Configurable
15
+ # @!attribute max_retry_count
16
+ # @return [Integer]
17
+ attr_accessor :max_retry_count
18
+
19
+ # @!attribute sleep_second
20
+ # @return [Integer]
21
+ attr_accessor :sleep_second
22
+
23
+ # @!attribute retryable_errors
24
+ # @return [Array<String>]
25
+ attr_accessor :retryable_errors
18
26
 
19
- config_accessor :max_retry_count, :sleep_second
20
- config_accessor :retryable_errors, :ignorable_errors
27
+ # @!attribute ignorable_errors
28
+ # @return [Array<String>]
29
+ attr_accessor :ignorable_errors
21
30
 
22
- configure do |config|
23
- config.max_retry_count = 3
24
- config.sleep_second = 1
25
- config.retryable_errors = DEFAULT_RETRYABLE_ERRORS
26
- config.ignorable_errors = DEFAULT_IGNORABLE_ERRORS
31
+ def initialize
32
+ @max_retry_count = 3
33
+ @sleep_second = 1
34
+ @retryable_errors = DEFAULT_RETRYABLE_ERRORS
35
+ @ignorable_errors = DEFAULT_IGNORABLE_ERRORS
27
36
  end
28
37
  end
29
38
  end
@@ -1,3 +1,3 @@
1
1
  module TwitterRetry
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -19,13 +19,14 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_dependency "activesupport"
23
22
  spec.add_dependency "twitter"
24
23
 
25
- spec.add_development_dependency "bundler", "~> 1.10"
24
+ spec.add_development_dependency "bundler", ">= 1.10"
26
25
  spec.add_development_dependency "coveralls"
27
- spec.add_development_dependency "rake", "~> 10.0"
26
+ spec.add_development_dependency "rake", ">= 10.0"
28
27
  spec.add_development_dependency "rspec"
28
+ spec.add_development_dependency "rspec-its"
29
29
  spec.add_development_dependency "rspec-parameterized"
30
+ spec.add_development_dependency "unparser", ">= 0.4.5"
30
31
  spec.add_development_dependency "yard"
31
32
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter_retry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-07 00:00:00.000000000 Z
11
+ date: 2021-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: activesupport
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: twitter
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -42,14 +28,14 @@ dependencies:
42
28
  name: bundler
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
- - - "~>"
31
+ - - ">="
46
32
  - !ruby/object:Gem::Version
47
33
  version: '1.10'
48
34
  type: :development
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
- - - "~>"
38
+ - - ">="
53
39
  - !ruby/object:Gem::Version
54
40
  version: '1.10'
55
41
  - !ruby/object:Gem::Dependency
@@ -70,14 +56,14 @@ dependencies:
70
56
  name: rake
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
- - - "~>"
59
+ - - ">="
74
60
  - !ruby/object:Gem::Version
75
61
  version: '10.0'
76
62
  type: :development
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
- - - "~>"
66
+ - - ">="
81
67
  - !ruby/object:Gem::Version
82
68
  version: '10.0'
83
69
  - !ruby/object:Gem::Dependency
@@ -94,6 +80,20 @@ dependencies:
94
80
  - - ">="
95
81
  - !ruby/object:Gem::Version
96
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec-its
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rspec-parameterized
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: unparser
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: 0.4.5
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: 0.4.5
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: yard
113
127
  requirement: !ruby/object:Gem::Requirement
@@ -130,9 +144,9 @@ extensions: []
130
144
  extra_rdoc_files: []
131
145
  files:
132
146
  - ".coveralls.yml"
147
+ - ".github/workflows/test.yml"
133
148
  - ".gitignore"
134
149
  - ".rspec"
135
- - ".travis.yml"
136
150
  - ".yardopts"
137
151
  - CHANGELOG.md
138
152
  - Gemfile
@@ -150,7 +164,7 @@ homepage: https://github.com/sue445/twitter_retry
150
164
  licenses:
151
165
  - MIT
152
166
  metadata: {}
153
- post_install_message:
167
+ post_install_message:
154
168
  rdoc_options: []
155
169
  require_paths:
156
170
  - lib
@@ -165,9 +179,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
179
  - !ruby/object:Gem::Version
166
180
  version: '0'
167
181
  requirements: []
168
- rubyforge_project:
169
- rubygems_version: 2.6.11
170
- signing_key:
182
+ rubygems_version: 3.2.3
183
+ signing_key:
171
184
  specification_version: 4
172
185
  summary: Twitter api awesome handling with retry
173
186
  test_files: []
@@ -1,22 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.1
4
- - 2.2
5
- - 2.3.3
6
- - 2.4.0
7
- - ruby-head
8
- before_install: gem install bundler -v 1.10.5
9
- before_script:
10
- - export CI=true
11
- script: bundle exec rspec
12
- branches:
13
- only:
14
- - master
15
- notifications:
16
- slack:
17
- secure: auD2UNPVzPfJ9jKMQ89sK6aXYv5ekXSsuuqn8aiZ2+w96lb/B/lRVzOPgzmDe1/qIvYevYO3AcfgG373ARV0Ft/SEzlwiIOAhu47nyprM641AFiGQovCNe+vpWo6k3YD+J+WNG8NiD+6vDfmkmBSnE6/+VL5HUiVtW8FeFQ0lRBgcu789MWyXkZVtzvWvMTlPk3N94JgARUcT4F2bukTu1Ff95D4fZfnArJLfpv9uzxuCYUB9Ut33OdXb8k9xG+0OJeosV7oTYLKY3I+oK8mkweIzzy9flhpmLw6xCzARX2zQcsoEXeiDoUVKmldTLApBQMF96xCG6yxn1SaapsqKovVbudBuafjhpJklb1zG21UmYuNr7SmZqrLYcBb2sMLD41wyeBfJ/mO7SNWZlwJAvMrL5O538qpMfvbT3EQWGWdWnhYR79nKO5zLDqgUeJC847/QiS43MvnPlwObpO68bXdRq+C4Z6DfL96tjGfFprijKHJtZqG1kFHMELrDx6lzUi03Kt5FaHV2czz/5B7oqPsXvTWWa0yaLopxuSZqcD2zrSaso8bNFFqkt2X4CKTx2Jqq4IuGrrzqqr1NMSX2tbT06tJAKYCUQfa5mJqs2uRtzYR3jivukb+EwNOCFThrRBi69AYa2XAKjzCJ7DoFn3uQvXlmCu/3bbPQTs0LT4=
18
- matrix:
19
- allow_failures:
20
- - rvm: ruby-head
21
- sudo: false
22
- cache: bundler