Sha256: 7a0548ebdb4aa971192e6e4ff4065d2545be7ef0d7af03336fe662097076e336

Contents?: true

Size: 1.9 KB

Versions: 54

Compression:

Stored size: 1.9 KB

Contents

require 'polytexnic'
require 'active_support/core_ext/string'
require 'tilt/coffee'
require 'tilt/erb'

@profiling = false

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

if @profiling
  times = []
  Dir[File.join(File.dirname(__FILE__), '/softcover/**/*.rb')].each do |file|
    t1 = Time.now
    next if file =~ /railtie/ && !defined?(Rails)
    require file.chomp(File.extname(file))
    times << "#{Time.now - t1} #{File.basename(file)}"
  end
  $stderr.puts times.sort.reverse
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/check'
require_relative 'softcover/commands/deployment'
require_relative 'softcover/commands/epub_validator'
require_relative 'softcover/commands/exercises'
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?
    @profiling
  end
end

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

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
softcover-1.10.4 lib/softcover.rb
softcover-1.10.3 lib/softcover.rb
softcover-1.10.2 lib/softcover.rb
softcover-1.10.1 lib/softcover.rb
softcover-1.10.0 lib/softcover.rb
softcover-1.9.1 lib/softcover.rb
softcover-1.9.0 lib/softcover.rb
softcover-1.8.3 lib/softcover.rb
softcover-1.8.2 lib/softcover.rb
softcover-1.8.1 lib/softcover.rb
softcover-1.8.0 lib/softcover.rb
softcover-1.7.5 lib/softcover.rb
softcover-1.7.4 lib/softcover.rb
softcover-1.7.3 lib/softcover.rb
softcover-1.7.2 lib/softcover.rb
softcover-1.7.1 lib/softcover.rb
softcover-1.7.0 lib/softcover.rb
softcover-1.6.5 lib/softcover.rb
softcover-1.6.4 lib/softcover.rb
softcover-1.6.3 lib/softcover.rb