acts_as_unvlogable 1.0.0 → 1.0.2

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.
@@ -0,0 +1,4 @@
1
+ require 'coveralls'
2
+ Coveralls.wear!
3
+
4
+ require 'acts_as_unvlogable'
metadata CHANGED
@@ -1,108 +1,115 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: acts_as_unvlogable
3
- version: !ruby/object:Gem::Version
4
- hash: 23
5
- prerelease:
6
- segments:
7
- - 1
8
- - 0
9
- - 0
10
- version: 1.0.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.2
11
5
  platform: ruby
12
- authors:
13
- - "Manuel Mu\xC3\xB1oz"
6
+ authors:
7
+ - Manuel Muñoz
14
8
  - Fernando Blat
15
9
  - Alberto Romero
16
10
  autorequire:
17
11
  bindir: bin
18
12
  cert_chain: []
19
-
20
- date: 2011-05-08 00:00:00 +02:00
21
- default_executable:
22
- dependencies:
23
- - !ruby/object:Gem::Dependency
24
- name: shoulda
13
+ date: 2015-02-27 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: bundler
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - "~>"
20
+ - !ruby/object:Gem::Version
21
+ version: '1.3'
22
+ type: :development
25
23
  prerelease: false
26
- requirement: &id001 !ruby/object:Gem::Requirement
27
- none: false
28
- requirements:
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - "~>"
27
+ - !ruby/object:Gem::Version
28
+ version: '1.3'
29
+ - !ruby/object:Gem::Dependency
30
+ name: rake
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
29
33
  - - ">="
30
- - !ruby/object:Gem::Version
31
- hash: 3
32
- segments:
33
- - 0
34
- version: "0"
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
35
36
  type: :development
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: ruby-debug
39
37
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ - !ruby/object:Gem::Dependency
44
+ name: rspec
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
43
47
  - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: 3
46
- segments:
47
- - 0
48
- version: "0"
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
49
50
  type: :development
50
- version_requirements: *id002
51
- - !ruby/object:Gem::Dependency
52
- name: xml-simple
53
51
  prerelease: false
54
- requirement: &id003 !ruby/object:Gem::Requirement
55
- none: false
56
- requirements:
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
57
54
  - - ">="
58
- - !ruby/object:Gem::Version
59
- hash: 3
60
- segments:
61
- - 0
62
- version: "0"
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ - !ruby/object:Gem::Dependency
58
+ name: nokogiri
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
63
64
  type: :runtime
64
- version_requirements: *id003
65
- - !ruby/object:Gem::Dependency
66
- name: youtube_it
67
65
  prerelease: false
68
- requirement: &id004 !ruby/object:Gem::Requirement
69
- none: false
70
- requirements:
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
71
68
  - - ">="
72
- - !ruby/object:Gem::Version
73
- hash: 3
74
- segments:
75
- - 0
76
- version: "0"
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ - !ruby/object:Gem::Dependency
72
+ name: xml-simple
73
+ requirement: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
77
78
  type: :runtime
78
- version_requirements: *id004
79
- - !ruby/object:Gem::Dependency
80
- name: hpricot
81
79
  prerelease: false
82
- requirement: &id005 !ruby/object:Gem::Requirement
83
- none: false
84
- requirements:
80
+ version_requirements: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ - !ruby/object:Gem::Dependency
86
+ name: youtube_it
87
+ requirement: !ruby/object:Gem::Requirement
88
+ requirements:
85
89
  - - ">="
86
- - !ruby/object:Gem::Version
87
- hash: 3
88
- segments:
89
- - 0
90
- version: "0"
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
91
92
  type: :runtime
92
- version_requirements: *id005
93
- description: An easy way to include external video services in a rails app. This gem provides you wrappers for the most common video services, such as Youtube, Vimeo, Flickr, and so on...
94
- email:
95
- - mamusino@gmail.com
93
+ prerelease: false
94
+ version_requirements: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ description: An easy way to include external video services in a rails app. This gem
100
+ provides you wrappers for the most common video services, such as Youtube, Vimeo,
101
+ Flickr, and so on...
102
+ email:
103
+ - mamuso@mamuso.net
96
104
  - ferblape@gmail.com
97
105
  - denegro@gmail.com
98
106
  executables: []
99
-
100
107
  extensions: []
101
-
102
108
  extra_rdoc_files: []
103
-
104
- files:
105
- - .gitignore
109
+ files:
110
+ - ".coveralls.yml"
111
+ - ".gitignore"
112
+ - ".travis.yml"
106
113
  - Gemfile
107
114
  - MIT-LICENSE
108
115
  - README.markdown
@@ -120,50 +127,41 @@ files:
120
127
  - lib/acts_as_unvlogable/vg_dailymotion.rb
121
128
  - lib/acts_as_unvlogable/vg_dalealplay.rb
