Open naokikimura opened 4 years ago
When the -f option is specified in CLI, there is no way to write the analysis result to the pipe.
-f
--output-file
/dev/null
% rails_best_practices --silent -f xml --output-file /dev/stdout | cat Traceback (most recent call last): 9: from /Users/kimuranaoki/.asdf/installs/ruby/2.6.3/bin/rails_best_practices:23:in `<main>' 8: from /Users/kimuranaoki/.asdf/installs/ruby/2.6.3/bin/rails_best_practices:23:in `load' 7: from /Users/kimuranaoki/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_best_practices-1.20.0/bin/rails_best_practices:7:in `<top (required)>' 6: from /Users/kimuranaoki/.asdf/installs/ruby/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' 5: from /Users/kimuranaoki/.asdf/installs/ruby/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' 4: from /Users/kimuranaoki/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_best_practices-1.20.0/lib/rails_best_practices/command.rb:15:in `<top (required)>' 3: from /Users/kimuranaoki/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_best_practices-1.20.0/lib/rails_best_practices/analyzer.rb:75:in `output' 2: from /Users/kimuranaoki/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_best_practices-1.20.0/lib/rails_best_practices/analyzer.rb:278:in `output_xml_errors' 1: from /Users/kimuranaoki/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_best_practices-1.20.0/lib/rails_best_practices/analyzer.rb:278:in `open' /Users/kimuranaoki/.asdf/installs/ruby/2.6.3/lib/ruby/gems/2.6.0/gems/rails_best_practices-1.20.0/lib/rails_best_practices/analyzer.rb:278:in `initialize': Permission denied @ rb_sysopen - /dev/stdout (Errno::EACCES)
I want to output the analysis result as XML and transform it with XSLT. I don't want to output an intermediate XML file.
Why open output file in w+ mode?
w+
When the
-f
option is specified in CLI, there is no way to write the analysis result to the pipe.-f
option is specified and--output-file
option is not specified, the analysis result is output to a file with the default file name./dev/null
to the--output-file
option with the-f
option specified.I want to output the analysis result as XML and transform it with XSLT. I don't want to output an intermediate XML file.
Why open output file in
w+
mode?