Sha256: e9799e6567e391cab04246aea4f81a93e8732e1d181467b92ee8a5bcd9b1fe95

Contents?: true

Size: 1.67 KB

Versions: 8

Compression:

Stored size: 1.67 KB

Contents

require 'polytexnic'
require 'active_support/core_ext/string'

require_relative 'softcover/formats'
require_relative 'softcover/utils'
require_relative 'softcover/output'
require_relative 'softcover/directories'

profile = false
if profile
  Dir[File.join(File.dirname(__FILE__), '/softcover/**/*.rb')].each do |file|
    t1 = Time.now
    require file.chomp(File.extname(file))
    $stderr.puts "#{Time.now - t1} #{File.basename(file)}"
  end
end

require_relative 'softcover/book'
require_relative 'softcover/book_manifest'
require_relative 'softcover/builder'
require_relative 'softcover/builders/epub'
require_relative 'softcover/builders/html'
require_relative 'softcover/builders/mobi'
require_relative 'softcover/builders/pdf'
require_relative 'softcover/builders/preview'
require_relative 'softcover/cli'
require_relative 'softcover/commands/auth'
require_relative 'softcover/commands/build'
require_relative 'softcover/commands/deployment'
require_relative 'softcover/commands/epub_validator'
require_relative 'softcover/commands/generator'
require_relative 'softcover/commands/opener'
require_relative 'softcover/commands/server'
require_relative 'softcover/mathjax'
require_relative 'softcover/uploader'
require_relative 'softcover/version'

module Softcover
  extend self

  include Softcover::Utils

  # Return the custom styles, if any.
  def custom_styles
    custom_file = File.join(Softcover::Directories::STYLES, 'custom.sty')
    File.exist?(custom_file) ? File.read(custom_file) : ''
  end

  def set_test_mode!
    @test_mode = true
  end

  def test?
    @test_mode
  end

  def profiling?
    return false if test?
    false
  end
end

require 'softcover/rails/railtie' if defined?(Rails)

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
softcover-0.8.7 lib/softcover.rb
softcover-0.8.6 lib/softcover.rb
softcover-0.8.5 lib/softcover.rb
softcover-0.8.4 lib/softcover.rb
softcover-0.8.3 lib/softcover.rb
softcover-0.8.2 lib/softcover.rb
softcover-0.8.1 lib/softcover.rb
softcover-0.8.0 lib/softcover.rb