mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
56e96d9344
Removes kindlerb logic Adds template for epub generator Renames the kindle dir to /epub Adds epub module to generator and replaces kindle Fixes mimetype Creates basic epub book Deletes old kindle module Adds zip package Updates rubyzip gem name Removes now unused gepub gem Adds the required container file for epubs Fixes media type Adds new epub generation logic Removes all buttons from output html Refactors and generates valid epub files Removes frontmatter logic used for kindlegen Filters out epub files in zip Updates link to kindle doc on sidebar Fixes rubocop issues Adds deprecation warning for the old kindle task Refactors and cleans up epub module Cleans up epub code Cleans up private internal method code style Removes unnecessary imagemagick check
30 lines
875 B
Ruby
30 lines
875 B
Ruby
# frozen_string_literal: true
|
|
|
|
$:.unshift __dir__
|
|
|
|
as_lib = File.expand_path("../activesupport/lib", __dir__)
|
|
ap_lib = File.expand_path("../actionpack/lib", __dir__)
|
|
av_lib = File.expand_path("../actionview/lib", __dir__)
|
|
|
|
$:.unshift as_lib if File.directory?(as_lib)
|
|
$:.unshift ap_lib if File.directory?(ap_lib)
|
|
$:.unshift av_lib if File.directory?(av_lib)
|
|
|
|
require "rails_guides/generator"
|
|
require "active_support/core_ext/object/blank"
|
|
|
|
env_value = ->(name) { ENV[name].presence }
|
|
env_flag = ->(name) { "1" == env_value[name] }
|
|
|
|
version = env_value["RAILS_VERSION"]
|
|
edge = `git rev-parse HEAD`.strip unless version
|
|
|
|
RailsGuides::Generator.new(
|
|
edge: edge,
|
|
version: version,
|
|
all: env_flag["ALL"],
|
|
only: env_value["ONLY"],
|
|
epub: env_flag["EPUB"],
|
|
language: env_value["GUIDES_LANGUAGE"],
|
|
direction: env_value["DIRECTION"]
|
|
).generate
|