scripts/reference.rb in ffaker-2.5.0 vs scripts/reference.rb in ffaker-2.6.0
- old
+ new
@@ -1,11 +1,11 @@
$LOAD_PATH << File.dirname(__FILE__) + '/../lib'
require 'ffaker'
ICONS = {
- error: "‼️",
- warning: "❗"
+ error: '‼️',
+ warning: '❗'
}.freeze
# Get a list of sections
def faker_modules
FFaker.constants.map do |const|
@@ -58,14 +58,14 @@
left = "`#{meth}`"
right = ''
if arity > 0
- left = "`#{meth}`(#{arity.times.map { '...' }.join(', ')})"
+ left = "`#{meth}`(#{Array.new(arity) { '...' }.join(', ')})"
else
begin
examples, warnings = catch_warnings do
- 3.times.map { mod.send meth }
+ Array.new(3) { mod.send meth }
end
right = if warnings.any?
"#{ICONS[:warning]} *#{warnings.first}*"
else
(escape examples.join(', ')).to_s