122
129
  - lib/acts_as_unvlogable/vg_flickr.rb
123
- - lib/acts_as_unvlogable/vg_marca.rb
124
130
  - lib/acts_as_unvlogable/vg_metacafe.rb
125
- - lib/acts_as_unvlogable/vg_mtvmusic.rb
126
131
  - lib/acts_as_unvlogable/vg_myspace.rb
127
- - lib/acts_as_unvlogable/vg_qik.rb
132
+ - lib/acts_as_unvlogable/vg_pleer.rb
128
133
  - lib/acts_as_unvlogable/vg_rutube.rb
129
134
  - lib/acts_as_unvlogable/vg_ted.rb
130
135
  - lib/acts_as_unvlogable/vg_vimeo.rb
136
+ - lib/acts_as_unvlogable/vg_wistia.rb
137
+ - lib/acts_as_unvlogable/vg_youtu.rb
131
138
  - lib/acts_as_unvlogable/vg_youtube.rb
132
- - test/acts_as_unvlogable_test.rb
139
+ - spec/acts_as_unvlogable_spec.rb
140
+ - spec/spec_helper.rb
133
141
  - unvlogable_sample.yml
134
- has_rdoc: true
135
- homepage: ""
142
+ homepage: https://github.com/mamuso/acts_as_unvlogable
136
143
  licenses: []
137
-
144
+ metadata: {}
138
145
  post_install_message:
139
146
  rdoc_options: []
140
-
141
- require_paths:
147
+ require_paths:
142
148
  - lib
143
- required_ruby_version: !ruby/object:Gem::Requirement
144
- none: false
145
- requirements:
149
+ required_ruby_version: !ruby/object:Gem::Requirement
150
+ requirements:
146
151
  - - ">="
147
- - !ruby/object:Gem::Version
148
- hash: 3
149
- segments:
150
- - 0
151
- version: "0"
152
- required_rubygems_version: !ruby/object:Gem::Requirement
153
- none: false
154
- requirements:
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
154
+ required_rubygems_version: !ruby/object:Gem::Requirement
155
+ requirements:
155
156
  - - ">="
156
- - !ruby/object:Gem::Version
157
- hash: 3
158
- segments:
159
- - 0
160
- version: "0"
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
161
159
  requirements: []
162
-
163
160
  rubyforge_project: acts_as_unvlogable
164
- rubygems_version: 1.6.0
161
+ rubygems_version: 2.2.2
165
162
  signing_key:
166
- specification_version: 3
163
+ specification_version: 4
167
164
  summary: An easy way to include external video services in a rails app
