zemus 0.0.12 → 0.0.16

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 25f905849440a06f329e4288e6941e6cd34ecd7b
4
- data.tar.gz: 3467322fef20a79f809495702c56ac34111bc2e4
2
+ SHA256:
3
+ metadata.gz: ca0cb8093507d64a233335866759a3bf7d387c4b0b33e9a919ee1451d09061bb
4
+ data.tar.gz: 15055a0f51e8fc5cb604c4f24e7037c455227ae94fa3cefcccd93cf1fe74daa2
5
5
  SHA512:
6
- metadata.gz: 4359fb188dea3affab0c788af2b6087209aba4486d95212b88843831f7220b8e560d551bb15e6bbcd3f403189db934f9358fdd7480a4b5fea26e9590ab9bc127
7
- data.tar.gz: a73b845a06907489149d442e5fd5cb95881ddf6a70b5698f3d8cdf41c9538a9e24ad446b38185e23fe482190d1c6cdb632ccf93bec78b16a8d69e74a73dae6cf
6
+ metadata.gz: 4e6277696ebff422f840b455e50728e0d78dcf68b462051219488dd06fb4bf9035f6eefb2013e1da12bbf02a740b07a641c8c6f063b66db149772c3af7328dcd
7
+ data.tar.gz: a46aad0424a80c604072a5baa715dee05db7f39a2a6aaedfe90f7197f331919ce905934d1d8ce25d63b517521d2d9261cc4ab81de107b58c462329e3b8c77039
data/.gitignore CHANGED
@@ -5,6 +5,7 @@
5
5
  .config
6
6
  .DS_Store
7
7
  .yardoc
8
+ .ruby-version
8
9
  Gemfile.lock
9
10
  InstalledFiles
10
11
  _yardoc
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.2
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Zemus
2
2
 
3
- Zemus is a ruby gem that translates URLs into embedable code you can insert on a page. It does its magic by simply inspecting and hacking up the URL itself, it makes no external requests to a webservice.
3
+ Zemus is a ruby gem that translates URLs into embeddable code you can insert on a page. It does its magic by simply inspecting and hacking up the URL itself, it makes no external requests to a webservice.
4
4
 
5
5
  Zemus translates the following URLs to embedabble HTML in standard HTML5 mode:
6
6
 
@@ -65,4 +65,4 @@ Travis Newman @travisnewman
65
65
 
66
66
  Zemus was named after the antagonist of Final Fantasy IV.
67
67
 
68
- http://finalfantasy.wikia.com/wiki/Zemus
68
+ http://finalfantasy.wikia.com/wiki/Zemus
@@ -15,7 +15,7 @@ module Zemus
15
15
 
16
16
  def to_embed
17
17
  embed = "<iframe width='100%' height='600px' scrolling='no' src='https://www.kickstarter.com/projects/#{kickstarter_id}/widget/video.html' frameborder='0'> </iframe>"
18
- embed += "<a href='#{url}' target='_blank' class='btn btn-default btn-xs'><i class='glyphicon glyphicon-heart'></i> Back this on Kickstarter!</a>"
18
+ embed += "<a href='#{url}' target='_blank' class='btn btn-primary btn-xs'><i class='fas fa-heart'></i> Back this on Kickstarter!</a>"
19
19
 
20
20
  embed
21
21
  end
data/lib/zemus/sound.rb CHANGED
@@ -12,7 +12,7 @@ module Zemus
12
12
  def to_embed
13
13
  filename = @url.split("/").last
14
14
 
15
- embed = "<audio controls='controls' class='media-object'>"
15
+ embed = "<audio controls='controls' class='media-object' preload='none'>"
16
16
  embed += "<source src='#{@url}' type='audio/mpeg' />"
17
17
  embed += "</audio>"
18
18
  embed += "<div><a href='#{@url}' target='_blank' class='img-thumbnail' download='#{filename}'><i class='glyphicon glyphicon-music'></i> Download this podcast.</a></div>"
@@ -21,4 +21,4 @@ module Zemus
21
21
  end
22
22
 
23
23
  end
24
- end
24
+ end
data/lib/zemus/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Zemus
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.16"
3
3
  end
@@ -1,10 +1,10 @@
1
1
  require_relative('../spec_helper')
2
-
2
+
3
3
  describe Zemus::Image do
4
4
  it "embeds images" do
5
5
  url = "http://google.com/image.gif"
6
6
  Zemus::Image.new(url).to_embed.
