Module: M2A::CLI

Extended by:
CLI
Included in:
CLI
Defined in:
lib/m2a/cli.rb,
lib/m2a/cli/argparse.rb

Defined Under Namespace

Modules: Argparse

Instance Method Summary collapse

Instance Method Details

#run!Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/m2a/cli.rb', line 4

def run!
  opts = Argparse::Argparser.new.opts
  m2a = M2A.new.tap do |m2a|
    m2a.configure do |conf|
      conf.width = opts.width if opts.width
      conf.height = opts.height if opts.height
    end
  end

  meme = M2A.lookup_meme(opts.meme)

  puts m2a.render(meme)

end