1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use safe nav operator when calling RailsGuides::Generator.new

Use String for direction of RailsGuides::Generator
This commit is contained in:
Yosuke Kabuto 2018-12-05 09:55:22 +09:00
parent 7849e56ba2
commit cb343ef672
2 changed files with 3 additions and 3 deletions

View file

@ -26,5 +26,5 @@ RailsGuides::Generator.new(
only: env_value["ONLY"], only: env_value["ONLY"],
kindle: env_flag["KINDLE"], kindle: env_flag["KINDLE"],
language: env_value["GUIDES_LANGUAGE"], language: env_value["GUIDES_LANGUAGE"],
direction: env_value["DIRECTION"].to_sym direction: env_value["DIRECTION"]
).generate ).generate

View file

@ -17,7 +17,7 @@ module RailsGuides
class Generator class Generator
GUIDES_RE = /\.(?:erb|md)\z/ GUIDES_RE = /\.(?:erb|md)\z/
def initialize(edge:, version:, all:, only:, kindle:, language:, direction: :ltr) def initialize(edge:, version:, all:, only:, kindle:, language:, direction: "ltr")
@edge = edge @edge = edge
@version = version @version = version
@all = all @all = all
@ -118,7 +118,7 @@ module RailsGuides
def copy_assets def copy_assets
FileUtils.cp_r(Dir.glob("#{@guides_dir}/assets/*"), @output_dir) FileUtils.cp_r(Dir.glob("#{@guides_dir}/assets/*"), @output_dir)
if @direction == :rtl if @direction == "rtl"
overwrite_css_with_right_to_left_direction overwrite_css_with_right_to_left_direction
end end
end end