Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added methods command and run into Kindlegen module.

  • Loading branch information...
commit 806108bcb0e69afb59167fa324f9d9b3e47e1fca 1 parent 056c51b
@tdtds authored
Showing with 22 additions and 1 deletion.
  1. +22 −1 lib/kindlegen.rb
View
23 lib/kindlegen.rb
@@ -1,5 +1,26 @@
require "kindlegen/version"
+require 'pathname'
module Kindlegen
- # Your code goes here...
+ #
+ # Getting command path of kindlegen.
+ # If it required under gem, returning path in the extension.
+ # Not if, it return simply 'kindlegen' so you have to copy the command into $PATH.
+ #
+ def self.command
+ if __FILE__.include? 'gems'
+ (Pathname( __FILE__ ).parent + '../ext/kindlegen/kindlegen').to_s
+ else
+ 'kindlegen'
+ end
+ end
+
+ #
+ # Run kindlegen command with spacified parameters
+ #
+ # _params_:: array of command parameters.
+ #
+ def self.run( *params )
+ system command, *params
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.