jekyll_video 0.1.0 → 0.1.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.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -1
- data/CHANGELOG.md +8 -0
- data/README.md +12 -10
- data/jekyll_video.gemspec +1 -1
- data/lib/jekyll_video/version.rb +1 -1
- data/lib/video.rb +19 -0
- data/spec/spec_helper.rb +0 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0234b4976b372b06ce8922c29b3207aec8cd759b621580ade9788eef6e9b372f
|
4
|
+
data.tar.gz: 2c3d4f9989fc85ed8e55948632c391925d3daf4b8c084262bf737e1ea636eb24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7aae68edc401cdb1694bdda29f1a2b7d9f8a53f05d2a806b1787aa6da4680a31387dbc0c296e2466461de694088c8dede29131841cc8ad057e7ab095a400ea68
|
7
|
+
data.tar.gz: c83658b58c8dbc369ec9cbe22737c6ab8f783f8425d01aa2e0a9bf200ac4247f3e26a633441db23393f1f2f633b6cd836f5ece7f5d9c7cfb2a1c07bf35da4ba2
|
data/.rubocop.yml
CHANGED
@@ -8,7 +8,7 @@ require:
|
|
8
8
|
AllCops:
|
9
9
|
Exclude:
|
10
10
|
- binstub/**/*
|
11
|
-
-
|
11
|
+
- binstub/**/*
|
12
12
|
- vendor/**/*
|
13
13
|
- Gemfile*
|
14
14
|
NewCops: enable
|
@@ -19,6 +19,9 @@ Gemspec/DeprecatedAttributeAssignment:
|
|
19
19
|
Gemspec/RequireMFA:
|
20
20
|
Enabled: false
|
21
21
|
|
22
|
+
Gemspec/RequiredRubyVersion:
|
23
|
+
Enabled: false
|
24
|
+
|
22
25
|
Layout/HashAlignment:
|
23
26
|
EnforcedColonStyle: table
|
24
27
|
EnforcedHashRocketStyle: table
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -22,20 +22,22 @@ $ bundle
|
|
22
22
|
Add the following CSS:
|
23
23
|
|
24
24
|
```css
|
25
|
-
.
|
26
|
-
|
27
|
-
border-radius:
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
25
|
+
.jekyll_plugin_support_error, .jekyll_video_error {
|
26
|
+
background-color: rgb(248, 149, 149);
|
27
|
+
border-radius: 4pt;
|
28
|
+
border: rgb(155, 141, 141) 2px solid;
|
29
|
+
color: black;
|
30
|
+
font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace;
|
31
|
+
font-stretch: semi-condensed;
|
32
|
+
font-size: 9pt;
|
33
|
+
line-height: 150%;
|
34
|
+
padding: 2pt 4pt 2pt 4pt;
|
33
35
|
}
|
34
36
|
```
|
35
37
|
|
36
38
|
## Usage
|
37
39
|
|
38
|
-
See the `demo/` directory for
|
40
|
+
See the [`demo/`](demo/index.html) directory for usage examples.
|
39
41
|
|
40
42
|
|
41
43
|
## Development
|
@@ -46,7 +48,7 @@ After checking out this git repository, install dependencies by typing:
|
|
46
48
|
$ bin/setup
|
47
49
|
```
|
48
50
|
|
49
|
-
You should do the above before
|
51
|
+
You should do the above before opening the project with Visual Studio Code.
|
50
52
|
|
51
53
|
|
52
54
|
### Run the Tests
|
data/jekyll_video.gemspec
CHANGED
@@ -29,5 +29,5 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.summary = 'Embed an HTML video into a web page.'
|
30
30
|
spec.version = JekyllVideo::VERSION
|
31
31
|
spec.add_dependency 'jekyll', '>= 3.5.0'
|
32
|
-
spec.add_dependency 'jekyll_plugin_support', '>= 0.
|
32
|
+
spec.add_dependency 'jekyll_plugin_support', '>= 0.8.6'
|
33
33
|
end
|
data/lib/jekyll_video/version.rb
CHANGED
data/lib/video.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
require 'jekyll_plugin_support'
|
2
|
+
require 'helper/jekyll_plugin_helper'
|
3
|
+
require 'pry'
|
2
4
|
require_relative 'jekyll_video/version'
|
3
5
|
|
4
6
|
# This Jekyll tag plugin is a minimal example.
|
@@ -15,6 +17,8 @@ require_relative 'jekyll_video/version'
|
|
15
17
|
# plugin_loggers:
|
16
18
|
# Video: debug
|
17
19
|
module JekyllVideo
|
20
|
+
VideoError = JekyllSupport.define_error
|
21
|
+
|
18
22
|
# This class implements the Jekyll video functionality
|
19
23
|
class Video < JekyllSupport::JekyllTag
|
20
24
|
PLUGIN_NAME = 'video'.freeze
|
@@ -27,11 +31,26 @@ module JekyllVideo
|
|
27
31
|
style = @helper.parameter_specified?('style') || ''
|
28
32
|
width = @helper.parameter_specified?('width') || '100%'
|
29
33
|
|
34
|
+
remote_video = src.start_with?('http')
|
35
|
+
local_video_exists = !remote_video && File.exist?(src)
|
36
|
+
raise VideoError, "Video file at #{src} referenced by #{@page['path']} does not exist." unless remote_video || local_video_exists
|
37
|
+
|
30
38
|
<<~END_OUTPUT
|
31
39
|
<video class="jekyll_video #{classes}" controls width="#{width}" style="#{style}">
|
32
40
|
<source src="#{src}">
|
41
|
+
|
42
|
+
Your browser does not support HTML video.
|
43
|
+
Here is a <a href="#{src}">link to the video</a>.
|
33
44
|
</video>
|
34
45
|
END_OUTPUT
|
46
|
+
rescue VideoError => e # jekyll_plugin_support handles StandardError
|
47
|
+
e.shorten_backtrace
|
48
|
+
msg = format_error_message e.message
|
49
|
+
@logger.error { "#{e.class} raised #{msg}" }
|
50
|
+
binding.pry if @pry_on_video_error # rubocop:disable Lint/Debugger
|
51
|
+
raise e if @die_on_video_error
|
52
|
+
|
53
|
+
"<div class='jekyll_video_error'>#{e.class} raised in #{@tag_name} tag\n#{msg}</div>"
|
35
54
|
end
|
36
55
|
|
37
56
|
JekyllPluginHelper.register(self, PLUGIN_NAME)
|
data/spec/spec_helper.rb
CHANGED
@@ -6,9 +6,7 @@ require 'yaml'
|
|
6
6
|
require_relative '../lib/<%= @gem_name %>'
|
7
7
|
|
8
8
|
RSpec.configure do |config|
|
9
|
-
config.filter_run :focus
|
10
9
|
# config.order = 'random'
|
11
|
-
config.run_all_when_everything_filtered = true
|
12
10
|
|
13
11
|
# See https://relishapp.com/rspec/rspec-core/docs/command-line/only-failures
|
14
12
|
config.example_status_persistence_file_path = '../spec/status_persistence.txt'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll_video
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Slinn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.8.6
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.8.6
|
41
41
|
description: 'Embed an HTML video into a web page.
|
42
42
|
|
43
43
|
'
|
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
|
-
rubygems_version: 3.
|
87
|
+
rubygems_version: 3.5.10
|
88
88
|
signing_key:
|
89
89
|
specification_version: 4
|
90
90
|
summary: Embed an HTML video into a web page.
|