easy_youtube 0.0.0 → 0.0.1

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.
Files changed (2) hide show
  1. data/lib/easy_youtube.rb +7 -6
  2. metadata +18 -2
data/lib/easy_youtube.rb CHANGED
@@ -1,11 +1,11 @@
1
1
  require "net/http"
2
2
  class EasyYouTube
3
3
  URL_FORMATS = {
4
- regular: /^(https?:\/\/)?(www\.)?youtube.com\/watch\?(.*\&)?v=(?<id>[^&]+)/,
5
- shortened: /^(https?:\/\/)?(www\.)?youtu.be\/(?<id>[^&]+)/,
6
- embed: /^(https?:\/\/)?(www\.)?youtube.com\/embed\/(?<id>[^&]+)/,
7
- embed_as3: /^(https?:\/\/)?(www\.)?youtube.com\/v\/(?<id>[^?]+)/,
8
- chromeless_as3: /^(https?:\/\/)?(www\.)?youtube.com\/apiplayer\?video_id=(?<id>[^&]+)/
4
+ :regular => /^(https?:\/\/)?(www\.)?youtube.com\/watch\?(.*\&)?v=(?<id>[^&]+)/,
5
+ :shortened => /^(https?:\/\/)?(www\.)?youtu.be\/(?<id>[^&]+)/,
6
+ :embed => /^(https?:\/\/)?(www\.)?youtube.com\/embed\/(?<id>[^&]+)/,
7
+ :embed_as3 => /^(https?:\/\/)?(www\.)?youtube.com\/v\/(?<id>[^?]+)/,
8
+ :chromeless_as3 => /^(https?:\/\/)?(www\.)?youtube.com\/apiplayer\?video_id=(?<id>[^&]+)/
9
9
  }
10
10
 
11
11
  INVALID_CHARS = /[^a-zA-Z0-9\:\/\?\=\&\$\-\_\.\+\!\*\'\(\)\,]/
@@ -15,7 +15,8 @@ class EasyYouTube
15
15
  URL_FORMATS.values.each do |format_regex|
16
16
  match = format_regex.match(youtube_url)
17
17
  return match[:id] if match
18
- end
18
+ end
19
+ return nil
19
20
  end
20
21
 
21
22
  def self.has_invalid_chars?(youtube_url)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_youtube
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -27,6 +27,22 @@ dependencies:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
30
46
  description: This is a simple Gem for dealing with youtube videos
31
47
  email: natesholland@gmail.com
32
48
  executables: []
@@ -46,7 +62,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
46
62
  requirements:
47
63
  - - ! '>='
48
64
  - !ruby/object:Gem::Version
49
- version: '0'
65
+ version: 1.9.2
50
66
  required_rubygems_version: !ruby/object:Gem::Requirement
51
67
  none: false
52
68
  requirements: