Class: WGif::CLI
- Inherits:
-
Object
- Object
- WGif::CLI
- Defined in:
- lib/wgif/cli.rb
Instance Attribute Summary collapse
-
#argument_parser ⇒ Object
Returns the value of attribute argument_parser.
Instance Method Summary collapse
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
- #make_gif(cli_args) ⇒ Object
Constructor Details
#initialize ⇒ CLI
Returns a new instance of CLI.
11 12 13 |
# File 'lib/wgif/cli.rb', line 11 def initialize @argument_parser = WGif::ArgumentParser.new end |
Instance Attribute Details
#argument_parser ⇒ Object
Returns the value of attribute argument_parser.
9 10 11 |
# File 'lib/wgif/cli.rb', line 9 def argument_parser @argument_parser end |
Instance Method Details
#make_gif(cli_args) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/wgif/cli.rb', line 15 def make_gif(cli_args) WGif::Installer.new.run if cli_args[0] == 'install' load_dependencies rescue_errors do args = @argument_parser.parse(cli_args) frames = convert_video(args) GifMaker.new.make_gif(frames, args[:output], args[:dimensions]) display_info(args) if args[:info] upload(args) if args[:upload] preview(args) if args[:preview] end end |