168
- test_files: []
169
-
165
+ test_files:
166
+ - spec/acts_as_unvlogable_spec.rb
167
+ - spec/spec_helper.rb
@@ -1,48 +0,0 @@
1
- # ----------------------------------------------
2
- # Class for Marca.tv (www.marca.tv)
3
- # http://www.marca.com/tv/?v=DN23wG8c1Rj
4
- # ----------------------------------------------
5
-
6
-
7
- class VgMarca
8
-
9
- def initialize(url=nil, options={})
10
- @url = url
11
- @video_id = @url.query_param('v')
12
- res = Net::HTTP.get(URI.parse("http://estaticos.marca.com/consolamultimedia/marcaTV/elementos/#{@video_id[0,1]}/#{@video_id[1,1]}/#{@video_id[2,100]}.xml"))
13
- @feed = REXML::Document.new(res)
14
- end
15
-
16
- def title
17
- REXML::XPath.first( @feed, "//titulo" )[0].to_s
18
- end
19
-
20
- def thumbnail
21
- REXML::XPath.first( @feed, "//foto" )[0].to_s
22
- end
23
-
24
- def duration
25
- nil
26
- end
27
-
28
- def embed_url
29
- "http://www.marca.com/componentes/flash/embed.swf?ba=0&cvol=1&bt=1&lg=1&vID=#{@video_id}&ba=1"
30
- end
31
-
32
- def embed_html(width=425, height=344, options={})
33
- "<embed width='#{width}' height='#{height}' wmode='transparent' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' allowfullscreen='true' quality='high' src='#{embed_url}'/>"
34
- end
35
-
36
- def flv
37
- REXML::XPath.first(@feed, "//media")[0].to_s
38
- end
39
-
40
- def download_url
41
- nil
42
- end
43
-
44
- def service
45
- "Marca.tv"
46
- end
47
-
48
- end
@@ -1,65 +0,0 @@
1
- # ----------------------------------------------
2
- # Class for MTV Music (www.mtvmusic.com)
3
- # http://www.mtvmusic.com/astley_rick/videos/55086/never_gonna_give_you_up.jhtml
4
- #
5
- #
6
- # quite ugly, we know :(
7
- # ----------------------------------------------
8
-
9
-
10
- class VgMtvmusic
11
-
12
- def initialize(url=nil, options={})
13
- @url = url
14
- @video_id = @url.query_param('id') || URI.parse(@url).path.split("/")[3]
15
- @feed = nil
16
-
17
- # veeeeeery ugly
18
- page = Hpricot(open(url))
19
- searchterms = page.search("//title").first.inner_html.split("Music Video")
20
- res = Net::HTTP.get(URI.parse("http://api.mtvnservices.com/1/video/search/?term=#{searchterms[0].gsub(' ', '%20')}"))
21
- search = REXML::Document.new(res)
22
- entries = search.elements.to_a("//entry")
23
- entries.each do |entry|
24
- if REXML::XPath.first(entry, "media:content" ).attributes['url'] == "http://media.mtvnservices.com/mgid:uma:video:api.mtvnservices.com:#{@video_id}"
25
- @feed = entry
26
- end
27
- end
28
- end
29
-
30
- def title
31
- REXML::XPath.first(@feed, "//entry/title")[0].to_s
32
- end
33
-
34
- def thumbnail
35
- REXML::XPath.first(@feed, "//media:thumbnail").attributes['url']
36
- end
37
-
38
- def duration
39
- nil
40
- end
41
-
42
- def embed_url
43
- REXML::XPath.first(@feed, "//media:content[@type='application/x-shockwave-flash']").attributes['url']
44
- end
45
-
46
- def embed_html(width=425, height=344, options={})
47
- "<embed src='#{embed_url}' width='#{width}' height='#{height}' type='application/x-shockwave-flash' flashVars='dist=http://www.mtvmusic.com' allowFullScreen='true' AllowScriptAccess='never'></embed>"
48
- end
49
-
50
- # this method fails depending on country restrictions
51
- def flv
52
- res = Net::HTTP.get(URI.parse("http://api-media.mtvnservices.com/player/embed/includes/mediaGen.jhtml?uri=mgid:uma:video:api.mtvnservices.com:#{@video_id}&vid=#{@video_id}&ref=#{CGI::escape "{ref}"}"))
53
- search = REXML::Document.new(res)
54
- REXML::XPath.first(search, "//rendition/src")[0]
55
- end
56
-
57
- def download_url
58
- nil
59
- end
60
-
61
- def service
62
- "MTV Music"
63
- end
64
-
65
- end
@@ -1,66 +0,0 @@
1
- # ----------------------------------------------
2
- # Class for Qik (qik.com)
3
- # http://qik.com/video/340982
4
- # ----------------------------------------------
5
-
6
-
7
- class VgQik
8
-
9
- def initialize(url=nil, options={})
10
- @url = url
11
- @video_id = parse_url(url)
12
- @page = Hpricot(open("http://qik.com/video/#{@video_id}"))
13
- emb = @page.search('//input[@value^="<object"]').first.attributes['value']
14
- tx = Hpricot(emb)
15
- @feed_url = CGI::parse(tx.search('//embed').first.attributes['flashvars'].to_s)["rssURL"].to_s
16
- res = Net::HTTP.get(URI::parse(@feed_url))
17
- @feed = REXML::Document.new(res)
18
- end
19
-
20
- def title
21
- REXML::XPath.first(@feed, "//item/title")[0].to_s
22
- end
23
-
24
- def thumbnail
25
- REXML::XPath.first(@feed, "//item/media:thumbnail").attributes['url']
26
- end
27
-
28
- def embed_url
29
- "http://qik.com/swfs/qikPlayer4.swf?rssURL=#{@feed_url}&autoPlay=false"
30
- end
31
-
32
- def embed_html(width=425, height=344, options={})
33
- "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='#{width}' height='#{height}' id='qikPlayer' align='middle'><param name='allowScriptAccess' value='sameDomain' /><param name='allowFullScreen' value='true' /><param name='movie' value='#{embed_url}' /><param name='quality' value='high' /><param name='bgcolor' value='#333333' /><embed src='#{embed_url}' quality='high' bgcolor='#333333' width='#{width}' height='#{height}' name='qikPlayer' align='middle' allowScriptAccess='sameDomain' allowFullScreen='true' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'/></object>"
34
- end
35
-
36
- def flv
37
- REXML::XPath.first(@feed, "//item/media:content[@type='video/x-flv']").attributes['url']
38
- end
39
-
40
- def download_url
41
- nil
42
- end
43
-
44
- def duration
45
- nil
46
- end
47
-
48
- def service
49
- "Qik"
50
- end
51
-
52
- protected
53
-
54
- def parse_url(url)
55
- video_id = nil
56
- if url.split('#').size > 1
57
- pieces = url.split(/#|=/)
58
- hash = Hash[*pieces]
59
- video_id = hash['v']
60
- else
61
- video_id = url.split("/")[4]
62
- end
63
- video_id
64
- end
65
-
66
- end