webrobots 0.1.2 → 0.1.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 9c833575046c3a5436342f25caf5492296256cb8
4
- data.tar.gz: 2e3a24748d0bc3a6030033a8a6d209f59aa40c24
2
+ SHA256:
3
+ metadata.gz: 53157954049eb7dc8acdff6d7c6c8a7c60f45add22581eacf063c2dc18d11fd8
4
+ data.tar.gz: 81496d4a807cccd9fd43d87fe3e374b1e5985064612355f8ddafe9ef85ac8bdf
5
5
  SHA512:
6
- metadata.gz: 92bc8cbea288d93e02dbe9b9821c5cf47a8dea1484bd1d98094c8f45897ecdcff963393b7e555930a64701b2d01a5f850cede162951565ba077182d5646ac753
7
- data.tar.gz: 0331daacc90ffd8ad3e998c8e465fce18f71b0f15550bbe08cbd102ae89a0d799ac979e9e2383da7e8cdec3708372220bacb001c0e440b53a92068f5654d851a
6
+ metadata.gz: 96d3d17a236c342bc1e77fd458c4383ec1bb2584b0b63e968bebcb94484201e41a679f41601ddae5178f799c9c16756dff17e4fadbf6b43c66dc541f92ef22f6
7
+ data.tar.gz: 9736bc2a4c90b843c24e23c6ac71a9e98490ba39d275572d1465613565848e2b4d6a8bcb48cac1a3968ec34f57b55fa90617dd1a11969e07c38937ecc20fa878
@@ -0,0 +1,14 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: github-actions
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ day: friday
8
+ timezone: Asia/Tokyo
9
+ cooldown:
10
+ default-days: 7
11
+ groups:
12
+ github-actions:
13
+ patterns:
14
+ - "*"
@@ -0,0 +1,38 @@
1
+ # This file is machine-generated by `gh actions-lock`.
2
+ # Do not edit by hand; run `gh actions-lock` to update.
3
+ # Docs: https://gh.io/actions-lockfile
4
+ version: 'v0.0.3'
5
+ workflows:
6
+ '.github/workflows/ci.yml':
7
+ - 'actions/checkout@v7.0.1'
8
+ - 'ruby/setup-ruby@v1.338.0'
9
+ - 'rubygems/release-gem@v1.4.1'
10
+ - 'step-security/harden-runner@v2.22.4'
11
+ dependencies:
12
+ 'actions/checkout@v7.0.1':
13
+ ref: 'v7.0.1'
14
+ commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1'
15
+ owner_id: 44036562
16
+ repo_id: 197814629
17
+ 'ruby/setup-ruby@v1.338.0':
18
+ ref: 'v1.338.0'
19
+ commit: 'sha1-b3aaceaef7e0ee231b499e7b5f49c03fc1d32199'
20
+ owner_id: 210414
21
+ repo_id: 231208785
22
+ 'rubygems/configure-rubygems-credentials@dc5a8d8553e6ee01fc26761a49e99e733d17954a':
23
+ ref: 'v2.1.0'
24
+ commit: 'sha1-dc5a8d8553e6ee01fc26761a49e99e733d17954a'
25
+ owner_id: 208761
26
+ repo_id: 631633510
27
+ 'rubygems/release-gem@v1.4.1':
28
+ ref: 'v1.4.1'
29
+ commit: 'sha1-7f9650160c1a4e7989fdc9855807bdbd421d8b6b'
30
+ owner_id: 208761
31
+ repo_id: 731435765
32
+ uses:
33
+ - 'rubygems/configure-rubygems-credentials@dc5a8d8553e6ee01fc26761a49e99e733d17954a'
34
+ 'step-security/harden-runner@v2.22.4':
35
+ ref: 'v2.22.4'
36
+ commit: 'sha1-1d88384fd173af6ecb012dfd0264a306b711241a'
37
+ owner_id: 88700172
38
+ repo_id: 422287306
@@ -0,0 +1,89 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ tags: ["v*"]
7
+ pull_request:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ test:
18
+ name: Ruby ${{ matrix.ruby }}
19
+ runs-on: ubuntu-latest
20
+ timeout-minutes: 15
21
+ continue-on-error: ${{ matrix.ruby == 'ruby-head' }}
22
+ strategy:
23
+ fail-fast: false
24
+ matrix:
25
+ ruby: ["3.3", "3.4", "4.0", ruby-head]
26
+ steps:
27
+ - name: Harden runner
28
+ uses: step-security/harden-runner@v2.22.4
29
+ with:
30
+ egress-policy: audit
31
+ - uses: actions/checkout@v7.0.1
32
+ with:
33
+ persist-credentials: false
34
+ - name: Verify action dependencies
35
+ if: matrix.ruby == '4.0'
36
+ env:
37
+ GH_TOKEN: ${{ github.token }}
38
+ run: |
39
+ gh extension install github/gh-actions-lock --pin v0.4.1
40
+ gh actions-lock --verify
41
+ - uses: ruby/setup-ruby@v1.338.0
42
+ with:
43
+ ruby-version: ${{ matrix.ruby }}
44
+ bundler: latest
45
+ - run: bundle install
46
+ - run: bundle exec rake test
47
+
48
+ publish:
49
+ name: Publish gem
50
+ needs: test
51
+ if: github.repository == 'knu/webrobots' && startsWith(github.ref, 'refs/tags/v')
52
+ runs-on: ubuntu-latest
53
+ timeout-minutes: 15
54
+ environment:
55
+ name: rubygems.org
56
+ url: https://rubygems.org/gems/webrobots/versions/${{ steps.gem.outputs.version }}
57
+ permissions:
58
+ contents: write
59
+ id-token: write
60
+ steps:
61
+ - name: Harden runner
62
+ uses: step-security/harden-runner@v2.22.4
63
+ with:
64
+ egress-policy: audit
65
+ - uses: actions/checkout@v7.0.1
66
+ with:
67
+ persist-credentials: false
68
+ - uses: ruby/setup-ruby@v1.338.0
69
+ with:
70
+ ruby-version: "4.0"
71
+ bundler: latest
72
+ - run: bundle install
73
+ - name: Check release version
74
+ id: gem
75
+ env:
76
+ RELEASE_TAG: ${{ github.ref_name }}
77
+ run: |
78
+ bundle exec ruby -e '
79
+ require "webrobots/version"
80
+ version = Webrobots::VERSION
81
+ abort "tag does not match gem version" unless ENV.fetch("RELEASE_TAG") == "v#{version}"
82
+ File.open(ENV.fetch("GITHUB_OUTPUT"), "a") { |f| f.puts "version=#{version}" }
83
+ '
84
+ - name: Build gem
85
+ run: bundle exec rake build
86
+ - name: Publish to RubyGems
87
+ uses: rubygems/release-gem@v1.4.1
88
+ with:
89
+ await-release: false
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org", cooldown: 3
2
+
3
+ ruby ">= 3.3"
2
4
 
