Class: Yarn::Audit::Wrap::YarnCommand
- Inherits:
-
Object
- Object
- Yarn::Audit::Wrap::YarnCommand
- Defined in:
- lib/yarn/audit/wrap/yarn_command.rb
Instance Method Summary collapse
-
#initialize(opts:) ⇒ YarnCommand
constructor
A new instance of YarnCommand.
- #run ⇒ Object
Constructor Details
#initialize(opts:) ⇒ YarnCommand
Returns a new instance of YarnCommand.
8 9 10 |
# File 'lib/yarn/audit/wrap/yarn_command.rb', line 8 def initialize opts: @opts = opts end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 |
# File 'lib/yarn/audit/wrap/yarn_command.rb', line 12 def run filepath = @opts[:audit_json].to_s FileUtils.mkdir_p File.dirname(filepath) outfile = Shellwords.escape(filepath) system("yarn audit --json > #{outfile}") end |