aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
Diffstat (limited to 'guides')
-rw-r--r--guides/rails_guides.rb14
-rw-r--r--guides/rails_guides/generator.rb25
-rw-r--r--guides/source/configuring.md2
3 files changed, 22 insertions, 19 deletions
diff --git a/guides/rails_guides.rb b/guides/rails_guides.rb
index b24c0205d5..28a7c94ca9 100644
--- a/guides/rails_guides.rb
+++ b/guides/rails_guides.rb
@@ -20,11 +20,11 @@ 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"],
- kindle: env_flag["KINDLE"],
- language: env_value["GUIDES_LANGUAGE"],
- rtl: env_value["RTL"]
+ edge: edge,
+ version: version,
+ all: env_flag["ALL"],
+ only: env_value["ONLY"],
+ kindle: env_flag["KINDLE"],
+ language: env_value["GUIDES_LANGUAGE"],
+ direction: env_value["DIRECTION"].to_sym
).generate
diff --git a/guides/rails_guides/generator.rb b/guides/rails_guides/generator.rb
index 3d8f54ab34..1f0a2063f2 100644
--- a/guides/rails_guides/generator.rb
+++ b/guides/rails_guides/generator.rb
@@ -17,14 +17,14 @@ module RailsGuides
class Generator
GUIDES_RE = /\.(?:erb|md)\z/
- def initialize(edge:, version:, all:, only:, kindle:, language:, rtl: false)
- @edge = edge
- @version = version
- @all = all
- @only = only
- @kindle = kindle
- @language = language
- @rtl = rtl
+ def initialize(edge:, version:, all:, only:, kindle:, language:, direction: :ltr)
+ @edge = edge
+ @version = version
+ @all = all
+ @only = only
+ @kindle = kindle
+ @language = language
+ @direction = direction
if @kindle
check_for_kindlegen
@@ -118,12 +118,15 @@ module RailsGuides
def copy_assets
FileUtils.cp_r(Dir.glob("#{@guides_dir}/assets/*"), @output_dir)
- if @rtl
- FileUtils.rm(Dir.glob("#{@output_dir}/stylesheets/main.css"))
- FileUtils.mv("#{@output_dir}/stylesheets/main.rtl.css", "#{@output_dir}/stylesheets/main.css")
+ if @direction == :rtl
+ overwrite_css_with_right_to_left_direction
end
end
+ def overwrite_css_with_right_to_left_direction
+ FileUtils.mv("#{@output_dir}/stylesheets/main.rtl.css", "#{@output_dir}/stylesheets/main.css")
+ end
+
def output_file_for(guide)
if guide.end_with?(".md")
guide.sub(/md\z/, "html")
diff --git a/guides/source/configuring.md b/guides/source/configuring.md
index de6766e12e..960a43406b 100644
--- a/guides/source/configuring.md
+++ b/guides/source/configuring.md
@@ -813,7 +813,7 @@ normal Rails server.
config.active_storage.paths[:ffprobe] = '/usr/local/bin/ffprobe'
```
-* `config.active_storage.variable_content_types` accepts an array of strings indicating the content types that Active Storage can transform through ImageMagick. The default is `%w(image/png image/gif image/jpg image/jpeg image/vnd.adobe.photoshop image/vnd.microsoft.icon)`.
+* `config.active_storage.variable_content_types` accepts an array of strings indicating the content types that Active Storage can transform through ImageMagick. The default is `%w(image/png image/gif image/jpg image/jpeg image/pjpeg image/vnd.adobe.photoshop image/vnd.microsoft.icon)`.
* `config.active_storage.content_types_to_serve_as_binary` accepts an array of strings indicating the content types that Active Storage will always serve as an attachment, rather than inline. The default is `%w(text/html
text/javascript image/svg+xml application/postscript application/x-shockwave-flash text/xml application/xml application/xhtml+xml)`.