bbs_2ch_url_validator 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +97 -0
- data/README.md +6 -1
- data/lib/bbs_2ch_url_validator/version.rb +1 -1
- data/lib/bbs_2ch_url_validator.rb +9 -4
- 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: 756d5594b570809e18fc52ffd519b21dc78ff8b3
|
4
|
+
data.tar.gz: 44ca34fca2703451544a09860c697e5437420757
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91bca6d768abb7ee834476ad8cc45ad82bf8fad47a0d525b63f544f6d04448d73b4eac7aa523cf254cfdec831037323e7198589ce90d914262098525b8352601
|
7
|
+
data.tar.gz: e6bc83473dc1dfb1d257efb6281ca6dad8cd7a5bb645a349d4563fc4d43416faabd719f60819160bf4412cf903b78ae44a24ec6c0648025044ad8d245df0674a
|
data/.gitignore
CHANGED
@@ -8,3 +8,100 @@
|
|
8
8
|
/spec/reports/
|
9
9
|
/tmp/
|
10
10
|
.yardoc
|
11
|
+
### https://raw.github.com/github/gitignore/9f6724149b9a0a861b402683f6c50c5f085d130b/Global/Vim.gitignore
|
12
|
+
|
13
|
+
# swap
|
14
|
+
[._]*.s[a-w][a-z]
|
15
|
+
[._]s[a-w][a-z]
|
16
|
+
# session
|
17
|
+
Session.vim
|
18
|
+
# temporary
|
19
|
+
.netrwhist
|
20
|
+
*~
|
21
|
+
# auto-generated tag files
|
22
|
+
tags
|
23
|
+
|
24
|
+
|
25
|
+
### https://raw.github.com/github/gitignore/9f6724149b9a0a861b402683f6c50c5f085d130b/Ruby.gitignore
|
26
|
+
|
27
|
+
*.gem
|
28
|
+
*.rbc
|
29
|
+
/.config
|
30
|
+
/coverage/
|
31
|
+
/InstalledFiles
|
32
|
+
/pkg/
|
33
|
+
/spec/reports/
|
34
|
+
/spec/examples.txt
|
35
|
+
/test/tmp/
|
36
|
+
/test/version_tmp/
|
37
|
+
/tmp/
|
38
|
+
|
39
|
+
# Used by dotenv library to load environment variables.
|
40
|
+
# .env
|
41
|
+
|
42
|
+
## Specific to RubyMotion:
|
43
|
+
.dat*
|
44
|
+
.repl_history
|
45
|
+
build/
|
46
|
+
*.bridgesupport
|
47
|
+
build-iPhoneOS/
|
48
|
+
build-iPhoneSimulator/
|
49
|
+
|
50
|
+
## Specific to RubyMotion (use of CocoaPods):
|
51
|
+
#
|
52
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
53
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
54
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
55
|
+
#
|
56
|
+
# vendor/Pods/
|
57
|
+
|
58
|
+
## Documentation cache and generated files:
|
59
|
+
/.yardoc/
|
60
|
+
/_yardoc/
|
61
|
+
/doc/
|
62
|
+
/rdoc/
|
63
|
+
|
64
|
+
## Environment normalization:
|
65
|
+
/.bundle/
|
66
|
+
/vendor/bundle
|
67
|
+
/lib/bundler/man/
|
68
|
+
|
69
|
+
# for a library or gem, you might want to ignore these files since the code is
|
70
|
+
# intended to run in multiple environments; otherwise, check them in:
|
71
|
+
# Gemfile.lock
|
72
|
+
# .ruby-version
|
73
|
+
# .ruby-gemset
|
74
|
+
|
75
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
76
|
+
.rvmrc
|
77
|
+
|
78
|
+
|
79
|
+
### https://raw.github.com/github/gitignore/9f6724149b9a0a861b402683f6c50c5f085d130b/Global/OSX.gitignore
|
80
|
+
|
81
|
+
*.DS_Store
|
82
|
+
.AppleDouble
|
83
|
+
.LSOverride
|
84
|
+
|
85
|
+
# Icon must end with two \r
|
86
|
+
Icon
|
87
|
+
|
88
|
+
# Thumbnails
|
89
|
+
._*
|
90
|
+
|
91
|
+
# Files that might appear in the root of a volume
|
92
|
+
.DocumentRevisions-V100
|
93
|
+
.fseventsd
|
94
|
+
.Spotlight-V100
|
95
|
+
.TemporaryItems
|
96
|
+
.Trashes
|
97
|
+
.VolumeIcon.icns
|
98
|
+
.com.apple.timemachine.donotpresent
|
99
|
+
|
100
|
+
# Directories potentially created on remote AFP share
|
101
|
+
.AppleDB
|
102
|
+
.AppleDesktop
|
103
|
+
Network Trash Folder
|
104
|
+
Temporary Items
|
105
|
+
.apdisk
|
106
|
+
|
107
|
+
|
data/README.md
CHANGED
@@ -22,7 +22,11 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
25
|
+
```ruby
|
26
|
+
b = Bbs2chUrlValidator::URL.parse('http://viper.2ch.sc/test/read.cgi/news4vip/9990000001/')
|
27
|
+
# => #<Bbs2chUrlValidator::UrlInfo:0x007f7a0901c950 @server_name="viper", @is_open=false, @tld="sc", @board_name="news4vip", @thread_key="9990000001", @is_dat=false, @is_subject=false, @is_setting=false, @built_url="http://viper.2ch.sc/test/read.cgi/news4vip/9990000001/">
|
28
|
+
```
|
29
|
+
|
26
30
|
|
27
31
|
## Development
|
28
32
|
|
@@ -41,5 +45,6 @@ The gem is available as open source under the terms of the [MIT License](http://
|
|
41
45
|
|
42
46
|
## History
|
43
47
|
|
48
|
+
- v0.1.2 Put #build_url into instance variable 'built_url'
|
44
49
|
- v0.1.1 Add UrlInfo#build_url
|
45
50
|
- v0.1.0 first release
|
@@ -45,15 +45,22 @@ module Bbs2chUrlValidator
|
|
45
45
|
end
|
46
46
|
|
47
47
|
class UrlInfo
|
48
|
-
|
49
|
-
|
48
|
+
# @return [String]
|
49
|
+
attr_reader :server_name, :tld, :board_name, :thread_key, :is_open, :built_url
|
50
|
+
# @return [Boolean]
|
51
|
+
attr_reader :is_dat, :is_subject, :is_setting
|
52
|
+
|
53
|
+
# @param [Hash] hash
|
50
54
|
def initialize(hash)
|
51
55
|
hash.each do |k, v|
|
52
56
|
value = k.start_with?('is_') ? !v.nil? : v
|
53
57
|
instance_variable_set("@#{k}", value)
|
54
58
|
end
|
59
|
+
@built_url = build_url
|
55
60
|
end
|
56
61
|
|
62
|
+
private
|
63
|
+
|
57
64
|
def build_url
|
58
65
|
if @is_dat || @is_subject || @is_setting
|
59
66
|
generate_special_url
|
@@ -69,8 +76,6 @@ module Bbs2chUrlValidator
|
|
69
76
|
end
|
70
77
|
end
|
71
78
|
|
72
|
-
private
|
73
|
-
|
74
79
|
def generate_special_url
|
75
80
|
if @is_dat
|
76
81
|
# http://viper.2ch.sc/news4vip/dat/9990000001.dat
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dogwood008
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|