nicoapi-parser 0.0.3.2 → 0.0.4

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
2
  SHA1:
3
- metadata.gz: 87d4dbfb4a08d022e348a29be62236e0169456e4
4
- data.tar.gz: 2e6810153233f7b99182c7b04b7178b0f343931c
3
+ metadata.gz: 0eb1568706d319529d59119ab3496b9f9249604a
4
+ data.tar.gz: 7cfaa389dd20d23a774941eb9397750100484601
5
5
  SHA512:
6
- metadata.gz: 1eb0ea2ea13a2e18722cc2e2bb900b9d280e283851d1585cb1550970bed992c09a9b871c3c7cb68712ebd8fbb05cb8c96ce404cf45eb41aab663c87500ec2e5b
7
- data.tar.gz: fc828b8985781bcfbd84bbf230557bba4cccdc2424ce7e0675de6016232c6ab7a31a40f0c484754f9cc27f5542e81e12714495c7bdb338d828d6a54f3b98f696
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,8})/).map {|e| e[0]}
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\/\d{1,8}/
92
+ text.scan /(?<=mylist\/)\d{1,}/
93
93
  end
94
94
 
95
95
  def community_references
96
- text.scan /co\d{1,8}/
96
+ text.scan /co\d{1,}/
97
97
  end
98
98
 
99
99
  def seiga_references
100
- text.scan /im\d{1,8}/
100
+ text.scan /im\d{1,}/
101
101
  end
102
102
  end
103
103
  end
@@ -1,5 +1,5 @@
1
1
  module Nicoapi
2
2
  module Parser
3
- VERSION = "0.0.3.2"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  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.3.2
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-04 00:00:00.000000000 Z
11
+ date: 2013-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri