preprocessor 0.1.2 → 0.1.3

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 (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/preprocessor/video.rb +4 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca7f010b3a96606dce5fb0b6c0eae41d9a53462d
4
- data.tar.gz: 15c95f36e903f5f75b61fcab8fa00b76ac8f50b7
3
+ metadata.gz: 4f85b050662948a70b40cb678aebac3aebd1f63c
4
+ data.tar.gz: d5ab18de664037710fed5ed8f1b9a546b423803a
5
5
  SHA512:
6
- metadata.gz: ce0cd238176882d907e79a8d54592b378f8b793eaacfcc74407c9d68968a5f81f195f6b866083d511b33ea65247bef33b8b8f32dd66c5302d8c3ed58c5de2e77
7
- data.tar.gz: a8fe8be3990f97a16c5c97272bc5e67648026ab3da457f6f9013fc21933ef530db82fa166bc3664d189bf8a75923759d6afdaf458579280e05ec7b39199fa93a
6
+ metadata.gz: 36e34d5dacdc9f76e58e0d2b56bffd1e5a71926dced949335aca28477a4467d38e98cdb3af402821a33ccae7811de2de6df37673f03c09e1540c0d12199f8c03
7
+ data.tar.gz: c33454f3e445852736b4e95fdad787f65385a1f4763c6ef5e01ff03a7f644668cbfc6f13379b2efdb6944bedd1964c00bbac0987d0aa0a20b86210cd05daef82
@@ -7,17 +7,18 @@ module Preprocessor
7
7
  @options = { :default_path => '/video' }
8
8
 
9
9
  class YouTube
10
- attr_accessor :src
10
+ attr_accessor :src, :width, :height
11
11
  URL_REGEXP = /youtube\.com\/(?:watch\?v=|v\/)([^\/?&]+)/i
12
12
 
13
13
  def initialize(options)
14
14
  self.src = options[:src]
15
+ self.width = options[:width] || 465
16
+ self.height = options[:height] || 344
15
17
  end
16
18
 
17
19
  def tag
18
20
  if src =~ URL_REGEXP
19
- url = "https://www.youtube.com/v/#{$1}"
20
- %{<object width="425" height="344"><param name="movie" value="#{url}"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="#{url}" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>}
21
+ %{<iframe width="#{width}" height="#{height}" src="https://www.youtube-nocookie.com/embed/#{$1}" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>}
21
22
  end
22
23
  end
23
24
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: preprocessor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandan Lennox