Sha256: 018878366d4a751387b74982bcaabc2c15e632f43b979ac33943da6994dbbe5d

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

#!/usr/bin/env ruby

require 'commander/import'
require 'html_email_creator'
require 'html_email_creator/version'
require 'html_email_creator/information'

# :name is optional, otherwise uses the basename of this executable
program :name, 'HTML Email Creator'
program :version, HtmlEmailCreator::VERSION
program :description, HtmlEmailCreator::DESCRIPTION

command :create do |c|
  c.syntax = 'html_email_creator create <email or directory>'
  c.description = 'Creates a single email or all emails from the directory'
  c.option '--recursive', 'If creating directory, find from sub directories too.'
  c.action do |args, options|
    # TODO implement me
    recursive = options.recursive ? true : false
    full_path = File.expand_path(args.first)
    # run in this directory
    Dir.chdir(File.dirname(full_path))
    results = HtmlEmailCreator::EmailCreator.new.save_emails(full_path, recursive)
    say "Creation completed!\n\n"
    results.each_pair do |file, format|
      say "#{file}:"
      say "  Output:"
      format.values.each do |output|

        say "    #{output}"
      end
    end
    say "\nHave a nice day :)"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
html_email_creator-1.0.0 bin/html_email_creator