Class: Wordsmith

Inherits:
Object
  • Object
show all
Includes:
Subcommands, CLI, Generate, Init, Publish
Defined in:
lib/wordsmith.rb,
lib/wordsmith/cli.rb,
lib/wordsmith/init.rb,
lib/wordsmith/publish.rb,
lib/wordsmith/version.rb,
lib/wordsmith/generate.rb

Defined Under Namespace

Modules: CLI, Generate, Init, Publish

Constant Summary collapse

OUTPUT_TYPES =
['html', 'epub', 'mobi', 'pdf']
WORDSMITH_ROOT =
File.expand_path(File.join(File.dirname(__FILE__), '..'))
VERSION =
"0.0.6"

Instance Attribute Summary collapse

Attributes included from Generate

#config, #output

Instance Method Summary collapse

Methods included from CLI

#clean, #error, #help, #l, #parse_options, #r, #run

Methods included from Subcommands

#_check_alias, #add_help_option, #add_subcommand_help, #alias_command, #command, #global_options, #list_actions, #opt_parse, #print_actions

Methods included from Publish

#publish

Methods included from Generate

#generate, #run_callback, #setup, #to_epub, #to_html, #to_mobi, #to_pdf

Methods included from Init

#init

Constructor Details

#initializeWordsmith

Returns a new instance of Wordsmith.



27
28
29
30
31
# File 'lib/wordsmith.rb', line 27

def initialize
  @subcommand = nil
  @args = []
  @options = {}
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



21
22
23
# File 'lib/wordsmith.rb', line 21

def args
  @args
end

#filesObject

Returns the value of attribute files.



21
22
23
# File 'lib/wordsmith.rb', line 21

def files
  @files
end

#info(message) ⇒ Object (readonly)

Returns the value of attribute info.



22
23
24
# File 'lib/wordsmith.rb', line 22

def info
  @info
end

#nameObject

Returns the value of attribute name.



21
22
23
# File 'lib/wordsmith.rb', line 21

def name
  @name
end

#optionsObject

Returns the value of attribute options.



21
22
23
# File 'lib/wordsmith.rb', line 21

def options
  @options
end

#stylesheetObject

Returns the value of attribute stylesheet.



21
22
23
# File 'lib/wordsmith.rb', line 21

def stylesheet
  @stylesheet
end

#subcommandObject

Returns the value of attribute subcommand.



21
22
23
# File 'lib/wordsmith.rb', line 21

def subcommand
  @subcommand
end

Instance Method Details

#base(file) ⇒ Object



42
43
44
# File 'lib/wordsmith.rb', line 42

def base(file)
  File.join(WORDSMITH_ROOT, file)
end

#local(file) ⇒ Object



38
39
40
# File 'lib/wordsmith.rb', line 38

def local(file)
  File.expand_path(File.join(Dir.pwd, file))
end