3
5
  # Specify your gem's dependencies in webrobots.gemspec
4
6
  gemspec
data/README.rdoc CHANGED
@@ -22,6 +22,8 @@ This is a library to help write robots.txt compliant web robots.
22
22
 
23
23
  - Ruby 1.8.7 or 1.9.2+
24
24
 
25
+ Development and testing require Ruby 3.3 or later.
26
+
25
27
  == Contributing to webrobots
26
28
 
27
29
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
@@ -32,6 +34,15 @@ This is a library to help write robots.txt compliant web robots.
32
34
  * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
33
35
  * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
34
36
 
37
+ == Releasing
38
+
39
+ Update the version and push the release commit to master. After CI passes,
40
+ push the matching vVERSION tag. The CI workflow tests the tag and publishes
41
+ the gem to RubyGems.org through Trusted Publishing.
42
+
43
+ The trusted publisher uses repository knu/webrobots, workflow ci.yml, and
44
+ GitHub environment rubygems.org.
45
+
35
46
  == Copyright
36
47
 
37
48
  Copyright (c) 2010-2016 Akinori MUSHA. See LICENSE.txt for
@@ -1,3 +1,3 @@
1
1
  module Webrobots
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
data/test/helper.rb CHANGED
@@ -8,7 +8,7 @@ rescue Bundler::BundlerError => e
8
8
  exit e.status_code
