yt-audit 0.3.2 → 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
2
  SHA1:
3
- metadata.gz: 6473fa55581bd31bd760e84c500e0b2c4647fe55
4
- data.tar.gz: a0ae2a7e5f2bdb2c7bc9aa5ff174a74c1fbebf26
3
+ metadata.gz: 1e7599b4da04a7dac5ac73d3873831f95f21ce60
4
+ data.tar.gz: 1a361e1a3c6a144566edf532177d73d424c5195c
5
5
  SHA512:
6
- metadata.gz: 19792c65538bbeae70dd001f5071a0304d86acfc709fbe0b56d6fdfd8f995edb5d73e7f8877b92d6d5b1ce1a8b34db59b754ae847afc773da6cf643079340ba5
7
- data.tar.gz: a6b8d21de30d05fa01986e9d9735c9347e4e6ae0fb567487fd2fbf19f5627314eaf82af0f7d6d47d379b5274d15913e28610b36ce98cdd7bac815aef7a05021b
6
+ metadata.gz: 4e29730efc95d40b1826888fcd5d4c945cbc52bd10ac8cd93b5dae640a7c6671e249d890293146c6de14fd6ae62b95a5ef2e712764219508220261444eaa40de
7
+ data.tar.gz: 4599842e7338ade3fde68359af8b49932896de7c04c646b53d0ad3dee90ab7b764c2aa104144a59949941472039a7f0dd4c0313e178f25315370179abc05a7f6
@@ -6,6 +6,14 @@ For more information about changelogs, check
6
6
  [Keep a Changelog](http://keepachangelog.com) and
7
7
  [Vandamme](http://tech-angels.github.io/vandamme).
8
8
 
9
+ ## 0.4.0 - 2017.02.27
10
+
11
+ **How to upgrade**
12
+
13
+ If your code depends on the `yt` gem, ensure you use version 0.29.0 or higher.
14
+
15
+ * [ENHANCEMENT] Use new `yt-url` gem, extracted from `yt`
16
+
9
17
  ## 0.3.2 - 2017.02.26
10
18
 
11
19
  * [ENHANCEMENT] Don't limit Yt dependency to 0.25.x
@@ -1,5 +1,6 @@
1
1
  require 'yt'
2
2
  require 'yt/annotations'
3
+ require 'yt/url'
3
4
  require 'yt/video_audit/info_card'
4
5
  require 'yt/video_audit/brand_anchoring'
5
6
  require 'yt/video_audit/subscribe_annotation'
@@ -1,5 +1,5 @@
1
1
  module Yt
2
2
  class Audit
3
- VERSION = "0.3.2"
3
+ VERSION = '0.4.0'
4
4
  end
5
5
  end
@@ -16,13 +16,16 @@ module Yt
16
16
  private
17
17
 
18
18
  def valid?(video)
19
- video.description.split(' ')
20
- .select {|word| Yt::URL.new(word).kind == :channel }
21
- .any? {|link| channel_id(link) == video.channel_id }
19
+ video.description.split(' ').any? do |word|
20
+ if Yt::URL::CHANNEL_PATTERNS.any?{|pattern| word.match pattern}
21
+ url = Yt::URL.new word
22
+ url.kind == :channel && channel_id(url) == video.channel_id
23
+ end
24
+ end
22
25
  end
23
26
 
24
27
  def channel_id(url)
25
- Yt::Channel.new(url: url).id
28
+ url.id
26
29
  rescue Yt::Errors::NoItems
27
30
  end
28
31
  end
@@ -20,7 +20,8 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_dependency "yt", '>= 0.25.22'
23
+ spec.add_dependency 'yt', '>= 0.29.1'
24
+ spec.add_dependency 'yt-url', '>= 1.0.0.beta1'
24
25
  spec.add_dependency "yt-annotations", '~> 1.2'
25
26
 
26
27
  spec.add_development_dependency "bundler", "~> 1.11"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yt-audit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kang-Kyu Lee
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-26 00:00:00.000000000 Z
11
+ date: 2017-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yt
@@ -16,14 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.25.22
19
+ version: 0.29.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.25.22
26
+ version: 0.29.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: yt-url
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.0.0.beta1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 1.0.0.beta1
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: yt-annotations
29
43
  requirement: !ruby/object:Gem::Requirement