html-pipeline-nico_link 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: bd49c1fe5c79a87339cd7f8d94c8990e5cf25734
4
- data.tar.gz: f3f8eaaf2350a3b971df5121e9b899d85dd9626a
2
+ SHA256:
3
+ metadata.gz: 6ae571a46d4a1978dda095d9278c7e7063b2aaecfae7e0d4bb9bcfd592df94c9
4
+ data.tar.gz: ea58a1fcb4bedee2d259a0923a5d605babc2a73c88bd003ead98de6331ca68b3
5
5
  SHA512:
6
- metadata.gz: 90300eed5ce294c59b61650148d6d7cf70595b32c56c78da57cdecd6b228f195585ab4ee1b0ff460a9d92dc82936c23754979c0cdca4feeedd755a4d39d879af
7
- data.tar.gz: 4ea9aa1171691ae2857a2425b6b6b2f56eac38d23c032063f7e0b0575d9ac7d370224fd4b1dabe80fd7cf553e5fb9962c88f6f9d2532a88c071a98ed42493c7b
6
+ metadata.gz: d348ab7ba43e58138d0796d8f3259e340ae3e2f09f25507329d187f3f76ee95dbecbb7eae35733c9023452059a4a503ae5b30a3da2299ac75d782b2b14f3c6c0
7
+ data.tar.gz: ceda942499fc34d4a8a2bf8a0ef6a51d31234387997dae3057c7d9de28b98b5872358a14b64c7778096ab218459e4a91464d26f2f6bc730fdee323d6cf7d0217
data/.rubocop.yml CHANGED
@@ -4,6 +4,9 @@ AllCops:
4
4
  - tmp/**/*
5
5
  - vendor/**/*
6
6
 
7
+ BlockLength:
8
+ Enabled: false
9
+
7
10
  SpecialGlobalVars:
8
11
  Enabled: false
9
12
 
@@ -1,4 +1,4 @@
1
- # coding: utf-8
1
+
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'html/pipeline/nico_link/version'
@@ -22,5 +22,5 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency 'bundler', '~> 1.7'
23
23
  spec.add_development_dependency 'rake', '~> 10.0'
24
24
  spec.add_development_dependency 'rspec', '~> 3.1.0'
25
- spec.add_development_dependency 'rubocop', '~> 0.40.0'
25
+ spec.add_development_dependency 'rubocop'
26
26
  end
