bbs_2ch_url_validator 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +1 -0
- data/lib/bbs_2ch_url_validator.rb +10 -11
- data/lib/bbs_2ch_url_validator/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d18763b2285ff5904ddb67711aba1eef017b36cc
|
4
|
+
data.tar.gz: 4a1129ca4aa6145b876954d8f913deb0b0274597
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4375d564eb3bbfc35d7d5b1bffdd3de60535ece7d7860ecf872da8cbe712160c17f053a9d64f2292c05a3d742e85b536b2e08c15fbce4fb437f3aeee8dede4df
|
7
|
+
data.tar.gz: 779266227124b65920d0cb1f3045ee0fc11503831dc6484dc77c79d9b72ff32ccf75c62e0b875bb03881847b89bab0937e8e3c2c70f2c208e1161142ac5d0c47
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -45,6 +45,7 @@ The gem is available as open source under the terms of the [MIT License](http://
|
|
45
45
|
|
46
46
|
## History
|
47
47
|
|
48
|
+
- v0.1.5 Ignore res number(s) on URL (e.g.) http://toro.open2ch.net/test/read.cgi/tech/1371956681/l50
|
48
49
|
- v0.1.4 Fix bugs of these: #dat?, #subject?, #setting?, #open? and override UrlInfo#to_s
|
49
50
|
- v0.1.3 Add Bbs2chUrlValidator::URL#subject, #dat, #setting, #dat?, #subject?, #setting?, #open?
|
50
51
|
- v0.1.2 Put #build_url into instance variable 'built_url'
|
@@ -2,8 +2,8 @@
|
|
2
2
|
require_relative './bbs_2ch_url_validator/version'
|
3
3
|
|
4
4
|
module Bbs2chUrlValidator
|
5
|
-
# http://www.rubular.com/r/
|
6
|
-
VALID_2CH_URL_REGEX = %r(^http:\/\/((?<server_name>.+)\.)?(?<is_open>open)?2ch.(?<tld>net|sc)\/?((test\/read\.cgi\/)?(?<board_name>\w+?)\/?((?<thread_key>\d{9,10})
|
5
|
+
# http://www.rubular.com/r/mxKUUaB6bg
|
6
|
+
VALID_2CH_URL_REGEX = %r(^http:\/\/((?<server_name>.+)\.)?(?<is_open>open)?2ch.(?<tld>net|sc)\/?((test\/read\.cgi\/)?(?<board_name>\w+?)\/?((?<thread_key>\d{9,10})(?:\/?(\d|l)*)?)?)?((?<is_dat>dat)\/(?<thread_key2>\d{9,10})\.dat)?((?<is_subject>subject)\.txt)?((?<is_setting>SETTING)\.TXT)?$) # rubocop:disable Metrics/LineLength
|
7
7
|
|
8
8
|
class URL
|
9
9
|
# @params [URI or String] url URL
|
@@ -58,7 +58,6 @@ module Bbs2chUrlValidator
|
|
58
58
|
instance_variable_set("@#{k}", value)
|
59
59
|
end
|
60
60
|
@built_url = build_url
|
61
|
-
define_methods
|
62
61
|
end
|
63
62
|
|
64
63
|
def dat
|
@@ -77,15 +76,15 @@ module Bbs2chUrlValidator
|
|
77
76
|
built_url
|
78
77
|
end
|
79
78
|
|
80
|
-
|
79
|
+
def open?; @is_open end
|
81
80
|
|
82
|
-
def
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
81
|
+
def dat?; @is_dat end
|
82
|
+
|
83
|
+
def subject?; @is_subject end
|
84
|
+
|
85
|
+
def setting?; @is_setting end
|
86
|
+
|
87
|
+
private
|
89
88
|
|
90
89
|
def build_url
|
91
90
|
if @is_dat || @is_subject || @is_setting
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bbs_2ch_url_validator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dogwood008
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|