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"],
kindle: env_flag["KINDLE"],
language: env_value["GUIDES_LANGUAGE"],
direction: env_value["DIRECTION"].to_sym
direction: env_value["DIRECTION"]
).generate

View File

@ -17,7 +17,7 @@ module RailsGuides
class Generator
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
@version = version
@all = all
@ -118,7 +118,7 @@ module RailsGuides
def copy_assets
FileUtils.cp_r(Dir.glob("#{@guides_dir}/assets/*"), @output_dir)
if @direction == :rtl
if @direction == "rtl"
overwrite_css_with_right_to_left_direction
end
end