9
9
  end
10
10
  require 'test/unit'
11
- require 'shoulda'
11
+ require 'shoulda-context'
12
12
  require 'webmock/test_unit'
13
13
  require 'vcr'
14
14
 
@@ -1,9 +1,3 @@
1
1
  require 'simplecov'
2
- require 'coveralls'
3
-
4
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
5
- SimpleCov::Formatter::HTMLFormatter,
6
- Coveralls::SimpleCov::Formatter
7
- ])
8
2
 
9
3
  SimpleCov.start
@@ -51,57 +51,57 @@ class TestWebRobots < Test::Unit::TestCase
51
51
  end
52
52
 
53
53
  should "treat 201 as success" do
54
- stub_request(:get, @txt_uri).to_return(status: 201, body: '# Just created!')
54
+ stub_request(:get, @txt_uri).to_return(:status => 201, :body => '# Just created!')
55
55
  assert_equal '# Just created!', @robots.__send__(:http_get, @txt_uri)
56
56
  assert_requested :get, @txt_uri
57
57
  end
58
58
 
59
59
  should "treat redirects more than 5 times as full allow" do
60
60
  redirect_uri = @site_uri + '/redirect'
61
- stub_request(:get, /\A#{Regexp.quote(@site_uri.to_s)}/).to_return(status: 301, headers: { Location: redirect_uri.to_s })
61
+ stub_request(:get, /\A#{Regexp.quote(@site_uri.to_s)}/).to_return(:status => 301, :headers => { 'Location' => redirect_uri.to_s })
62
62
  assert_equal '', @robots.__send__(:http_get, @txt_uri)
63
- assert_requested :get, @txt_uri, times: 1
64
- assert_requested :get, redirect_uri, times: 4
63
+ assert_requested :get, @txt_uri, :times => 1
64
+ assert_requested :get, redirect_uri, :times => 4
65
65
  end
66
66
 
67
67
  should "treat 400 as full allow" do
68
- stub_request(:get, @txt_uri).to_return(status: 400, body: 'Bad Request!')
68
+ stub_request(:get, @txt_uri).to_return(:status => 400, :body => 'Bad Request!')
69
69
  assert_equal '', @robots.__send__(:http_get, @txt_uri)
70
70
  assert_requested :get, @txt_uri
71
71
  end
72
72
 
73
73
  should "treat 401 as full allow" do
74
- stub_request(:get, @txt_uri).to_return(status: 401, body: 'Unauthorized!')
74
+ stub_request(:get, @txt_uri).to_return(:status => 401, :body => 'Unauthorized!')
75
75
  assert_equal '', @robots.__send__(:http_get, @txt_uri)
76
76
  assert_requested :get, @txt_uri
77
77
  end
78
78
 
79
79
  should "treat 403 as full allow" do
80
- stub_request(:get, @txt_uri).to_return(status: 403, body: 'Forbidden!')
80
+ stub_request(:get, @txt_uri).to_return(:status => 403, :body => 'Forbidden!')
81
81
  assert_equal '', @robots.__send__(:http_get, @txt_uri)
82
82
  assert_requested :get, @txt_uri
83
83
  end
84
84
 
85
85
  should "treat 404 as full allow" do
86
- stub_request(:get, @txt_uri).to_return(status: 404, body: 'Not Found!')
86
+ stub_request(:get, @txt_uri).to_return(:status => 404, :body => 'Not Found!')
87
87
  assert_equal '', @robots.__send__(:http_get, @txt_uri)
88
88
  assert_requested :get, @txt_uri
89
89
  end
90
90
 
91
91
  should "treat 500 as error after retrying 5 times" do
92
- stub_request(:get, @txt_uri).to_return(status: 500, body: 'Internal Server Error!')
92
+ stub_request(:get, @txt_uri).to_return(:status => 500, :body => 'Internal Server Error!')
93
93
  assert_raise {
94
94
  @robots.__send__(:http_get, @txt_uri)
95
95
  }
96
- assert_requested :get, @txt_uri, times: 5
96
+ assert_requested :get, @txt_uri, :times => 5
97
97
  end
98
98
 
99
99
  should "treat 503 as error after retrying 5 times" do
100
- stub_request(:get, @txt_uri).to_return(status: 503, body: 'Service Unavailable!')
100
+ stub_request(:get, @txt_uri).to_return(:status => 503, :body => 'Service Unavailable!')
101
101
  assert_raise {
102
102
  @robots.__send__(:http_get, @txt_uri)
103
103
  }
104
- assert_requested :get, @txt_uri, times: 5
104
+ assert_requested :get, @txt_uri, :times => 5
105
105
  end
106
106
  end
107
107
 
data/webrobots.gemspec CHANGED
@@ -30,17 +30,11 @@ This library helps write robots.txt compliant web robots in Ruby.
30
30
  s.add_development_dependency("rake", [">= 0.9.2.2"])
31
31
  s.add_development_dependency("racc", [">= 0"]) unless RUBY_PLATFORM == "java"
32
32
  s.add_development_dependency("test-unit")
33
- s.add_development_dependency("shoulda", [RUBY_VERSION < "1.9" ? "< 3.5.0" : ">= 0"])
33
+ s.add_development_dependency("shoulda-context", [">= 2.0"])
34
34
  s.add_development_dependency("webmock")
35
35
  s.add_development_dependency("vcr")
36
- if RUBY_VERSION < "1.9"
37
- # Cap dependency on activesupport with < 4.0 on behalf of
38
- # shoulda-matchers to satisfy bundler.
39
- s.add_development_dependency("activesupport", ["< 4.0"])
40
- end
41
36
  s.add_development_dependency("rdoc", ["> 2.4.2"])
42
- s.add_development_dependency("bundler", ["~> 1.2", ">= 1.2"])
43
- s.add_development_dependency("nokogiri", ">= 1.4.7", [RUBY_VERSION < "1.9" ? "< 1.6.0" : "~> 1.4"])
37
+ s.add_development_dependency("bundler", [">= 4.0.18"])
38
+ s.add_development_dependency("nokogiri", ["~> 1.4", ">= 1.4.7"])
44
39
  s.add_development_dependency("simplecov", [">= 0"]) unless RUBY_VERSION < "1.9"
45
- s.add_development_dependency("coveralls", [">= 0"]) unless RUBY_VERSION < "1.9"
46
40
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webrobots
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akinori MUSHA
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2016-01-04 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rake
@@ -53,19 +52,19 @@ dependencies:
53
52
  - !ruby/object:Gem::Version
54
53
  version: '0'
55
54
  - !ruby/object:Gem::Dependency
56
- name: shoulda
55
+ name: shoulda-context
57
56
  requirement: !ruby/object:Gem::Requirement
58
57
  requirements:
59
58
  - - ">="
60
59
  - !ruby/object:Gem::Version
61
- version: '0'
60
+ version: '2.0'
62
61
  type: :development
63
62
  prerelease: false
64
63
  version_requirements: !ruby/object:Gem::Requirement
65
64
  requirements:
66
65
  - - ">="
67
66
  - !ruby/object:Gem::Version
68
- version: '0'
67
+ version: '2.0'
69
68
  - !ruby/object:Gem::Dependency
70
69
  name: webmock
71
70
  requirement: !ruby/object:Gem::Requirement
@@ -112,58 +111,38 @@ dependencies:
112
111
  name: bundler
113
112
  requirement: !ruby/object:Gem::Requirement
114
113
  requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '1.2'
118
114
  - - ">="
119
115
  - !ruby/object:Gem::Version
120
- version: '1.2'
116
+ version: 4.0.18
121
117
  type: :development
122
118
  prerelease: false
123
119
  version_requirements: !ruby/object:Gem::Requirement
124
120
  requirements:
125
- - - "~>"
126
- - !ruby/object:Gem::Version
127
- version: '1.2'
128
121
  - - ">="
129
122
  - !ruby/object:Gem::Version
130
- version: '1.2'
123
+ version: 4.0.18
131
124
  - !ruby/object:Gem::Dependency
132
125
  name: nokogiri
133
126
  requirement: !ruby/object:Gem::Requirement
134
127
  requirements:
135
- - - ">="
136
- - !ruby/object:Gem::Version
137
- version: 1.4.7
138
128
  - - "~>"
139
129
  - !ruby/object:Gem::Version
140
130
  version: '1.4'
141
- type: :development
142
- prerelease: false
143
- version_requirements: !ruby/object:Gem::Requirement
144
- requirements:
145
131
  - - ">="
146
132
  - !ruby/object:Gem::Version
147
133
  version: 1.4.7
148
- - - "~>"
149
- - !ruby/object:Gem::Version
150
- version: '1.4'
151
- - !ruby/object:Gem::Dependency
152
- name: simplecov
153
- requirement: !ruby/object:Gem::Requirement
154
- requirements:
155
- - - ">="
156
- - !ruby/object:Gem::Version
157
- version: '0'
158
134
  type: :development
159
135
  prerelease: false
160
136
  version_requirements: !ruby/object:Gem::Requirement
161
137
  requirements:
138
+ - - "~>"
139
+ - !ruby/object:Gem::Version
140
+ version: '1.4'
162
141
  - - ">="
163
142
  - !ruby/object:Gem::Version
164
- version: '0'
143
+ version: 1.4.7
165
144
  - !ruby/object:Gem::Dependency
166
- name: coveralls
145
+ name: simplecov
167
146
  requirement: !ruby/object:Gem::Requirement
168
147
  requirements:
169
148
  - - ">="
@@ -176,8 +155,9 @@ dependencies:
176
155
  - - ">="
177
156
  - !ruby/object:Gem::Version
178
157
  version: '0'
179
- description: |
180
- This library helps write robots.txt compliant web robots in Ruby.
158
+ description: 'This library helps write robots.txt compliant web robots in Ruby.
159
+
160
+ '
181
161
  email:
182
162
  - knu@idaemons.org
183
163
  executables: []
@@ -187,8 +167,10 @@ extra_rdoc_files:
187
167
  - README.rdoc
188
168
  files:
189
169
  - ".document"
170
+ - ".github/dependabot.yml"
171
+ - ".github/workflows/actions.lock"
172
+ - ".github/workflows/ci.yml"
190
173
  - ".gitignore"
191
- - ".travis.yml"
192
174
  - Gemfile
193
175
  - LICENSE.txt
194
176
  - README.rdoc
@@ -207,7 +189,6 @@ homepage: https://github.com/knu/webrobots
207
189
  licenses:
208
190
  - 2-clause BSDL
209
191
  metadata: {}
210
- post_install_message:
211
192
  rdoc_options:
212
193
  - "--exclude"
213
194
  - "\\.ry$"
@@ -224,11 +205,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
205
  - !ruby/object:Gem::Version
225
206
  version: '0'
226
207
  requirements: []
227
- rubyforge_project:
228
- rubygems_version: 2.4.6
229
- signing_key:
208
+ rubygems_version: 4.0.20
230
209
  specification_version: 4
231
210
  summary: A Ruby library to help write robots.txt compliant web robots
232
211
  test_files:
233
212
  - test/test_webrobots.rb
234
- has_rdoc:
data/.travis.yml DELETED
@@ -1,17 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 1.8.7
4
- - ree
5
- - 1.9.3
6
- - 2.0.0
7
- - ruby-head
8
- - jruby-18mode
9
- - jruby-19mode
10
- - jruby-head
11
- - rbx-18mode
12
- - rbx-19mode
13
- matrix:
14
- allow_failures:
15
- - rvm: ruby-head
16
- - rvm: rbx-18mode
17
- - rvm: rbx-19mode