7
- should eq("<img src='http://google.com/image.gif' class='img-responsive img-thumbnail' alt='http://google.com/image.gif' />")
7
+ should eq("<img src='http://google.com/image.gif' class='img-responsive' alt='http://google.com/image.gif' />")
8
8
  end
9
9
 
10
10
  end
@@ -1,12 +1,12 @@
1
1
  require_relative('../spec_helper')
2
-
2
+
3
3
  describe Zemus::Kickstarter do
4
4
  it "embeds kickstarter" do
5
5
  Zemus::Kickstarter.new("http://www.kickstarter.com/projects/sleepninja/monsters-ate-my-birthday-cake").to_embed.
6
- should eq("<iframe width='100%' height='600px' scrolling='no' src='http://www.kickstarter.com/projects/sleepninja/monsters-ate-my-birthday-cake/widget/video.html' frameborder='0'> </iframe><a href='http://www.kickstarter.com/projects/sleepninja/monsters-ate-my-birthday-cake' target='_blank' class='btn btn-default btn-xs'><i class='glyphicon glyphicon-heart'></i> Back this on Kickstarter!</a>")
7
-
6
+ should eq("<iframe width='100%' height='600px' scrolling='no' src='https://www.kickstarter.com/projects/sleepninja/monsters-ate-my-birthday-cake/widget/video.html' frameborder='0'> </iframe><a href='http://www.kickstarter.com/projects/sleepninja/monsters-ate-my-birthday-cake' target='_blank' class='btn btn-primary btn-xs'><i class='fas fa-heart'></i> Back this on Kickstarter!</a>")
7
+
8
8
  # fix for a bug where a kickstarter URL had a # sign at the end
9
9
  Zemus::Kickstarter.new("http://www.kickstarter.com/projects/sleepninja/monsters-ate-my-birthday-cake#").to_embed.
10
- should eq("<iframe width='100%' height='600px' scrolling='no' src='http://www.kickstarter.com/projects/sleepninja/monsters-ate-my-birthday-cake/widget/video.html' frameborder='0'> </iframe><a href='http://www.kickstarter.com/projects/sleepninja/monsters-ate-my-birthday-cake' target='_blank' class='btn btn-default btn-xs'><i class='glyphicon glyphicon-heart'></i> Back this on Kickstarter!</a>")
10
+ should eq("<iframe width='100%' height='600px' scrolling='no' src='https://www.kickstarter.com/projects/sleepninja/monsters-ate-my-birthday-cake/widget/video.html' frameborder='0'> </iframe><a href='http://www.kickstarter.com/projects/sleepninja/monsters-ate-my-birthday-cake' target='_blank' class='btn btn-primary btn-xs'><i class='fas fa-heart'></i> Back this on Kickstarter!</a>")
11
11
  end
12
- end
12
+ end
@@ -1,8 +1,8 @@
1
1
  require_relative('../spec_helper')
2
-
2
+
3
3
  describe Zemus::Sound do
4
4
  it "embeds sound" do
5
5
  Zemus::Sound.new("http://www.podtrac.com/pts/redirect.mp3/content.duckfeed.tv/bsc/bsc_E001.mp3").to_embed.
6
- should eq("<audio controls='controls' class='media-object'><source src='http://www.podtrac.com/pts/redirect.mp3/content.duckfeed.tv/bsc/bsc_E001.mp3' type='audio/mpeg' /></audio><div><a href='http://www.podtrac.com/pts/redirect.mp3/content.duckfeed.tv/bsc/bsc_E001.mp3' target='_blank' class='img-thumbnail' download='bsc_E001.mp3'><i class='glyphicon glyphicon-music'></i> Download this podcast.</a></div>")
6
+ should eq("<audio controls='controls' class='media-object' preload='none'><source src='http://www.podtrac.com/pts/redirect.mp3/content.duckfeed.tv/bsc/bsc_E001.mp3' type='audio/mpeg' /></audio><div><a href='http://www.podtrac.com/pts/redirect.mp3/content.duckfeed.tv/bsc/bsc_E001.mp3' target='_blank' class='img-thumbnail' download='bsc_E001.mp3'><i class='glyphicon glyphicon-music'></i> Download this podcast.</a></div>")
7
7
  end
8
- end
8
+ end
@@ -1,8 +1,8 @@
1
1
  require_relative('../spec_helper')
2
-
2
+
3
3
  describe Zemus::Vimeo do
4
4
  it "embeds vimeo" do
5
5
  Zemus::Vimeo.new("http://vimeo.com/21929292").to_embed.
6
- should eq("<iframe src='http://player.vimeo.com/video/21929292' width='100%' height='600px' frameborder='0'></iframe>")
6
+ should eq("<iframe src='https://player.vimeo.com/video/21929292' width='100%' height='600px' frameborder='0'></iframe>")
7
7
  end
