Class: Abrizer::CLI
- Inherits:
-
Thor
- Object
- Thor
- Abrizer::CLI
- Defined in:
- lib/abrizer/cli.rb
Instance Method Summary collapse
- #abr(filepath, output_dir = nil) ⇒ Object
- #adaptations(filepath, output_directory = nil) ⇒ Object
- #all(filepath, output_dir, base_url) ⇒ Object
- #canvas(filepath, output_directory, base_url) ⇒ Object
- #captions(filepath, output_dir = nil) ⇒ Object
- #clean(filepath, output_dir = nil) ⇒ Object
- #data(filepath, output_directory, base_url) ⇒ Object
- #ffprobe(filepath, output_dir) ⇒ Object
- #inform(filepath) ⇒ Object
- #mp3(filepath, output_directory) ⇒ Object
- #mp4(filepath, output_dir = nil) ⇒ Object
- #package(dash_or_hls, filepath, output_dir = nil) ⇒ Object
- #poster(output_dir = nil) ⇒ Object
- #process(filepath, output_dir = nil) ⇒ Object
- #sprites(filepath, output_dir = nil) ⇒ Object
- #vp9(filepath, output_dir = nil) ⇒ Object
Instance Method Details
#abr(filepath, output_dir = nil) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/abrizer/cli.rb', line 25 def abr(filepath, output_dir=nil) filepath = File. filepath output_dir = File. output_dir Abrizer::Processor.process(filepath, output_dir) Abrizer::PackageDashBento.new(filepath, output_dir).package Abrizer::PackageHlsBento.new(filepath, output_dir).package end |
#adaptations(filepath, output_directory = nil) ⇒ Object
55 56 57 58 |
# File 'lib/abrizer/cli.rb', line 55 def adaptations(filepath, output_directory=nil) adaptations = Abrizer::AdaptationsFile.new(filepath, output_directory).adaptations puts adaptations end |
#all(filepath, output_dir, base_url) ⇒ Object
11 12 13 14 15 |
# File 'lib/abrizer/cli.rb', line 11 def all(filepath, output_dir, base_url) filepath = File. filepath output_dir = File. output_dir Abrizer::All.new(filepath, output_dir, base_url).run end |
#canvas(filepath, output_directory, base_url) ⇒ Object
114 115 116 117 118 |
# File 'lib/abrizer/cli.rb', line 114 def canvas(filepath, output_directory, base_url) filepath = File. filepath output_directory = File. output_directory Abrizer::Canvas.new(filepath, output_directory, base_url).create end |
#captions(filepath, output_dir = nil) ⇒ Object
107 108 109 110 111 |
# File 'lib/abrizer/cli.rb', line 107 def (filepath, output_dir=nil) filepath = File. filepath output_dir = File. output_dir Abrizer::Captions.new(filepath, output_dir).copy end |
#clean(filepath, output_dir = nil) ⇒ Object
127 128 129 |
# File 'lib/abrizer/cli.rb', line 127 def clean(filepath, output_dir=nil) Abrizer::Cleaner.new(filepath, output_dir).clean end |
#data(filepath, output_directory, base_url) ⇒ Object
121 122 123 124 |
# File 'lib/abrizer/cli.rb', line 121 def data(filepath, output_directory, base_url) output_directory = File. output_directory Abrizer::Data.new(filepath, output_directory, base_url).create end |
#ffprobe(filepath, output_dir) ⇒ Object
18 19 20 21 22 |
# File 'lib/abrizer/cli.rb', line 18 def ffprobe(filepath, output_dir) filepath = File. filepath output_dir = File. output_dir Abrizer::FfprobeFile.new(filepath, output_dir).run end |
#inform(filepath) ⇒ Object
61 62 63 64 65 |
# File 'lib/abrizer/cli.rb', line 61 def inform(filepath) informer = FfprobeInformer.new(filepath) puts informer.json_result puts informer end |
#mp3(filepath, output_directory) ⇒ Object
85 86 87 88 89 90 91 |
# File 'lib/abrizer/cli.rb', line 85 def mp3(filepath, output_directory) # TODO: repeating expanding filepath and output_directory is probably the # most annoying thing in this library. DRY this up somehow. filepath = File. filepath output_dir = File. output_directory Abrizer::ProgressiveMp3.new(filepath, output_dir).create end |
#mp4(filepath, output_dir = nil) ⇒ Object
41 42 43 44 45 |
# File 'lib/abrizer/cli.rb', line 41 def mp4(filepath, output_dir=nil) filepath = File. filepath output_dir = File. output_dir Abrizer::ProgressiveMp4.new(filepath, output_dir).create end |
#package(dash_or_hls, filepath, output_dir = nil) ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/abrizer/cli.rb', line 68 def package(dash_or_hls, filepath, output_dir=nil) filepath = File. filepath output_dir = File. output_dir case dash_or_hls when "dash" Abrizer::PackageDashBento.new(filepath, output_dir).package when "hls" Abrizer::PackageHlsBento.new(filepath, output_dir).package when "all" Abrizer::PackageDashBento.new(filepath, output_dir).package Abrizer::PackageHlsBento.new(filepath, output_dir).package else puts "Not a valid packaging value. Try dash or hls." end end |
#poster(output_dir = nil) ⇒ Object
101 102 103 104 |
# File 'lib/abrizer/cli.rb', line 101 def poster(output_dir=nil) output_dir = File. output_dir Abrizer::TemporaryPoster.new(output_dir).copy end |
#process(filepath, output_dir = nil) ⇒ Object
34 35 36 37 38 |
# File 'lib/abrizer/cli.rb', line 34 def process(filepath, output_dir=nil) filepath = File. filepath output_dir = File. output_dir Abrizer::Processor.process(filepath, output_dir) end |
#sprites(filepath, output_dir = nil) ⇒ Object
94 95 96 97 98 |
# File 'lib/abrizer/cli.rb', line 94 def sprites(filepath, output_dir=nil) filepath = File. filepath output_dir = File. output_dir Abrizer::Sprites.new(filepath, output_dir).create end |
#vp9(filepath, output_dir = nil) ⇒ Object
48 49 50 51 52 |
# File 'lib/abrizer/cli.rb', line 48 def vp9(filepath, output_dir=nil) filepath = File. filepath output_dir = File. output_dir Abrizer::ProgressiveVp9.new(filepath, output_dir).create end |