Skip to content

Instantly share code, notes, and snippets.

View AndorChen's full-sized avatar
💭
I may be slow to respond.

Andor Chen AndorChen

💭
I may be slow to respond.
View GitHub Profile
require 'json'
class String
def camelize
string = self
string.split('_').map(&:capitalize).join('')
end
end
module PandocFilter
require 'fileutils'
# Usage: rake duokanify file=path/to/sample.epub
desc 'Adds dtb:depth to ncx file in an ePub'
task :duokanify do
unless ENV['file']
abort("ERROR: Please provide the ePub file path!\nexit")
end
unless ENV['file'].end_with?('.epub')