hovancik/BSDSec

View on GitHub
bin/yarn

Summary

Maintainability
Test Coverage
Missing frozen string literal comment.
#!/usr/bin/env ruby
APP_ROOT = File.expand_path('..', __dir__)
Dir.chdir(APP_ROOT) do
Place the . on the next line, together with the method name.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
Use `reject` instead of inverting `select`.
yarn = ENV["PATH"].split(File::PATH_SEPARATOR).
Place the . on the next line, together with the method name.
Align `select` with `ENV["PATH"].split(File::PATH_SEPARATOR).` on line 4.
select { |dir| File.expand_path(dir) != __dir__ }.
Align `product` with `ENV["PATH"].split(File::PATH_SEPARATOR).` on line 4.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
Place the . on the next line, together with the method name.
product(["yarn", "yarn.cmd", "yarn.ps1"]).
Place the . on the next line, together with the method name.
Align `map` with `ENV["PATH"].split(File::PATH_SEPARATOR).` on line 4.
map { |dir, file| File.expand_path(file, dir) }.
Align `find` with `ENV["PATH"].split(File::PATH_SEPARATOR).` on line 4.
find { |file| File.executable?(file) }
 
if yarn
exec yarn, *ARGV
else
Use `warn` instead of `$stderr.puts` to allow such output to be disabled.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
$stderr.puts "Yarn executable was not detected in the system."
Prefer single-quoted strings when you don't need string interpolation or special symbols.
Use `warn` instead of `$stderr.puts` to allow such output to be disabled.
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
exit 1
end
end