This repository was archived by the owner on Aug 15, 2020. It is now read-only.
File tree 6 files changed +17
-6
lines changed
6 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,11 @@ def team_link(input)
73
73
# puts "L 143 author.rb: No such author: #{input} in #{@page_path}"
74
74
author_data = SiteData ::AuthorData . new
75
75
full_name = author_data . fetch ( input , 'full_name' )
76
- full_name || puts "author.rb#team_link: No such author: #{ input } in #{ @page_path } " . red
76
+ if full_name
77
+ full_name
78
+ else
79
+ puts "author.rb#team_link: No such author: #{ input } in #{ @page_path } " . red
80
+ end
77
81
else
78
82
name = authors [ index ] . data [ 'name' ] . downcase
79
83
url = "#{ site_url } /author/#{ name } "
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ class AuthorData
8
8
9
9
def initialize ( test_path = nil )
10
10
@test_path = test_path
11
- @basepath = @test_path || Dir . pwd
11
+ @basepath = @test_path ? @test_path : Dir . pwd
12
12
13
13
@path = File . join ( @basepath , '_authors' )
14
14
cwd = File . dirname ( __FILE__ )
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ def create_presets(site)
82
82
end
83
83
84
84
def in_threads ( site )
85
- site . config [ 'n_cores' ] || 1
85
+ site . config [ 'n_cores' ] ? site . config [ 'n_cores' ] : 1
86
86
end
87
87
88
88
def generate ( site )
Original file line number Diff line number Diff line change 35
35
ARGV . map . with_index do |a , index |
36
36
# Flags:
37
37
# The image flag allows you to name the image path directory
38
- image_path = ARGV [ index + 1 ] || image_path if a == '-i' || a == '-I' || a == '--image'
38
+ if a == '-i' || a == '-I' || a == '--image'
39
+ image_path = ARGV [ index + 1 ] ? ARGV [ index + 1 ] : image_path
40
+ end
39
41
40
42
# Set reference for built project
41
- built_path = ARGV [ index + 1 ] || built_path if a == '-b' || a == '-B' || a == '--built'
43
+ if a == '-b' || a == '-B' || a == '--built'
44
+ built_path = ARGV [ index + 1 ] ? ARGV [ index + 1 ] : built_path
45
+ end
42
46
43
47
# Set folder where images are stored
44
- directory_name = ARGV [ index + 1 ] || directory_name if a == '-d' || a == '-D' || a == '--dir_temp'
48
+ if a == '-d' || a == '-D' || a == '--dir_temp'
49
+ directory_name = ARGV [ index + 1 ] ? ARGV [ index + 1 ] : directory_name
50
+ end
45
51
46
52
# Use relative file path to scan
47
53
use_relative = true if a == '-r' || a == '-R' || a == '--use_relative'
Original file line number Diff line number Diff line change
1
+ # rubocop:disable all
1
2
# rubocop:enable all
You can’t perform that action at this time.
0 commit comments