8
- end
8
+ end
@@ -1,13 +1,13 @@
1
1
  require_relative('../spec_helper')
2
-
2
+
3
3
  describe Zemus::Youtube do
4
4
  it "embeds youtube" do
5
5
  Zemus::Youtube.new("youtube.com/watch?v=Ai7pMPCDHpo").to_embed.
6
- should eq("<iframe width='100%' height='600px' src='http://www.youtube.com/embed/Ai7pMPCDHpo?wmode=opaque' frameborder='0' allowfullscreen></iframe>")
6
+ should eq("<iframe width='100%' height='600px' src='https://www.youtube.com/embed/Ai7pMPCDHpo?wmode=opaque' frameborder='0' allowfullscreen></iframe>")
7
7
  end
8
8
 
9
9
  it "get youtube embed image" do
10
10
  Zemus::Youtube.new("youtube.com/watch?v=Ai7pMPCDHpo").
11
11
  to_embed_image.should eq("http://img.youtube.com/vi/Ai7pMPCDHpo/hqdefault.jpg")
12
12
  end
13
- end
13
+ end
data/spec/zemus_spec.rb CHANGED
@@ -1,22 +1,22 @@
1
1
  require_relative('./spec_helper')
2
-
2
+
3
3
  describe Zemus do
4
4
 
5
5
  it "accepts test for images" do
6
6
  url = "www.google.com/sample.gif"
7
- Zemus.embed(url).should == "<img src='www.google.com/sample.gif' class='img-responsive img-thumbnail' alt='www.google.com/sample.gif' />"
8
-
7
+ Zemus.embed(url).should == "<img src='www.google.com/sample.gif' class='img-responsive' alt='www.google.com/sample.gif' />"
8
+
9
9
  url = 'http://play-mario-onlne.com/old-school-mario.png'
10
- Zemus.embed(url).should == "<img src='http://play-mario-onlne.com/old-school-mario.png' class='img-responsive img-thumbnail' alt='http://play-mario-onlne.com/old-school-mario.png' />"
10
+ Zemus.embed(url).should == "<img src='http://play-mario-onlne.com/old-school-mario.png' class='img-responsive' alt='http://play-mario-onlne.com/old-school-mario.png' />"
11
11
 
12
12
  url = 'http://play-mario-onlne.com/old-school-mario.jpg'
13
- Zemus.embed(url).should == "<img src='http://play-mario-onlne.com/old-school-mario.jpg' class='img-responsive img-thumbnail' alt='http://play-mario-onlne.com/old-school-mario.jpg' />"
13
+ Zemus.embed(url).should == "<img src='http://play-mario-onlne.com/old-school-mario.jpg' class='img-responsive' alt='http://play-mario-onlne.com/old-school-mario.jpg' />"
14
14
 
15
15
  url = 'http://play-mario-onlne.com/old-school-mario.jpeg'
16
- Zemus.embed(url).should == "<img src='http://play-mario-onlne.com/old-school-mario.jpeg' class='img-responsive img-thumbnail' alt='http://play-mario-onlne.com/old-school-mario.jpeg' />"
17
-
16
+ Zemus.embed(url).should == "<img src='http://play-mario-onlne.com/old-school-mario.jpeg' class='img-responsive' alt='http://play-mario-onlne.com/old-school-mario.jpeg' />"
17
+
18
18
  url = 'http://play-mario-onlne.com/old-school-mario.GIF'
19
- Zemus.embed(url).should == "<img src='http://play-mario-onlne.com/old-school-mario.GIF' class='img-responsive img-thumbnail' alt='http://play-mario-onlne.com/old-school-mario.GIF' />"
19
+ Zemus.embed(url).should == "<img src='http://play-mario-onlne.com/old-school-mario.GIF' class='img-responsive' alt='http://play-mario-onlne.com/old-school-mario.GIF' />"
20
20
  end
21
21
 
22
22
  it "acceptance tests for (kick start) starter" do
@@ -29,7 +29,7 @@ describe Zemus do
29
29
  [ "", "http://", "http://www.", "https://", "https://www." ].each do |subdomain|
30
30
  url = "#{subdomain}#{url_format}"
31
31
 
32
- Zemus.embed(url).should eq("<iframe width='100%' height='600px' src='http://www.youtube.com/embed/Ai7pMPCDHpo?wmode=opaque' frameborder='0' allowfullscreen></iframe>")
32
+ Zemus.embed(url).should eq("<iframe width='100%' height='600px' src='https://www.youtube.com/embed/Ai7pMPCDHpo?wmode=opaque' frameborder='0' allowfullscreen></iframe>")
33
33
  end
