nicoapi-parser 0.0.3.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nicoapi/parser/tag_search.rb +4 -4
- data/lib/nicoapi/parser/version.rb +1 -1
- data/spec/parser/tag_search_spec.rb +4 -0
- 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: 0eb1568706d319529d59119ab3496b9f9249604a
|
4
|
+
data.tar.gz: 7cfaa389dd20d23a774941eb9397750100484601
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7d86c6d2c8083c8fb4b0fa6eda1228343f9f61a9fed621f39eaa89473bc91eab18a37b3ed7c682f171f64ec6626b3fa4926f75b062cf9435d7014e72fdb69f7
|
7
|
+
data.tar.gz: 154c1bd4d357da1e2ef1bd3ca3fea1483f30702d10093cb0f22180923e85dfd869b69b60c68c85eaabb9b26b47d55107f2434bead7fba9b15ef0b86395007a9c
|
@@ -85,19 +85,19 @@ module NicoAPI
|
|
85
85
|
|
86
86
|
def movie_references
|
87
87
|
# is this the high road?
|
88
|
-
text.scan(/((sm|nm)\d{1,
|
88
|
+
text.scan(/((sm|nm)\d{1,})/).map {|e| e[0]}
|
89
89
|
end
|
90
90
|
|
91
91
|
def mylist_references
|
92
|
-
text.scan /mylist
|
92
|
+
text.scan /(?<=mylist\/)\d{1,}/
|
93
93
|
end
|
94
94
|
|
95
95
|
def community_references
|
96
|
-
text.scan /co\d{1,
|
96
|
+
text.scan /co\d{1,}/
|
97
97
|
end
|
98
98
|
|
99
99
|
def seiga_references
|
100
|
-
text.scan /im\d{1,
|
100
|
+
text.scan /im\d{1,}/
|
101
101
|
end
|
102
102
|
end
|
103
103
|
end
|
@@ -85,6 +85,7 @@ describe "TagSearch" do
|
|
85
85
|
subject { @instance.items[5].description.movie_references }
|
86
86
|
specify { expect(subject).to be_kind_of(Array) }
|
87
87
|
specify { expect(subject.length).to eq 4 }
|
88
|
+
specify { expect(subject[0]).to match /^(sm|nm)\d{1,}$/ }
|
88
89
|
end
|
89
90
|
|
90
91
|
# Fixtureの最初の動画では、'mylist/(数字)'の記載が2つある。
|
@@ -92,6 +93,7 @@ describe "TagSearch" do
|
|
92
93
|
subject { @instance.items[0].description.mylist_references }
|
93
94
|
specify { expect(subject).to be_kind_of(Array) }
|
94
95
|
specify { expect(subject.length).to eq 2 }
|
96
|
+
specify { expect(subject[0]).to match /^\d{1,}$/ }
|
95
97
|
end
|
96
98
|
|
97
99
|
# Fixtureの3番目の動画では、'co(数字)'の記載が2つある。
|
@@ -99,6 +101,7 @@ describe "TagSearch" do
|
|
99
101
|
subject { @instance.items[2].description.community_references }
|
100
102
|
specify { expect(subject).to be_kind_of(Array) }
|
101
103
|
specify { expect(subject.length).to eq 1 }
|
104
|
+
specify { expect(subject[0]).to match /^co\d{1,}$/ }
|
102
105
|
end
|
103
106
|
|
104
107
|
# Fixtureの3番目の動画では、'im(数字)'の記載が1つある。
|
@@ -106,6 +109,7 @@ describe "TagSearch" do
|
|
106
109
|
subject { @instance.items[3].description.seiga_references }
|
107
110
|
specify { expect(subject).to be_kind_of(Array) }
|
108
111
|
specify { expect(subject.length).to eq 1 }
|
112
|
+
specify { expect(subject[0]).to match /^im\d{1,}$/ }
|
109
113
|
end
|
110
114
|
end
|
111
115
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nicoapi-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masami Yonehara
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|