@@ -46,7 +46,7 @@ module HTML
46
46
  @merged_pattern ||= /\b(?:(#{patterns.map { |n| n[:pattern] }.join(')|(')}))\b/
47
47
  end
48
48
 
49
- IGNORE_PARENTS = %w(pre code a style script).to_set
49
+ IGNORE_PARENTS = %w[pre code a style script].to_set
50
50
 
51
51
  DEFAULT_PATTERNS = [
52
52
  {
@@ -120,7 +120,7 @@ module HTML
120
120
  {
121
121
  pattern: /jps\d{1,14}/,
122
122
  link: 'http://jpstore.dwango.jp/products/detail.php?product_id=%s',
123
- convert: -> (str) { str.sub('jps', '') },
123
+ convert: ->(str) { str.sub('jps', '') },
124
124
  },
125
125
  {
126
126
  pattern: /kn\d+/,
@@ -134,6 +134,10 @@ module HTML
134
134
  pattern: /mt\d+/,
135
135
  link: 'https://mtm.nicovideo.jp/watch/%s',
136
136
  },
137
+ {
138
+ pattern: /nq\d+/,
139
+ link: 'https://q.nicovideo.jp/watch/%s',
140
+ },
137
141
  ].freeze
138
142
  end
139
143
  end
@@ -1,7 +1,7 @@
1
1
  module HTML
2
2
  class Pipeline
3
3
  module NicoLink
4
- VERSION = '0.3.0'.freeze
4
+ VERSION = '0.4.0'.freeze
5
5
  end
6
6
  end
7
7
  end
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+
2
2
  require 'spec_helper'
3
3
 
4
4
  describe 'NicoLinkFilter' do
@@ -59,13 +59,13 @@ describe 'NicoLinkFilter' do
59
59
 
60
60
  context 'all stars' do
61
61
  let :text do
62
- %w(
62
+ %w[
63
63
  sm123 watch/5321 co9999 ch1414 ar56789 td3232 nc9284 dw111 lv8864 sg9123 bk1313 im58
64
64
  commons.nicovideo.jp/user/1 niconicommons.jp/user/2
65
65
  user/illust/3 clip/555 ch.nicovideo.jp/h-p
66
- jps1111 kn1567 gm54321
67
- ).join(' ')
66
+ jps1111 kn1567 gm54321 nq2525
67
+ ].join(' ')
68
68
  end
69
- it { expect(subject).to eq '<a href="http://www.nicovideo.jp/watch/sm123">sm123</a> <a href="http://www.nicovideo.jp/watch/5321">watch/5321</a> <a href="http://com.nicovideo.jp/co9999">co9999</a> <a href="http://ch.nicovideo.jp/ch1414">ch1414</a> <a href="http://ch.nicovideo.jp/article/ar56789">ar56789</a> <a href="http://3d.nicovideo.jp/works/td3232">td3232</a> <a href="http://commons.nicovideo.jp/material/nc9284">nc9284</a> <a href="http://ichiba.nicovideo.jp/item/dw111">dw111</a> <a href="http://live.nicovideo.jp/watch/lv8864">lv8864</a> <a href="http://seiga.nicovideo.jp/watch/sg9123">sg9123</a> <a href="http://seiga.nicovideo.jp/watch/bk1313">bk1313</a> <a href="http://seiga.nicovideo.jp/seiga/im58">im58</a> <a href="http://commons.nicovideo.jp/user/1">commons.nicovideo.jp/user/1</a> <a href="http://www.niconicommons.jp/user/2">niconicommons.jp/user/2</a> <a href="http://seiga.nicovideo.jp/user/illust/3">user/illust/3</a> <a href="http://seiga.nicovideo.jp/clip/555">clip/555</a> <a href="http://ch.nicovideo.jp/h-p">ch.nicovideo.jp/h-p</a> <a href="http://jpstore.dwango.jp/products/detail.php?product_id=1111">jps1111</a> <a href="https://niconare.nicovideo.jp/watch/kn1567">kn1567</a> <a href="https://game.nicovideo.jp/atsumaru/games/gm54321">gm54321</a>' }
69
+ it { expect(subject).to eq '<a href="http://www.nicovideo.jp/watch/sm123">sm123</a> <a href="http://www.nicovideo.jp/watch/5321">watch/5321</a> <a href="http://com.nicovideo.jp/co9999">co9999</a> <a href="http://ch.nicovideo.jp/ch1414">ch1414</a> <a href="http://ch.nicovideo.jp/article/ar56789">ar56789</a> <a href="http://3d.nicovideo.jp/works/td3232">td3232</a> <a href="http://commons.nicovideo.jp/material/nc9284">nc9284</a> <a href="http://ichiba.nicovideo.jp/item/dw111">dw111</a> <a href="http://live.nicovideo.jp/watch/lv8864">lv8864</a> <a href="http://seiga.nicovideo.jp/watch/sg9123">sg9123</a> <a href="http://seiga.nicovideo.jp/watch/bk1313">bk1313</a> <a href="http://seiga.nicovideo.jp/seiga/im58">im58</a> <a href="http://commons.nicovideo.jp/user/1">commons.nicovideo.jp/user/1</a> <a href="http://www.niconicommons.jp/user/2">niconicommons.jp/user/2</a> <a href="http://seiga.nicovideo.jp/user/illust/3">user/illust/3</a> <a href="http://seiga.nicovideo.jp/clip/555">clip/555</a> <a href="http://ch.nicovideo.jp/h-p">ch.nicovideo.jp/h-p</a> <a href="http://jpstore.dwango.jp/products/detail.php?product_id=1111">jps1111</a> <a href="https://niconare.nicovideo.jp/watch/kn1567">kn1567</a> <a href="https://game.nicovideo.jp/atsumaru/games/gm54321">gm54321</a> <a href="https://q.nicovideo.jp/watch/nq2525">nq2525</a>' }
70
70
  end
71
71
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html-pipeline-nico_link
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ru_shalm
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-06 00:00:00.000000000 Z
11
+ date: 2018-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: html-pipeline
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: rubocop
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 0.40.0
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 0.40.0
82
+ version: '0'
83
83
  description:
84
84
  email:
85
85
  - ru_shalm@hazimu.com
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  version: '0'
121
121
  requirements: []
122
122
  rubyforge_project:
123
- rubygems_version: 2.6.11
123
+ rubygems_version: 2.7.6
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: niconico link for html-pipeline