Sha256: e2c7c8b559aeb87bb39dfcdf76a21993b1b3fa97ad5eff30b68694f9e95faffd
Contents?: true
Size: 1.01 KB
Versions: 4
Compression:
Stored size: 1.01 KB
Contents
#!/usr/bin/env ruby def usage puts "Usage: propaganda [options] input output" puts "" puts " --title=='A Friendly Title' (will detect from filename if omitted)" puts " --template=={default|clean} (will use default if omitted)" puts " --engine=={markdown|textile|none} (will detect from filename if omitted)" puts " --verbose Show errors and warnings" puts " --help" exit end usage if ARGV.size == 0 || ARGV.include?('--help') $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) if ENV['PROPAGANDA_ENV'] == 'test' require 'rubygems' require 'propaganda' def opt(name) p = ARGV.select{|arg| arg =~ /^--#{name}/}.first p.gsub(/^--#{name}=/, '') if p end template = opt "template" title = opt "title" engine = opt "engine" verbose = !opt("verbose").nil? # Grab the params params = ARGV.reject{|arg| arg =~ /^--/} input = params[0] rescue nil output = params[1] rescue nil usage if input.nil? || output.nil? # Run it Propaganda.convert(input, output, title, template, engine, verbose)
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
propaganda-0.4.0 | bin/propaganda |
propaganda-0.3.0 | bin/propaganda |
propaganda-0.2.0 | bin/propaganda |
propaganda-0.1.0 | bin/propaganda |