markdown_videos 1.0.0 → 1.0.2

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
  !binary "U0hBMQ==":
3
- metadata.gz: b322a4f32f6b252011b2d3f74c86bbdc11ca30b0
4
- data.tar.gz: a1a965e73e842d1e1e873ea3646d69e21e09dbc6
3
+ metadata.gz: b65cccfd771229fcfbe0aef2a7807ac6a46e6b43
4
+ data.tar.gz: 9e63aabb95e670d354f2b68dfd8e7d85db873efb
5
5
  SHA512:
6
- metadata.gz: 7c7b519ac8d8995cc303ec22de89f2e83acbb6e29364905f5d8967538f09370a08c998c6221499831f1eb180265c77a95896b9d6703a35fbbbca3772838c5177
7
- data.tar.gz: e03271030f4aa77d050533300d4a8ee503ec08c44aa8a777b9619d85e638a21a57e0f65f21a13ca9bc2362912fd189dd2295ba202a88730b5ca9eb4dbbf727c4
6
+ metadata.gz: e11717899ae71ceffa4b311448624c83570c7544e4ca78376a59c63d3047a9a6ed2a78b9b6ab20f8809c7aaa74ef15e45151370d722dcd48f639569f8ca49c98
7
+ data.tar.gz: 7626bbc8c8d66cb26e38f5f5b68763f4a5a76d50546a9d50a3c26fd49d3fd6bc4d2cf9ef6241f99ef83e145cd5f1e14a44b7a56ebdc52c3e613e897822054f98
@@ -20,7 +20,7 @@ module MarkdownVideos
20
20
  match_data = Regexp.last_match
21
21
  markdown = {
22
22
  alt_text: match_data[1],
23
- url: match_data[2]
23
+ url: match_data[2].strip
24
24
  }
25
25
 
26
26
  service_class = find_service_for(markdown[:url])
@@ -24,7 +24,7 @@ module MarkdownVideos
24
24
 
25
25
  def initialize(alt_text, markdown_url, options)
26
26
  @alt_text = alt_text
27
- @markdown_url = markdown_url
27
+ @markdown_url = markdown_url.strip
28
28
  options.each { |option, value| self.send("#{option}=", value) }
29
29
  end
30
30
 
@@ -3,7 +3,7 @@ module MarkdownVideos::Services
3
3
  class VimeoService < ServiceBase
4
4
 
5
5
  def self.regexp
6
- /(https?:\/\/(?:(?:player\.)?vimeo.com\/(?:video\/)?)([0-9]{4,16})\??([\w\-\=]+)?)/
6
+ /^(https?:\/\/(?:(?:player\.)?vimeo.com\/(?:video\/)?)([0-9]{4,16})\??([\w\-\=]+)?)$/
7
7
  end
8
8
 
9
9
  def url
@@ -3,7 +3,7 @@ module MarkdownVideos::Services
3
3
  class YoutubeService < ServiceBase
4
4
 
5
5
  def self.regexp
6
- /(https?:\/\/(?:youtu.be\/|www.youtube.com\/(?:watch\?v=|embed\/))([\w\-]{4,16})\??([\w\-\=]+)?)/
6
+ /^(https?:\/\/(?:youtu.be\/|www.youtube.com\/(?:watch\?v=|embed\/))([\w\-]{4,16})\??([\w\-\=]+)?)$/
7
7
  end
8
8
 
9
9
  def width
@@ -1,3 +1,3 @@
1
1
  module MarkdownVideos
2
- VERSION = "1.0.0".freeze
2
+ VERSION = "1.0.2".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markdown_videos
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Capripot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-15 00:00:00.000000000 Z
11
+ date: 2016-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: '2.4'
19
+ version: '2'
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: '2.4'
26
+ version: '2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubocop
29
29
  requirement: !ruby/object:Gem::Requirement