34
34
  end
35
35
  end
@@ -37,19 +37,19 @@ describe Zemus do
37
37
  it "acceptance tests for sound" do
38
38
  url = "http://www.podtrac.com/pts/redirect.mp3/content.duckfeed.tv/bsc/bsc_E001.mp3"
39
39
 
40
- Zemus.embed(url).should eq("<audio controls='controls' class='media-object'><source src='http://www.podtrac.com/pts/redirect.mp3/content.duckfeed.tv/bsc/bsc_E001.mp3' type='audio/mpeg' /></audio><div><a href='http://www.podtrac.com/pts/redirect.mp3/content.duckfeed.tv/bsc/bsc_E001.mp3' target='_blank' class='img-thumbnail' download='bsc_E001.mp3'><i class='glyphicon glyphicon-music'></i> Download this podcast.</a></div>")
40
+ Zemus.embed(url).should eq("<audio controls='controls' class='media-object' preload='none'><source src='http://www.podtrac.com/pts/redirect.mp3/content.duckfeed.tv/bsc/bsc_E001.mp3' type='audio/mpeg' /></audio><div><a href='http://www.podtrac.com/pts/redirect.mp3/content.duckfeed.tv/bsc/bsc_E001.mp3' target='_blank' class='img-thumbnail' download='bsc_E001.mp3'><i class='glyphicon glyphicon-music'></i> Download this podcast.</a></div>")
41
41
  end
42
42
 
43
43
  it "acceptance test for sound-claus" do
44
44
  url = "https://soundcloud.com/destructoid/super-mario-world-by-video"
45
-
45
+
46
46
  Zemus.embed(url).should eq("<iframe autosize='false' width='100%' height='166px' scrolling='no' frameborder='no' src='https://w.soundcloud.com/player/?url=https://soundcloud.com/destructoid/super-mario-world-by-video'></iframe>")
47
47
  end
48
48
 
49
49
  it "acceptance test for vimeo" do
50
50
  url = "http://vimeo.com/21929292"
51
51
 
52
- Zemus.embed(url).should eq("<iframe src='http://player.vimeo.com/video/21929292' width='100%' height='600px' frameborder='0'></iframe>")
52
+ Zemus.embed(url).should eq("<iframe src='https://player.vimeo.com/video/21929292' width='100%' height='600px' frameborder='0'></iframe>")
53
53
  end
54
54
 
55
55
  it "acceptance test for vine" do
@@ -57,10 +57,10 @@ describe Zemus do
57
57
 
58
58
  Zemus.embed(url).should eq("<iframe class='vine-embed' src='https://vine.co/v/bFPjjheVnau/embed/simple' width='100%' height='600px' frameborder='0'></iframe><script async src='//platform.vine.co/static/scripts/embed.js' charset='utf-8'></script>")
59
59
  end
60
-
60
+
61
61
  it "acceptance test for the generic fallback" do
62
62
  url = "http://google.com/asdfhjklkjsdf/43123123/32124lkjklj123123/foo.html"
63
63
 
64
64
  Zemus.embed(url).should eq("<a href='http://google.com/asdfhjklkjsdf/43123123/32124lkjklj123123/foo.html' target='_blank'>http://google.com/asdfhjklkjsdf/43123123..</a>")
65
65
  end
66
- end
66
+ end
data/zemus.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_dependency "railties"
22
22
 
23
- spec.add_development_dependency "bundler", "~> 1.3"
23
+ spec.add_development_dependency "bundler", "~> 2.2"
24
24
  spec.add_development_dependency "rake"
25
25
  spec.add_development_dependency "rspec"
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zemus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Dodson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-11-12 00:00:00.000000000 Z
12
+ date: 2021-11-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -31,14 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '1.3'
34
+ version: '2.2'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '1.3'
41
+ version: '2.2'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rake
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -76,6 +76,7 @@ extensions: []
76
76
  extra_rdoc_files: []
77
77
  files:
78
78
  - ".gitignore"
79
+ - ".ruby-version"
79
80
  - Gemfile
80
81
  - LICENSE.txt
81
82
  - README.md
@@ -122,8 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
123
  - !ruby/object:Gem::Version
123
124
  version: '0'
124
125
  requirements: []
125
- rubyforge_project:
126
- rubygems_version: 2.5.1
126
+ rubygems_version: 3.1.4
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: Parses and embeds various media URLs as viewable content