Class: LanguageServer::Linter::RubyWC
- Inherits:
-
Object
- Object
- LanguageServer::Linter::RubyWC
- Defined in:
- lib/language_server/linter/ruby_wc.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(source) ⇒ RubyWC
constructor
A new instance of RubyWC.
Constructor Details
#initialize(source) ⇒ RubyWC
Returns a new instance of RubyWC.
24 25 26 |
# File 'lib/language_server/linter/ruby_wc.rb', line 24 def initialize(source) @source = source end |
Instance Method Details
#call ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/language_server/linter/ruby_wc.rb', line 28 def call _, err, _ = Open3.capture3("ruby -wc", stdin_data: @source) err.scan(/.+:(\d+):\s*(.+?)[,:]\s(.+)/).map do |line_num, type, | Error.new(line_num: line_num.to_i, message: , type: type) end end |