Sha256: 6050cf0c67a2214d8647042fe1fd8701b03d514a12664fdb0275825ef05ca470

Contents?: true

Size: 806 Bytes

Versions: 3

Compression:

Stored size: 806 Bytes

Contents

# -*- coding: utf-8 -*-

require 'commander'
require_relative '../lib/mailer'

module MailCommand
	def mail(c)
		c.syntax = 'm2m mail [options]'
		c.summary = '将Markdown转换为HTML,并邮件发送给某人'
		c.description = ''
		c.option '-s STRING', '--subject STRING', String, '邮件主题,可选'
		c.option '-a STRING', '--addressee STRING', String, '收件人,可选'
		c.option '--silent', '静默发送,不提示'
		c.option '-m STRING', '--markdown STRING', String, '要发送的markdown文件,如果不指定,则使用最近修改的文件'
		c.action do |args, options|
			util = Util.instance
			#合并目录
			util.workbench = util.get_merge_path('./')
			mailer = Mailer.new
			mailer.send options.addressee, options.markdown, options.subject, options.silent
		end
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
m2m-0.2.9 exe/mailer.rb
m2m-0.2.8 exe/mailer.rb
m2m-0.2.7 exe/mailer.rb