itest5ch 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +19 -21
- data/.rubocop.yml +5 -0
- data/CHANGELOG.md +7 -1
- data/Gemfile +0 -4
- data/README.md +1 -1
- data/bin/console +2 -2
- data/itest5ch.gemspec +5 -5
- data/lib/itest5ch/board_list_page.rb +11 -11
- data/lib/itest5ch/http_methods.rb +1 -1
- data/lib/itest5ch/thread.rb +43 -43
- data/lib/itest5ch/version.rb +1 -1
- metadata +30 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f251ffea58aa4e5c48a3cbd23bee8ad24606c35b2a16b54cd222eb9b316f8c46
|
4
|
+
data.tar.gz: 96dca691f9944e501d58d3778b74d71e206a9084703a53afcafdab42e12d298e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5de1b52879f6e4e7aa7b51eedf5965d44f86e9b3ba15b34ac0330725809f107063c12a36725d7abd4e5c82efec3d4996137d032eb5c90f8bfe7fad1d4d5d75c0
|
7
|
+
data.tar.gz: 44ed76e9b5db2382e6d72d755c6e21c9125408cebc42cc48a9415aeefd1a8da5ec5db61c43b96b711be4c906b271f27e89b32ec87096563194d572a3f94d91ce
|
data/.circleci/config.yml
CHANGED
@@ -6,7 +6,7 @@ version: 2.1
|
|
6
6
|
|
7
7
|
orbs:
|
8
8
|
codeclimate: sue445/codeclimate@volatile
|
9
|
-
|
9
|
+
slack: circleci/slack@3
|
10
10
|
|
11
11
|
executors:
|
12
12
|
ruby:
|
@@ -27,6 +27,12 @@ executors:
|
|
27
27
|
CC_TEST_REPORTER_ID: d91e7c9665019f1574eb4c5a3de1547c80bc3062e3c297282f106501a3c5c694
|
28
28
|
working_directory: ~/app
|
29
29
|
|
30
|
+
commands:
|
31
|
+
bundle_install:
|
32
|
+
steps:
|
33
|
+
- run: bundle config --local path vendor/bundle
|
34
|
+
- run: bundle install --jobs=4 --retry=3
|
35
|
+
|
30
36
|
jobs:
|
31
37
|
rspec:
|
32
38
|
parameters:
|
@@ -40,15 +46,12 @@ jobs:
|
|
40
46
|
- run: ruby --version
|
41
47
|
- run: bundle --version
|
42
48
|
- run: gem --version
|
43
|
-
-
|
44
|
-
cache_key_prefix: "v2-rspec"
|
45
|
-
with_gemfile_lock: false
|
46
|
-
gemspec_name: "itest5ch"
|
47
|
-
update_always: true
|
49
|
+
- bundle_install
|
48
50
|
- codeclimate/with-cc-test-reporter:
|
49
51
|
after_build_args: "--coverage-input-type simplecov"
|
50
52
|
steps:
|
51
53
|
- run: bundle exec rspec
|
54
|
+
- slack/notify-on-failure
|
52
55
|
|
53
56
|
rubocop:
|
54
57
|
executor:
|
@@ -56,24 +59,19 @@ jobs:
|
|
56
59
|
|
57
60
|
steps:
|
58
61
|
- checkout
|
59
|
-
-
|
60
|
-
cache_key_prefix: "v2-rubocop"
|
61
|
-
with_gemfile_lock: false
|
62
|
-
gemspec_name: "itest5ch"
|
63
|
-
update_always: true
|
64
|
-
|
62
|
+
- bundle_install
|
65
63
|
- run: bundle exec rubocop
|
64
|
+
- slack/notify-on-failure
|
66
65
|
|
67
66
|
build_jobs: &build_jobs
|
68
67
|
- rspec:
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
version: "2.7"
|
68
|
+
matrix:
|
69
|
+
parameters:
|
70
|
+
version:
|
71
|
+
- "2.5"
|
72
|
+
- "2.6"
|
73
|
+
- "2.7"
|
74
|
+
- "3.0"
|
77
75
|
- rubocop
|
78
76
|
|
79
77
|
workflows:
|
@@ -85,7 +83,7 @@ workflows:
|
|
85
83
|
weekly_build:
|
86
84
|
triggers:
|
87
85
|
- schedule:
|
88
|
-
cron: "00
|
86
|
+
cron: "00 10 * * 5" # JST 19:00 (Fri)
|
89
87
|
filters:
|
90
88
|
branches:
|
91
89
|
only: master
|
data/.rubocop.yml
CHANGED
@@ -7,6 +7,8 @@ AllCops:
|
|
7
7
|
TargetRubyVersion: 2.5
|
8
8
|
# uncomment if use rails cops
|
9
9
|
# TargetRailsVersion: 5.1
|
10
|
+
NewCops: enable
|
11
|
+
SuggestExtensions: false
|
10
12
|
|
11
13
|
require:
|
12
14
|
- rubocop-performance
|
@@ -18,3 +20,6 @@ Layout/HashAlignment:
|
|
18
20
|
RSpec/FilePath:
|
19
21
|
Exclude:
|
20
22
|
- spec/integration_spec.rb
|
23
|
+
|
24
|
+
RSpec/MultipleMemoizedHelpers:
|
25
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
## master
|
2
|
-
[full changelog](http://github.com/sue445/itest5ch/compare/v2.0.
|
2
|
+
[full changelog](http://github.com/sue445/itest5ch/compare/v2.0.1...master)
|
3
|
+
|
4
|
+
## v2.0.1
|
5
|
+
[full changelog](http://github.com/sue445/itest5ch/compare/v2.0.0...v2.0.1)
|
6
|
+
|
7
|
+
* Upgrade rubocop gems
|
8
|
+
* https://github.com/sue445/itest5ch/pull/79
|
3
9
|
|
4
10
|
## v2.0.0
|
5
11
|
[full changelog](http://github.com/sue445/itest5ch/compare/v1.0.0...v2.0.0)
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
5ch (a.k.a. 2ch) reader via http://itest.5ch.net/
|
4
4
|
|
5
5
|
[![Gem Version](https://badge.fury.io/rb/itest5ch.svg)](https://badge.fury.io/rb/itest5ch)
|
6
|
-
[![CircleCI](https://circleci.com/gh/sue445/itest5ch/tree/master.svg)](https://circleci.com/gh/sue445/itest5ch/tree/master)
|
6
|
+
[![CircleCI](https://circleci.com/gh/sue445/itest5ch/tree/master.svg?style=svg)](https://circleci.com/gh/sue445/itest5ch/tree/master)
|
7
7
|
[![Coverage Status](https://coveralls.io/repos/github/sue445/itest5ch/badge.svg)](https://coveralls.io/github/sue445/itest5ch)
|
8
8
|
[![Maintainability](https://api.codeclimate.com/v1/badges/14a81b3f7da11e475242/maintainability)](https://codeclimate.com/github/sue445/itest5ch/maintainability)
|
9
9
|
|
data/bin/console
CHANGED
data/itest5ch.gemspec
CHANGED
@@ -28,16 +28,16 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_development_dependency "activesupport"
|
29
29
|
spec.add_development_dependency "bundler", ">= 1.16"
|
30
30
|
spec.add_development_dependency "coveralls"
|
31
|
-
spec.add_development_dependency "
|
31
|
+
spec.add_development_dependency "onkcop", "1.0.0.0"
|
32
32
|
spec.add_development_dependency "rake", ">= 10.0"
|
33
33
|
spec.add_development_dependency "rspec", "~> 3.0"
|
34
34
|
spec.add_development_dependency "rspec-its"
|
35
35
|
spec.add_development_dependency "rspec-parameterized"
|
36
|
-
spec.add_development_dependency "rubocop", "
|
37
|
-
spec.add_development_dependency "rubocop-performance", "1.5.2"
|
38
|
-
spec.add_development_dependency "rubocop-rspec", "1.37.1"
|
36
|
+
spec.add_development_dependency "rubocop", "1.8.0"
|
39
37
|
spec.add_development_dependency "rubocop_auto_corrector"
|
40
|
-
spec.add_development_dependency "
|
38
|
+
spec.add_development_dependency "rubocop-performance", "1.9.2"
|
39
|
+
spec.add_development_dependency "rubocop-rspec", "2.1.0"
|
40
|
+
spec.add_development_dependency "simplecov", "< 0.18.0"
|
41
41
|
spec.add_development_dependency "unparser", ">= 0.4.5"
|
42
42
|
spec.add_development_dependency "webmock"
|
43
43
|
spec.add_development_dependency "yard"
|
@@ -19,20 +19,20 @@ module Itest5ch
|
|
19
19
|
|
20
20
|
private
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
def get_boards(ul)
|
23
|
+
ul.search("/li").select {|li| board_element?(li) }.each_with_object([]) do |li, boards|
|
24
|
+
url = URI.join(BOARDS_URL, li.at("/a")["href"]).to_s
|
25
|
+
name = li.inner_text.strip
|
26
26
|
|
27
|
-
|
27
|
+
boards << Board.new(url, name: name)
|
28
|
+
end
|
28
29
|
end
|
29
|
-
end
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
def board_element?(li)
|
32
|
+
return false unless li["class"].include?("pure-menu-item")
|
33
|
+
return false if li["class"].include?("pure-menu-selected")
|
34
34
|
|
35
|
-
|
36
|
-
|
35
|
+
true
|
36
|
+
end
|
37
37
|
end
|
38
38
|
end
|
data/lib/itest5ch/thread.rb
CHANGED
@@ -119,55 +119,55 @@ module Itest5ch
|
|
119
119
|
|
120
120
|
private
|
121
121
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
end
|
131
|
-
|
132
|
-
# @param url [String]
|
133
|
-
def initialize_with_string(url)
|
134
|
-
if (m = url.match(%r{https?://itest\.5ch\.net/(.+)/test/read\.cgi/([^/]+)/([0-9]+)}))
|
135
|
-
@subdomain = m[1]
|
136
|
-
@board = m[2]
|
137
|
-
@dat = m[3].to_i
|
138
|
-
return
|
122
|
+
# @param hash [Hash]
|
123
|
+
def initialize_with_hash(hash)
|
124
|
+
assert_required_keys!(hash, :subdomain, :board, :dat)
|
125
|
+
|
126
|
+
@subdomain = hash[:subdomain]
|
127
|
+
@board = hash[:board]
|
128
|
+
@dat = hash[:dat]
|
129
|
+
@name = hash[:name]
|
139
130
|
end
|
140
131
|
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
132
|
+
# @param url [String]
|
133
|
+
def initialize_with_string(url)
|
134
|
+
if (m = url.match(%r{https?://itest\.5ch\.net/(.+)/test/read\.cgi/([^/]+)/([0-9]+)}))
|
135
|
+
@subdomain = m[1]
|
136
|
+
@board = m[2]
|
137
|
+
@dat = m[3].to_i
|
138
|
+
return
|
139
|
+
end
|
140
|
+
|
141
|
+
if (m = url.match(%r{https?://(.+)\.5ch\.net/test/read\.cgi/([^/]+)/([0-9]+)}))
|
142
|
+
@subdomain = m[1]
|
143
|
+
@board = m[2]
|
144
|
+
@dat = m[3].to_i
|
145
|
+
return
|
146
|
+
end
|
147
|
+
|
148
|
+
raise ArgumentError, "'#{url}' is invalid url format"
|
146
149
|
end
|
147
150
|
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
def fetch_data
|
153
|
-
get_json(json_url, referer: smartphone_url)
|
154
|
-
end
|
151
|
+
# @return [Hash]
|
152
|
+
def fetch_data
|
153
|
+
get_json(json_url, referer: smartphone_url)
|
154
|
+
end
|
155
155
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
156
|
+
# @return [String] random 10 char string
|
157
|
+
def rand
|
158
|
+
SecureRandom.hex(5)
|
159
|
+
end
|
160
160
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
161
|
+
# @param unixtime [Integer]
|
162
|
+
#
|
163
|
+
# @return [ActiveSupport::TimeWithZone] When `Time.zone` is initialized
|
164
|
+
# @return [Time] When `Time.zone` is not initialized or without activesupport
|
165
|
+
def time_at(unixtime)
|
166
|
+
if Time.respond_to?(:zone) && Time.zone.respond_to?(:at)
|
167
|
+
Time.zone.at(unixtime)
|
168
|
+
else
|
169
|
+
Time.at(unixtime)
|
170
|
+
end
|
170
171
|
end
|
171
|
-
end
|
172
172
|
end
|
173
173
|
end
|
data/lib/itest5ch/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itest5ch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.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:
|
11
|
+
date: 2021-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hpricot
|
@@ -81,19 +81,19 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: onkcop
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - '='
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 1.0.0.0
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 1.0.0.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rake
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,70 +156,70 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - '='
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
159
|
+
version: 1.8.0
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - '='
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
166
|
+
version: 1.8.0
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
168
|
+
name: rubocop_auto_corrector
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- -
|
171
|
+
- - ">="
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
173
|
+
version: '0'
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
|
-
- -
|
178
|
+
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
180
|
+
version: '0'
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
|
-
name: rubocop-
|
182
|
+
name: rubocop-performance
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
185
|
- - '='
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: 1.
|
187
|
+
version: 1.9.2
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - '='
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version: 1.
|
194
|
+
version: 1.9.2
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
|
-
name:
|
196
|
+
name: rubocop-rspec
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
|
-
- -
|
199
|
+
- - '='
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version:
|
201
|
+
version: 2.1.0
|
202
202
|
type: :development
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
|
-
- -
|
206
|
+
- - '='
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version:
|
208
|
+
version: 2.1.0
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: simplecov
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
212
212
|
requirements:
|
213
|
-
- - "
|
213
|
+
- - "<"
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version:
|
215
|
+
version: 0.18.0
|
216
216
|
type: :development
|
217
217
|
prerelease: false
|
218
218
|
version_requirements: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
|
-
- - "
|
220
|
+
- - "<"
|
221
221
|
- !ruby/object:Gem::Version
|
222
|
-
version:
|
222
|
+
version: 0.18.0
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
224
|
name: unparser
|
225
225
|
requirement: !ruby/object:Gem::Requirement
|
@@ -296,7 +296,7 @@ homepage: https://github.com/sue445/itest5ch
|
|
296
296
|
licenses:
|
297
297
|
- MIT
|
298
298
|
metadata: {}
|
299
|
-
post_install_message:
|
299
|
+
post_install_message:
|
300
300
|
rdoc_options: []
|
301
301
|
require_paths:
|
302
302
|
- lib
|
@@ -311,8 +311,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
311
311
|
- !ruby/object:Gem::Version
|
312
312
|
version: '0'
|
313
313
|
requirements: []
|
314
|
-
rubygems_version: 3.
|
315
|
-
signing_key:
|
314
|
+
rubygems_version: 3.2.3
|
315
|
+
signing_key:
|
316
316
|
specification_version: 4
|
317
317
|
summary: 5ch (a.k.a. 2ch) reader via itest.5ch.net
|
318
318
|
test_files: []
|