transcode 1.0.5 → 1.0.6
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/LICENSE +1 -1
- data/README.adoc +62 -23
- data/bin/transcode +7 -3
- data/lib/transcode/configurator.rb +18 -17
- data/lib/transcode/reporter.rb +4 -3
- data/lib/transcode/string.rb +14 -0
- data/lib/transcode/timer.rb +40 -0
- data/lib/transcode/transcoder.rb +8 -7
- data/lib/transcode/utils.rb +3 -47
- data/lib/transcode/version.rb +4 -4
- data/lib/transcode.rb +2 -2
- metadata +54 -26
- data/.github/dependabot.yml +0 -13
- data/.github/styles/config/vocabularies/Base/accept.txt +0 -5
- data/.github/workflows/actionlint.yml +0 -24
- data/.github/workflows/rake.yml +0 -37
- data/.github/workflows/reuse.yml +0 -18
- data/.github/workflows/rubocop.yml +0 -22
- data/.github/workflows/typos.yml +0 -18
- data/.github/workflows/vale.yml +0 -21
- data/.github/workflows/yamllint.yml +0 -21
- data/.gitignore +0 -13
- data/.travis.yml +0 -14
- data/.vale.ini +0 -7
- data/Gemfile +0 -13
- data/Gemfile.lock +0 -54
- data/LICENSES/0BSD.txt +0 -5
- data/REUSE.toml +0 -14
- data/Rakefile +0 -11
- data/_typos.toml +0 -4
- data/appveyor.yml +0 -28
- data/test/test_utils.rb +0 -30
- data/transcode.gemspec +0 -28
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f440499f81a31db9e875f0cddc6dc09287eab75d505d467385274a903ee77504
|
|
4
|
+
data.tar.gz: 40097203d275461d347bf4f137553e34ccd0f9cb64376a0d6f6d7f488fe5aec2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1a00be08b5cd28da92fc2314d3ce707552fbf0e55f096c139c7d7c41a95d8429e959b82cdcbebf293d40ff04fb42d255379bfd5f105bc68adefdb52094ef0aa6
|
|
7
|
+
data.tar.gz: b8d823e3aa6c74c3deb877d001fce5e569c890dfd17b3272e0214f4b2c3609e04f6b50667e4e53727f62a4c9b98fd3f91b02e0dd5095ea8ca49d6e8573b1932d
|
data/LICENSE
CHANGED
data/README.adoc
CHANGED
|
@@ -2,17 +2,15 @@
|
|
|
2
2
|
:toc: macro
|
|
3
3
|
:!toc-title:
|
|
4
4
|
// URLs:
|
|
5
|
-
:img-build: https://ci.appveyor.com/api/projects/status/yqxb43ltxrjj776a?svg=true
|
|
6
5
|
:img-gem: https://badge.fury.io/rb/transcode.svg
|
|
7
6
|
:img-hoc: https://hitsofcode.com/github/rdavid/transcode?branch=master&label=hits%20of%20code
|
|
8
7
|
:img-license: https://img.shields.io/github/license/rdavid/transcode?color=blue&labelColor=gray&logo=freebsd&logoColor=lightgray&style=flat
|
|
9
8
|
:img-rake: https://github.com/rdavid/transcode/actions/workflows/rake.yml/badge.svg
|
|
10
|
-
:url-build: https://ci.appveyor.com/project/rdavid/transcode
|
|
11
9
|
:url-cv: http://cv.rabkin.co.il
|
|
12
10
|
:url-gem: https://badge.fury.io/rb/transcode
|
|
13
11
|
:url-hoc: https://hitsofcode.com/view/github/rdavid/transcode?branch=master
|
|
14
12
|
:url-license: https://github.com/rdavid/transcode/blob/master/LICENSES/0BSD.txt
|
|
15
|
-
:url-melton: https://lisamelton
|
|
13
|
+
:url-melton: https://github.com/lisamelton/video_transcoding
|
|
16
14
|
:url-rake: https://github.com/rdavid/transcode/actions/workflows/rake.yml
|
|
17
15
|
:url-reuse: https://github.com/fsfe/reuse-action
|
|
18
16
|
:url-requirements: https://github.com/lisamelton/video_transcoding/blob/master/README.md?ts=2#requirements
|
|
@@ -24,7 +22,6 @@
|
|
|
24
22
|
= Transcode
|
|
25
23
|
|
|
26
24
|
image:{img-rake}[rake,link={url-rake}]
|
|
27
|
-
image:{img-build}[build,link={url-build}]
|
|
28
25
|
image:{img-gem}[gem version,link={url-gem}]
|
|
29
26
|
image:{img-hoc}[hits of code,link={url-hoc}]
|
|
30
27
|
image:{img-license}[license,link={url-license}]
|
|
@@ -33,18 +30,32 @@ toc::[]
|
|
|
33
30
|
|
|
34
31
|
== About
|
|
35
32
|
|
|
36
|
-
Transcode is a tool
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
Transcode is a command-line tool that converts whole directories of video
|
|
34
|
+
files in one run.
|
|
35
|
+
It wraps {url-melton}[Lisa Melton's] {url-video}[Video Transcoding],
|
|
36
|
+
which converts one file per invocation, and applies the same workflow
|
|
37
|
+
to every video in a directory with a single command.
|
|
38
|
+
|
|
39
|
+
Transcode can:
|
|
40
|
+
|
|
41
|
+
* Convert an entire directory to `.m4v` in a single run.
|
|
42
|
+
* Select the main audio and burned-in subtitle stream for each file.
|
|
43
|
+
* Extract audio to `.mp3`.
|
|
44
|
+
* Scan files to list their available audio and subtitle streams.
|
|
45
|
+
* Print a summary table of the results.
|
|
46
|
+
|
|
47
|
+
It recognizes these input formats: `avi`, `flv`, `m2ts`, `m4v`, `mkv`,
|
|
48
|
+
`mp4`, `mpg`, `mpeg`, `mov`, `ts`, `webm`, `vob`, and `wmv`.
|
|
39
49
|
|
|
40
50
|
== Installation
|
|
41
51
|
|
|
42
|
-
|
|
43
|
-
It
|
|
44
|
-
|
|
52
|
+
Transcode ships as a Ruby gem and requires Ruby 3.2 or later.
|
|
53
|
+
It runs on macOS, GNU/Linux, Windows, and any other system Ruby
|
|
54
|
+
supports.
|
|
55
|
+
See {url-ruby}[Installing Ruby] if Ruby 3.2+ is not available on your
|
|
45
56
|
platform.
|
|
46
57
|
|
|
47
|
-
|
|
58
|
+
Install with:
|
|
48
59
|
|
|
49
60
|
[,sh]
|
|
50
61
|
----
|
|
@@ -53,7 +64,7 @@ gem install transcode
|
|
|
53
64
|
|
|
54
65
|
== Updating
|
|
55
66
|
|
|
56
|
-
|
|
67
|
+
Update with:
|
|
57
68
|
|
|
58
69
|
[,sh]
|
|
59
70
|
----
|
|
@@ -62,38 +73,66 @@ gem update transcode
|
|
|
62
73
|
|
|
63
74
|
== Requirements
|
|
64
75
|
|
|
65
|
-
See Video Transcoding's {url-requirements}[requirements]
|
|
76
|
+
See Video Transcoding's {url-requirements}[requirements] for external
|
|
77
|
+
dependencies.
|
|
66
78
|
|
|
67
79
|
== Usage
|
|
68
80
|
|
|
69
81
|
[,sh]
|
|
70
82
|
----
|
|
71
83
|
transcode [options]
|
|
72
|
-
-a, --act
|
|
73
|
-
-s, --sca Scans files at the directory.
|
|
74
|
-
-m, --mp3 Converts files to mp3.
|
|
75
|
-
-d, --dir dir Directory to transcode.
|
|
76
|
-
-i, --tit tit Specific title by number.
|
|
77
|
-
-o, --out out Directory to output.
|
|
84
|
+
-a, --act Perform actual encoding.
|
|
78
85
|
-u, --aud aud Audio stream numbers.
|
|
86
|
+
-d, --dir dir Source directory to transcode.
|
|
87
|
+
-m, --mp3 Convert files to MP3.
|
|
88
|
+
-o, --out out Output directory.
|
|
89
|
+
-s, --sca Scan files in the directory.
|
|
79
90
|
-t, --sub sub Subtitle stream numbers.
|
|
91
|
+
-i, --tit tit Specific title number.
|
|
92
|
+
-v, --version Show version.
|
|
80
93
|
-w, --wid wid Width of the table.
|
|
81
|
-
-v, --version Shows version.
|
|
82
94
|
----
|
|
83
95
|
|
|
84
|
-
|
|
96
|
+
Transcode performs a dry run by default.
|
|
97
|
+
It prints the commands it would run and a summary table without changing any
|
|
98
|
+
files.
|
|
99
|
+
Pass `--act` to start the encoding.
|
|
100
|
+
|
|
101
|
+
Without `--dir` and `--out`, Transcode reads from and writes to the current
|
|
102
|
+
directory.
|
|
103
|
+
The `--aud` and `--sub` options take comma-separated stream numbers, either
|
|
104
|
+
one value applied to every file or one value per file.
|
|
105
|
+
|
|
106
|
+
== Examples
|
|
107
|
+
|
|
108
|
+
Scan the source directory to inspect the available audio and subtitle
|
|
109
|
+
streams:
|
|
110
|
+
|
|
111
|
+
[,sh]
|
|
112
|
+
----
|
|
113
|
+
transcode --sca --dir [source]
|
|
114
|
+
----
|
|
115
|
+
|
|
116
|
+
Transcode three files from `[source]` to `[destination]` with the selected
|
|
117
|
+
audio and subtitle streams.
|
|
118
|
+
Add `--act` once the plan looks right:
|
|
85
119
|
|
|
86
120
|
[,sh]
|
|
87
121
|
----
|
|
88
122
|
transcode \
|
|
123
|
+
--act \
|
|
89
124
|
--aud 1,3,1 \
|
|
90
125
|
--dir [source] \
|
|
91
126
|
--out [destination] \
|
|
92
127
|
--sub 2,1,3
|
|
93
128
|
----
|
|
94
129
|
|
|
95
|
-
|
|
96
|
-
|
|
130
|
+
Extract the audio of every file in the current directory to `.mp3`:
|
|
131
|
+
|
|
132
|
+
[,sh]
|
|
133
|
+
----
|
|
134
|
+
transcode --mp3 --act
|
|
135
|
+
----
|
|
97
136
|
|
|
98
137
|
== License
|
|
99
138
|
|
data/bin/transcode
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
|
-
# vi:
|
|
5
|
-
# SPDX-FileCopyrightText: 2018-
|
|
4
|
+
# vi: et lbr sw=2 ts=2 tw=79 wrap
|
|
5
|
+
# SPDX-FileCopyrightText: 2018-2026 David Rabkin
|
|
6
6
|
# SPDX-License-Identifier: 0BSD
|
|
7
7
|
|
|
8
8
|
require_relative '../lib/transcode'
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
begin
|
|
11
|
+
Transcode::Transcoder.new.do
|
|
12
|
+
rescue StandardError => e
|
|
13
|
+
abort "transcode: #{e.message}"
|
|
14
|
+
end
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# vi:
|
|
4
|
-
# SPDX-FileCopyrightText: 2018-
|
|
3
|
+
# vi: et lbr sw=2 ts=2 tw=79 wrap
|
|
4
|
+
# SPDX-FileCopyrightText: 2018-2026 David Rabkin
|
|
5
5
|
# SPDX-License-Identifier: 0BSD
|
|
6
6
|
|
|
7
7
|
require 'optparse'
|
|
8
|
+
require_relative 'string'
|
|
8
9
|
|
|
9
10
|
module Transcode
|
|
10
11
|
# Handles input parameters.
|
|
@@ -12,19 +13,19 @@ module Transcode
|
|
|
12
13
|
attr_reader :files
|
|
13
14
|
|
|
14
15
|
DIC = [
|
|
15
|
-
['-a', '--act', '
|
|
16
|
-
['-s', '--sca', 'Scans files at the directory.', nil, :sca],
|
|
17
|
-
['-m', '--mp3', 'Converts files to mp3.', nil, :mp3],
|
|
18
|
-
['-d', '--dir dir', 'Directory to transcode.', String, :dir],
|
|
19
|
-
['-i', '--tit tit', 'Specific title by number.', Array, :tit],
|
|
20
|
-
['-o', '--out out', 'Directory to output.', String, :out],
|
|
16
|
+
['-a', '--act', 'Perform actual encoding.', nil, :act],
|
|
21
17
|
['-u', '--aud aud', 'Audio stream numbers.', Array, :aud],
|
|
18
|
+
['-d', '--dir dir', 'Source directory to transcode.', String, :dir],
|
|
19
|
+
['-m', '--mp3', 'Convert files to MP3.', nil, :mp3],
|
|
20
|
+
['-o', '--out out', 'Output directory.', String, :out],
|
|
21
|
+
['-s', '--sca', 'Scan files in the directory.', nil, :sca],
|
|
22
22
|
['-t', '--sub sub', 'Subtitle stream numbers.', Array, :sub],
|
|
23
|
+
['-i', '--tit tit', 'Specific title number.', Array, :tit],
|
|
23
24
|
['-w', '--wid wid', 'Width of the table.', Integer, :wid]
|
|
24
25
|
].freeze
|
|
25
|
-
EXT = %
|
|
26
|
+
EXT = %w[
|
|
26
27
|
avi flv m2ts m4v mkv mp4 mpg mpeg mov ts webm vob wmv
|
|
27
|
-
].
|
|
28
|
+
].join(',').freeze
|
|
28
29
|
|
|
29
30
|
def add(opt)
|
|
30
31
|
opt.on('-v', '--version', 'Show version.') do
|
|
@@ -54,8 +55,7 @@ module Transcode
|
|
|
54
55
|
@files = Dir.glob("#{dir}/*.{#{EXT}}").select { |f| File.file? f }
|
|
55
56
|
sub = !mp3?
|
|
56
57
|
@files += Dir.glob("#{dir}/*").select { |f| File.directory? f } if sub
|
|
57
|
-
@files.sort_by!
|
|
58
|
-
@files.sort_by!(&:swapcase)
|
|
58
|
+
@files.sort_by! { |f| f.swapcase.naturalized }
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
def validate
|
|
@@ -65,19 +65,19 @@ module Transcode
|
|
|
65
65
|
validate_tit
|
|
66
66
|
validate_val(aud, :aud)
|
|
67
67
|
validate_val(sub, :sub)
|
|
68
|
-
raise "Width of the table
|
|
68
|
+
raise "Width of the table must exceed 14 characters: #{wid}." if wid < 15
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
def validate_dir(dir, isw)
|
|
72
72
|
raise "#{dir}: No such directory." unless File.directory?(dir)
|
|
73
73
|
|
|
74
74
|
err = isw ? File.writable?(dir) : File.readable?(dir)
|
|
75
|
-
raise "#{
|
|
75
|
+
raise "#{dir}: Permission denied." unless err
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
def validate_fil
|
|
79
79
|
bad = files.reject { |f| File.readable?(f) }
|
|
80
|
-
raise "#{dir}
|
|
80
|
+
raise "#{dir} has no #{EXT} files or directories." if files.empty?
|
|
81
81
|
raise "#{bad.join(',')}: Permission denied." unless bad.empty?
|
|
82
82
|
end
|
|
83
83
|
|
|
@@ -101,7 +101,7 @@ module Transcode
|
|
|
101
101
|
if s == 1
|
|
102
102
|
@options[tag] = Array.new(f, val.first)
|
|
103
103
|
else
|
|
104
|
-
raise "#{tag}
|
|
104
|
+
raise "#{tag} count #{s} doesn't match file count #{f}." unless s == f
|
|
105
105
|
end
|
|
106
106
|
end
|
|
107
107
|
|
|
@@ -137,9 +137,10 @@ module Transcode
|
|
|
137
137
|
@options[:sub]
|
|
138
138
|
end
|
|
139
139
|
|
|
140
|
+
# Returns the table width, falling back to the terminal width when the
|
|
141
|
+
# option is not set.
|
|
140
142
|
def wid
|
|
141
143
|
if @options[:wid].nil?
|
|
142
|
-
# Reads current terminal width.
|
|
143
144
|
wid = `tput cols`
|
|
144
145
|
wid.to_s.empty? ? 79 : wid.to_i
|
|
145
146
|
else
|
data/lib/transcode/reporter.rb
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# vi:
|
|
4
|
-
# SPDX-FileCopyrightText: 2018-
|
|
3
|
+
# vi: et lbr sw=2 ts=2 tw=79 wrap
|
|
4
|
+
# SPDX-FileCopyrightText: 2018-2026 David Rabkin
|
|
5
5
|
# SPDX-License-Identifier: 0BSD
|
|
6
6
|
|
|
7
7
|
require 'terminal-table'
|
|
8
|
+
require_relative 'timer'
|
|
8
9
|
require_relative 'utils'
|
|
9
10
|
|
|
10
11
|
module Transcode
|
|
11
|
-
# Formats and prints
|
|
12
|
+
# Formats and prints the summary table.
|
|
12
13
|
class Reporter
|
|
13
14
|
def initialize(act, tit, wid)
|
|
14
15
|
@act = act
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# vi: et lbr sw=2 ts=2 tw=79 wrap
|
|
4
|
+
# SPDX-FileCopyrightText: 2018-2026 David Rabkin
|
|
5
|
+
# SPDX-License-Identifier: 0BSD
|
|
6
|
+
|
|
7
|
+
# Adds a natural sort method. It converts a string such as "Filename 10"
|
|
8
|
+
# into an array with floats in place of numbers, ["Filename", 10.0], as
|
|
9
|
+
# suggested in https://stackoverflow.com/q/4078906.
|
|
10
|
+
class String
|
|
11
|
+
def naturalized
|
|
12
|
+
scan(/[^\d.]+|[\d.]+/).map { |f| f.match?(/\d+(\.\d+)?/) ? f.to_f : f }
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# vi: et lbr sw=2 ts=2 tw=79 wrap
|
|
4
|
+
# SPDX-FileCopyrightText: 2018-2026 David Rabkin
|
|
5
|
+
# SPDX-License-Identifier: 0BSD
|
|
6
|
+
|
|
7
|
+
# Measures elapsed time and reports it as a humanized string.
|
|
8
|
+
class Timer
|
|
9
|
+
@less_sec = 'less than a second'
|
|
10
|
+
class << self
|
|
11
|
+
attr_reader :less_sec
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
DIC = [
|
|
15
|
+
[60, :seconds, :second],
|
|
16
|
+
[60, :minutes, :minute],
|
|
17
|
+
[24, :hours, :hour],
|
|
18
|
+
[1000, :days, :day]
|
|
19
|
+
].freeze
|
|
20
|
+
|
|
21
|
+
def initialize
|
|
22
|
+
@sta = Time.now
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def read
|
|
26
|
+
humanize(Time.now - @sta)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def humanize(sec)
|
|
30
|
+
return '' if sec.nil?
|
|
31
|
+
return Timer.less_sec if sec < 1
|
|
32
|
+
|
|
33
|
+
DIC.filter_map do |cnt, nms, nm1|
|
|
34
|
+
next if sec <= 0
|
|
35
|
+
|
|
36
|
+
sec, n = sec.divmod(cnt)
|
|
37
|
+
"#{n.to_i} #{n.to_i == 1 ? nm1 : nms}"
|
|
38
|
+
end.compact.reverse.join(' ')
|
|
39
|
+
end
|
|
40
|
+
end
|
data/lib/transcode/transcoder.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# vi:
|
|
4
|
-
# SPDX-FileCopyrightText: 2018-
|
|
3
|
+
# vi: et lbr sw=2 ts=2 tw=79 wrap
|
|
4
|
+
# SPDX-FileCopyrightText: 2018-2026 David Rabkin
|
|
5
5
|
# SPDX-License-Identifier: 0BSD
|
|
6
6
|
|
|
7
7
|
require 'English'
|
|
@@ -17,7 +17,8 @@ module Transcode
|
|
|
17
17
|
@rep = Reporter.new(@cfg.act?, "#{@cfg.dir} -> #{@cfg.out}", @cfg.wid)
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
# Runs command and prints output
|
|
20
|
+
# Runs a command and prints its output as it arrives. Returns true on
|
|
21
|
+
# success.
|
|
21
22
|
def run(cmd)
|
|
22
23
|
cmd += ' 2>&1'
|
|
23
24
|
puts "Run: #{cmd}."
|
|
@@ -28,8 +29,8 @@ module Transcode
|
|
|
28
29
|
end
|
|
29
30
|
|
|
30
31
|
def m4v_cmd(file, aud, sub, tit)
|
|
31
|
-
c = 'transcode-video --m4v --no-log --preset veryslow'\
|
|
32
|
-
"
|
|
32
|
+
c = 'transcode-video --m4v --no-log --preset veryslow ' \
|
|
33
|
+
"--output #{@cfg.out}"
|
|
33
34
|
unless tit == '0'
|
|
34
35
|
c += "/#{File.basename(file.shellescape)}-#{tit}.m4v"
|
|
35
36
|
c += " --title #{tit}"
|
|
@@ -39,7 +40,7 @@ module Transcode
|
|
|
39
40
|
c + " #{file.shellescape}"
|
|
40
41
|
end
|
|
41
42
|
|
|
42
|
-
# Converts
|
|
43
|
+
# Converts file, audio, subtitle, and title arrays into an array:
|
|
43
44
|
# [ file1 [ aud1, sub1, tit1 ] ]
|
|
44
45
|
# [ file2 [ aud2, sub2, tit2 ] ]
|
|
45
46
|
def data
|
|
@@ -55,7 +56,7 @@ module Transcode
|
|
|
55
56
|
|
|
56
57
|
def mp3_cmd(file)
|
|
57
58
|
file = file.shellescape
|
|
58
|
-
"ffmpeg -i #{file} -vn -ar 44100 -ac 2 -ab 192k -f mp3 "\
|
|
59
|
+
"ffmpeg -i #{file} -vn -ar 44100 -ac 2 -ab 192k -f mp3 " \
|
|
59
60
|
"#{@cfg.out}/#{File.basename(file, '.*')}.mp3"
|
|
60
61
|
end
|
|
61
62
|
|
data/lib/transcode/utils.rb
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# vi:
|
|
4
|
-
# SPDX-FileCopyrightText: 2018-
|
|
3
|
+
# vi: et lbr sw=2 ts=2 tw=79 wrap
|
|
4
|
+
# SPDX-FileCopyrightText: 2018-2026 David Rabkin
|
|
5
5
|
# SPDX-License-Identifier: 0BSD
|
|
6
6
|
|
|
7
7
|
require 'ellipsized'
|
|
8
8
|
|
|
9
|
-
#
|
|
9
|
+
# Provides string helpers as class methods.
|
|
10
10
|
class Utils
|
|
11
11
|
@sep = '~'
|
|
12
12
|
class << self
|
|
@@ -17,47 +17,3 @@ class Utils
|
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
|
-
|
|
21
|
-
# Returns string with humanized time interval.
|
|
22
|
-
class Timer
|
|
23
|
-
@less_sec = 'less than a second'
|
|
24
|
-
class << self
|
|
25
|
-
attr_reader :less_sec
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
DIC = [
|
|
29
|
-
[60, :seconds, :second],
|
|
30
|
-
[60, :minutes, :minute],
|
|
31
|
-
[24, :hours, :hour],
|
|
32
|
-
[1000, :days, :day]
|
|
33
|
-
].freeze
|
|
34
|
-
|
|
35
|
-
def initialize
|
|
36
|
-
@sta = Time.now
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def read
|
|
40
|
-
humanize(Time.now - @sta)
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def humanize(sec)
|
|
44
|
-
return '' if sec.nil?
|
|
45
|
-
return Timer.less_sec if sec < 1
|
|
46
|
-
|
|
47
|
-
DIC.map do |cnt, nms, nm1|
|
|
48
|
-
next if sec <= 0
|
|
49
|
-
|
|
50
|
-
sec, n = sec.divmod(cnt)
|
|
51
|
-
"#{n.to_i} #{n.to_i != 1 ? nms : nm1}"
|
|
52
|
-
end.compact.reverse.join(' ')
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
# Adds natural sort method. This converts something like "Filename 10" into a
|
|
57
|
-
# simple array with floats in place of numbers [ "Filename", 10.0 ]. See:
|
|
58
|
-
# https://stackoverflow.com/q/4078906
|
|
59
|
-
class String
|
|
60
|
-
def naturalized
|
|
61
|
-
scan(/[^\d.]+|[\d.]+/).collect { |f| f.match(/\d+(\.\d+)?/) ? f.to_f : f }
|
|
62
|
-
end
|
|
63
|
-
end
|
data/lib/transcode/version.rb
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# vi:
|
|
4
|
-
# SPDX-FileCopyrightText: 2020-
|
|
3
|
+
# vi: et lbr sw=2 ts=2 tw=79 wrap
|
|
4
|
+
# SPDX-FileCopyrightText: 2020-2026 David Rabkin
|
|
5
5
|
# SPDX-License-Identifier: 0BSD
|
|
6
6
|
|
|
7
7
|
module Transcode
|
|
8
|
-
VERSION = '1.0.
|
|
9
|
-
DATE = '
|
|
8
|
+
VERSION = '1.0.6'
|
|
9
|
+
DATE = '2026-07-15'
|
|
10
10
|
end
|
data/lib/transcode.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# vi:
|
|
4
|
-
# SPDX-FileCopyrightText: 2018-
|
|
3
|
+
# vi: et lbr sw=2 ts=2 tw=79 wrap
|
|
4
|
+
# SPDX-FileCopyrightText: 2018-2026 David Rabkin
|
|
5
5
|
# SPDX-License-Identifier: 0BSD
|
|
6
6
|
|
|
7
7
|
require_relative 'transcode/transcoder'
|
metadata
CHANGED
|
@@ -1,15 +1,59 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: transcode
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Rabkin
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
-
dependencies:
|
|
12
|
-
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: ellipsized
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - "~>"
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0.3'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - "~>"
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0.3'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: terminal-table
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - "~>"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '4.0'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - "~>"
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '4.0'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: video_transcoding
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - "~>"
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '0.25'
|
|
47
|
+
type: :runtime
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - "~>"
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '0.25'
|
|
54
|
+
description: |2
|
|
55
|
+
Transcode wraps Lisa Melton's Video Transcoding and converts whole
|
|
56
|
+
directories of video files in one run.
|
|
13
57
|
email: david@rabkin.co.il
|
|
14
58
|
executables:
|
|
15
59
|
- transcode
|
|
@@ -18,41 +62,25 @@ extra_rdoc_files:
|
|
|
18
62
|
- LICENSE
|
|
19
63
|
- README.adoc
|
|
20
64
|
files:
|
|
21
|
-
- ".github/dependabot.yml"
|
|
22
|
-
- ".github/styles/config/vocabularies/Base/accept.txt"
|
|
23
|
-
- ".github/workflows/actionlint.yml"
|
|
24
|
-
- ".github/workflows/rake.yml"
|
|
25
|
-
- ".github/workflows/reuse.yml"
|
|
26
|
-
- ".github/workflows/rubocop.yml"
|
|
27
|
-
- ".github/workflows/typos.yml"
|
|
28
|
-
- ".github/workflows/vale.yml"
|
|
29
|
-
- ".github/workflows/yamllint.yml"
|
|
30
|
-
- ".gitignore"
|
|
31
|
-
- ".travis.yml"
|
|
32
|
-
- ".vale.ini"
|
|
33
|
-
- Gemfile
|
|
34
|
-
- Gemfile.lock
|
|
35
65
|
- LICENSE
|
|
36
|
-
- LICENSES/0BSD.txt
|
|
37
66
|
- README.adoc
|
|
38
|
-
- REUSE.toml
|
|
39
|
-
- Rakefile
|
|
40
|
-
- _typos.toml
|
|
41
|
-
- appveyor.yml
|
|
42
67
|
- bin/transcode
|
|
43
68
|
- lib/transcode.rb
|
|
44
69
|
- lib/transcode/configurator.rb
|
|
45
70
|
- lib/transcode/reporter.rb
|
|
71
|
+
- lib/transcode/string.rb
|
|
72
|
+
- lib/transcode/timer.rb
|
|
46
73
|
- lib/transcode/transcoder.rb
|
|
47
74
|
- lib/transcode/utils.rb
|
|
48
75
|
- lib/transcode/version.rb
|
|
49
|
-
- test/test_utils.rb
|
|
50
|
-
- transcode.gemspec
|
|
51
76
|
homepage: https://github.com/rdavid/transcode
|
|
52
77
|
licenses:
|
|
53
78
|
- 0BSD
|
|
54
79
|
metadata:
|
|
80
|
+
bug_tracker_uri: https://github.com/rdavid/transcode/issues
|
|
81
|
+
homepage_uri: https://github.com/rdavid/transcode
|
|
55
82
|
rubygems_mfa_required: 'true'
|
|
83
|
+
source_code_uri: https://github.com/rdavid/transcode
|
|
56
84
|
rdoc_options: []
|
|
57
85
|
require_paths:
|
|
58
86
|
- lib
|
|
@@ -69,5 +97,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
69
97
|
requirements: []
|
|
70
98
|
rubygems_version: 3.6.9
|
|
71
99
|
specification_version: 4
|
|
72
|
-
summary:
|
|
100
|
+
summary: Tool to transcode batches of video files
|
|
73
101
|
test_files: []
|
data/.github/dependabot.yml
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2023-2025 David Rabkin
|
|
2
|
-
# SPDX-License-Identifier: 0BSD
|
|
3
|
-
---
|
|
4
|
-
version: 2
|
|
5
|
-
updates:
|
|
6
|
-
- package-ecosystem: github-actions
|
|
7
|
-
directory: /
|
|
8
|
-
schedule:
|
|
9
|
-
interval: daily
|
|
10
|
-
- package-ecosystem: bundler
|
|
11
|
-
directory: /
|
|
12
|
-
schedule:
|
|
13
|
-
interval: daily
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2025 David Rabkin
|
|
2
|
-
# SPDX-License-Identifier: 0BSD
|
|
3
|
-
---
|
|
4
|
-
name: actionlint
|
|
5
|
-
'on':
|
|
6
|
-
push:
|
|
7
|
-
branches:
|
|
8
|
-
- master
|
|
9
|
-
pull_request:
|
|
10
|
-
branches:
|
|
11
|
-
- master
|
|
12
|
-
env:
|
|
13
|
-
URL: https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash # yamllint disable-line
|
|
14
|
-
jobs:
|
|
15
|
-
actionlint:
|
|
16
|
-
timeout-minutes: 15
|
|
17
|
-
runs-on: ubuntu-24.04
|
|
18
|
-
steps:
|
|
19
|
-
- uses: actions/checkout@v4
|
|
20
|
-
- name: Download actionlint
|
|
21
|
-
id: get_actionlint
|
|
22
|
-
run: bash <(curl "$URL")
|
|
23
|
-
- name: Check workflow files
|
|
24
|
-
run: ${{ steps.get_actionlint.outputs.executable }} -color
|
data/.github/workflows/rake.yml
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2025 David Rabkin
|
|
2
|
-
# SPDX-License-Identifier: 0BSD
|
|
3
|
-
---
|
|
4
|
-
name: rake
|
|
5
|
-
'on':
|
|
6
|
-
push:
|
|
7
|
-
branches:
|
|
8
|
-
- master
|
|
9
|
-
pull_request:
|
|
10
|
-
branches:
|
|
11
|
-
- master
|
|
12
|
-
jobs:
|
|
13
|
-
rake:
|
|
14
|
-
strategy:
|
|
15
|
-
fail-fast: false
|
|
16
|
-
matrix:
|
|
17
|
-
os:
|
|
18
|
-
- macos-13
|
|
19
|
-
- macos-14
|
|
20
|
-
- macos-15
|
|
21
|
-
- ubuntu-22.04
|
|
22
|
-
- ubuntu-24.04
|
|
23
|
-
- windows-2022
|
|
24
|
-
- windows-2025
|
|
25
|
-
ruby:
|
|
26
|
-
- 3.2
|
|
27
|
-
- 3.3
|
|
28
|
-
- 3.4
|
|
29
|
-
name: Rake on ${{ matrix.os }} / Ruby ${{ matrix.ruby }}
|
|
30
|
-
runs-on: ${{ matrix.os }}
|
|
31
|
-
steps:
|
|
32
|
-
- uses: actions/checkout@v4
|
|
33
|
-
- uses: ruby/setup-ruby@v1
|
|
34
|
-
with:
|
|
35
|
-
ruby-version: ${{ matrix.ruby }}
|
|
36
|
-
bundler-cache: true
|
|
37
|
-
- run: bundle exec rake
|
data/.github/workflows/reuse.yml
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2025 David Rabkin
|
|
2
|
-
# SPDX-License-Identifier: 0BSD
|
|
3
|
-
---
|
|
4
|
-
name: reuse
|
|
5
|
-
'on':
|
|
6
|
-
push:
|
|
7
|
-
branches:
|
|
8
|
-
- master
|
|
9
|
-
pull_request:
|
|
10
|
-
branches:
|
|
11
|
-
- master
|
|
12
|
-
jobs:
|
|
13
|
-
reuse:
|
|
14
|
-
timeout-minutes: 15
|
|
15
|
-
runs-on: ubuntu-24.04
|
|
16
|
-
steps:
|
|
17
|
-
- uses: actions/checkout@v4
|
|
18
|
-
- uses: fsfe/reuse-action@v5
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2025 David Rabkin
|
|
2
|
-
# SPDX-License-Identifier: 0BSD
|
|
3
|
-
---
|
|
4
|
-
name: rubocop
|
|
5
|
-
'on':
|
|
6
|
-
push:
|
|
7
|
-
branches:
|
|
8
|
-
- master
|
|
9
|
-
pull_request:
|
|
10
|
-
branches:
|
|
11
|
-
- master
|
|
12
|
-
jobs:
|
|
13
|
-
rubocop:
|
|
14
|
-
timeout-minutes: 15
|
|
15
|
-
runs-on: ubuntu-24.04
|
|
16
|
-
steps:
|
|
17
|
-
- uses: actions/checkout@v4
|
|
18
|
-
- uses: andrewmcodes/rubocop-linter-action@v3.3.0
|
|
19
|
-
env:
|
|
20
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
21
|
-
with:
|
|
22
|
-
exit_on_failure: true
|
data/.github/workflows/typos.yml
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2025 David Rabkin
|
|
2
|
-
# SPDX-License-Identifier: 0BSD
|
|
3
|
-
---
|
|
4
|
-
name: typos
|
|
5
|
-
'on':
|
|
6
|
-
push:
|
|
7
|
-
branches:
|
|
8
|
-
- master
|
|
9
|
-
pull_request:
|
|
10
|
-
branches:
|
|
11
|
-
- master
|
|
12
|
-
jobs:
|
|
13
|
-
typos:
|
|
14
|
-
timeout-minutes: 15
|
|
15
|
-
runs-on: ubuntu-24.04
|
|
16
|
-
steps:
|
|
17
|
-
- uses: actions/checkout@v4
|
|
18
|
-
- uses: crate-ci/typos@v1.34.0
|
data/.github/workflows/vale.yml
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2025 David Rabkin
|
|
2
|
-
# SPDX-License-Identifier: 0BSD
|
|
3
|
-
---
|
|
4
|
-
name: vale
|
|
5
|
-
'on':
|
|
6
|
-
push:
|
|
7
|
-
branches:
|
|
8
|
-
- master
|
|
9
|
-
pull_request:
|
|
10
|
-
branches:
|
|
11
|
-
- master
|
|
12
|
-
jobs:
|
|
13
|
-
vale:
|
|
14
|
-
timeout-minutes: 15
|
|
15
|
-
runs-on: ubuntu-24.04
|
|
16
|
-
steps:
|
|
17
|
-
- uses: actions/checkout@v4
|
|
18
|
-
- run: sudo apt-get install asciidoctor
|
|
19
|
-
- uses: errata-ai/vale-action@reviewdog
|
|
20
|
-
with:
|
|
21
|
-
fail_on_error: true
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2025 David Rabkin
|
|
2
|
-
# SPDX-License-Identifier: 0BSD
|
|
3
|
-
---
|
|
4
|
-
name: yamllint
|
|
5
|
-
'on':
|
|
6
|
-
push:
|
|
7
|
-
branches:
|
|
8
|
-
- master
|
|
9
|
-
pull_request:
|
|
10
|
-
branches:
|
|
11
|
-
- master
|
|
12
|
-
jobs:
|
|
13
|
-
yamllint:
|
|
14
|
-
timeout-minutes: 15
|
|
15
|
-
runs-on: ubuntu-24.04
|
|
16
|
-
steps:
|
|
17
|
-
- uses: actions/checkout@v4
|
|
18
|
-
- uses: ibiqlik/action-yamllint@v3
|
|
19
|
-
with:
|
|
20
|
-
file_or_dir: ./.github/*.yml ./.github/workflows/*.yml
|
|
21
|
-
strict: true
|
data/.gitignore
DELETED
data/.travis.yml
DELETED
data/.vale.ini
DELETED
data/Gemfile
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# vi:ts=2 sw=2 tw=79 et lbr wrap
|
|
4
|
-
# SPDX-FileCopyrightText: 2020-2025 David Rabkin
|
|
5
|
-
# SPDX-License-Identifier: 0BSD
|
|
6
|
-
|
|
7
|
-
source 'https://rubygems.org'
|
|
8
|
-
gem 'ellipsized'
|
|
9
|
-
gem 'minitest'
|
|
10
|
-
gem 'rake'
|
|
11
|
-
gem 'rubocop'
|
|
12
|
-
gem 'terminal-table'
|
|
13
|
-
gem 'video_transcoding'
|
data/Gemfile.lock
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
GEM
|
|
2
|
-
remote: https://rubygems.org/
|
|
3
|
-
specs:
|
|
4
|
-
ast (2.4.3)
|
|
5
|
-
ellipsized (0.3.0)
|
|
6
|
-
json (2.13.2)
|
|
7
|
-
language_server-protocol (3.17.0.5)
|
|
8
|
-
lint_roller (1.1.0)
|
|
9
|
-
minitest (5.25.5)
|
|
10
|
-
parallel (1.27.0)
|
|
11
|
-
parser (3.3.9.0)
|
|
12
|
-
ast (~> 2.4.1)
|
|
13
|
-
racc
|
|
14
|
-
prism (1.4.0)
|
|
15
|
-
racc (1.8.1)
|
|
16
|
-
rainbow (3.1.1)
|
|
17
|
-
rake (13.3.0)
|
|
18
|
-
regexp_parser (2.11.0)
|
|
19
|
-
rubocop (1.79.1)
|
|
20
|
-
json (~> 2.3)
|
|
21
|
-
language_server-protocol (~> 3.17.0.2)
|
|
22
|
-
lint_roller (~> 1.1.0)
|
|
23
|
-
parallel (~> 1.10)
|
|
24
|
-
parser (>= 3.3.0.2)
|
|
25
|
-
rainbow (>= 2.2.2, < 4.0)
|
|
26
|
-
regexp_parser (>= 2.9.3, < 3.0)
|
|
27
|
-
rubocop-ast (>= 1.46.0, < 2.0)
|
|
28
|
-
ruby-progressbar (~> 1.7)
|
|
29
|
-
unicode-display_width (>= 2.4.0, < 4.0)
|
|
30
|
-
rubocop-ast (1.46.0)
|
|
31
|
-
parser (>= 3.3.7.2)
|
|
32
|
-
prism (~> 1.4)
|
|
33
|
-
ruby-progressbar (1.13.0)
|
|
34
|
-
terminal-table (4.0.0)
|
|
35
|
-
unicode-display_width (>= 1.1.1, < 4)
|
|
36
|
-
unicode-display_width (3.1.4)
|
|
37
|
-
unicode-emoji (~> 4.0, >= 4.0.4)
|
|
38
|
-
unicode-emoji (4.0.4)
|
|
39
|
-
video_transcoding (0.25.3)
|
|
40
|
-
|
|
41
|
-
PLATFORMS
|
|
42
|
-
arm64-darwin-24
|
|
43
|
-
ruby
|
|
44
|
-
|
|
45
|
-
DEPENDENCIES
|
|
46
|
-
ellipsized
|
|
47
|
-
minitest
|
|
48
|
-
rake
|
|
49
|
-
rubocop
|
|
50
|
-
terminal-table
|
|
51
|
-
video_transcoding
|
|
52
|
-
|
|
53
|
-
BUNDLED WITH
|
|
54
|
-
2.7.1
|
data/LICENSES/0BSD.txt
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
Copyright 2020-2025 David Rabkin
|
|
2
|
-
|
|
3
|
-
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
|
|
4
|
-
|
|
5
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
data/REUSE.toml
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2025 David Rabkin
|
|
2
|
-
# SPDX-License-Identifier: 0BSD
|
|
3
|
-
version = 1
|
|
4
|
-
[[annotations]]
|
|
5
|
-
path = [
|
|
6
|
-
".github/styles/**",
|
|
7
|
-
".gitignore",
|
|
8
|
-
".vale.ini",
|
|
9
|
-
"Gemfile.lock",
|
|
10
|
-
"README.adoc",
|
|
11
|
-
]
|
|
12
|
-
precedence = "override"
|
|
13
|
-
SPDX-FileCopyrightText = "2025 David Rabkin"
|
|
14
|
-
SPDX-License-Identifier = "0BSD"
|
data/Rakefile
DELETED
data/_typos.toml
DELETED
data/appveyor.yml
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: 2023-2025 David Rabkin
|
|
2
|
-
# SPDX-License-Identifier: 0BSD
|
|
3
|
-
---
|
|
4
|
-
version: '{build}'
|
|
5
|
-
skip_tags: true
|
|
6
|
-
clone_depth: 10
|
|
7
|
-
branches:
|
|
8
|
-
only:
|
|
9
|
-
- master
|
|
10
|
-
except:
|
|
11
|
-
- gh-pages
|
|
12
|
-
os: Windows Server 2012
|
|
13
|
-
environment:
|
|
14
|
-
matrix:
|
|
15
|
-
- ruby_version: "26-x64"
|
|
16
|
-
install:
|
|
17
|
-
- ps: |
|
|
18
|
-
$Env:PATH = "C:\Ruby${Env:ruby_version}\bin;${Env:PATH}"
|
|
19
|
-
- bundle config --local path vendor/bundle
|
|
20
|
-
- ruby -v
|
|
21
|
-
- bundle -v
|
|
22
|
-
build_script:
|
|
23
|
-
- bundle update
|
|
24
|
-
- bundle install
|
|
25
|
-
test_script:
|
|
26
|
-
- bundle exec rake --quiet
|
|
27
|
-
cache:
|
|
28
|
-
- vendor/bundle
|
data/test/test_utils.rb
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# vi:ts=2 sw=2 tw=79 et lbr wrap
|
|
4
|
-
# SPDX-FileCopyrightText: 2020-2025 David Rabkin
|
|
5
|
-
# SPDX-License-Identifier: 0BSD
|
|
6
|
-
|
|
7
|
-
require 'minitest/autorun'
|
|
8
|
-
require_relative '../lib/transcode/utils'
|
|
9
|
-
|
|
10
|
-
class TestUtils < Minitest::Test
|
|
11
|
-
def setup
|
|
12
|
-
@tim = Timer.new
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def test_timer
|
|
16
|
-
assert_equal(Timer.less_sec, @tim.read)
|
|
17
|
-
sleep(1)
|
|
18
|
-
assert_equal('1 second', @tim.read)
|
|
19
|
-
sleep(1)
|
|
20
|
-
assert_equal('2 seconds', @tim.read)
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def test_trim
|
|
24
|
-
s = Utils.sep
|
|
25
|
-
assert_equal("ni#{s}bo", Utils.trim('ninesymbo', 5))
|
|
26
|
-
assert_equal("te#{s}ls", Utils.trim('tensymbols', 5))
|
|
27
|
-
assert_equal("nin#{s}bo", Utils.trim('ninesymbo', 6))
|
|
28
|
-
assert_equal("ten#{s}ls", Utils.trim('tensymbols', 6))
|
|
29
|
-
end
|
|
30
|
-
end
|
data/transcode.gemspec
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# SPDX-FileCopyrightText: 2023-2025 David Rabkin
|
|
4
|
-
# SPDX-License-Identifier: 0BSD
|
|
5
|
-
|
|
6
|
-
$LOAD_PATH.unshift File.expand_path("#{File.dirname(__FILE__)}/lib")
|
|
7
|
-
|
|
8
|
-
require 'transcode'
|
|
9
|
-
|
|
10
|
-
Gem::Specification.new do |s|
|
|
11
|
-
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
|
12
|
-
s.required_ruby_version = '>=3.2'
|
|
13
|
-
s.name = 'transcode'
|
|
14
|
-
s.version = Transcode::VERSION
|
|
15
|
-
s.date = Transcode::DATE
|
|
16
|
-
s.summary = 'Tools to transcode batch of video files'
|
|
17
|
-
s.description = <<-HERE
|
|
18
|
-
Transcode is a wrapper on Video Transcoding.
|
|
19
|
-
HERE
|
|
20
|
-
s.license = '0BSD'
|
|
21
|
-
s.author = 'David Rabkin'
|
|
22
|
-
s.email = 'david@rabkin.co.il'
|
|
23
|
-
s.homepage = 'https://github.com/rdavid/transcode'
|
|
24
|
-
s.files = `git ls-files`.split($RS)
|
|
25
|
-
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
26
|
-
s.extra_rdoc_files = ['LICENSE', 'README.adoc']
|
|
27
|
-
s.metadata['rubygems_mfa_required'] = 'true'
|
|
28
|
-
end
|