Class: Wordsmith
- Inherits:
-
Object
- Object
- Wordsmith
- 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.(File.join(File.dirname(__FILE__), '..'))
- VERSION =
"0.0.6"
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#files ⇒ Object
Returns the value of attribute files.
-
#info(message) ⇒ Object
readonly
Returns the value of attribute info.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#stylesheet ⇒ Object
Returns the value of attribute stylesheet.
-
#subcommand ⇒ Object
Returns the value of attribute subcommand.
Attributes included from Generate
Instance Method Summary collapse
- #base(file) ⇒ Object
-
#initialize ⇒ Wordsmith
constructor
A new instance of Wordsmith.
- #local(file) ⇒ Object
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
Methods included from Generate
#generate, #run_callback, #setup, #to_epub, #to_html, #to_mobi, #to_pdf
Methods included from Init
Constructor Details
#initialize ⇒ Wordsmith
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
#args ⇒ Object
Returns the value of attribute args.
21 22 23 |
# File 'lib/wordsmith.rb', line 21 def args @args end |
#files ⇒ Object
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 |
#name ⇒ Object
Returns the value of attribute name.
21 22 23 |
# File 'lib/wordsmith.rb', line 21 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
21 22 23 |
# File 'lib/wordsmith.rb', line 21 def @options end |
#stylesheet ⇒ Object
Returns the value of attribute stylesheet.
21 22 23 |
# File 'lib/wordsmith.rb', line 21 def stylesheet @stylesheet end |
#subcommand ⇒ Object
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.(File.join(Dir.pwd, file)) end |