Module: Kindlegen

Defined in:
lib/kindlegen.rb,
lib/kindlegen/version.rb

Constant Summary collapse

Root =
Pathname.new(File.expand_path('../..', __FILE__))
Bin =
Root.join('bin')
VERSION =
'3.1.1'

Class Method Summary collapse

Class Method Details

.commandObject

Getting command path of kindlegen.



13
14
15
# File 'lib/kindlegen.rb', line 13

def self.command
  Bin.join('kindlegen')
end

.run(*params) ⇒ Object

Run kindlegen command with spacified parameters

params

array of command parameters.



22
23
24
25
26
27
# File 'lib/kindlegen.rb', line 22

def self.run( *params )
  clean_env{Open3.capture3(command.to_s, *params)}.map do |r|
    r.force_encoding('UTF-8') if windows? && r.respond_to?(:force_encoding)
    r
  end
end