Last active
August 29, 2015 14:26
-
-
Save pocke/76065ede1ded33146880 to your computer and use it in GitHub Desktop.
for ruby_hl_lvar.vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'stringio' | |
module Vim | |
end | |
require '~/.vim/bundle/ruby_hl_lvar.vim/autoload/ruby_hl_lvar.vim.rb' | |
$o = STDOUT | |
class RubyHlLvar::Extractor | |
def warn(msg) | |
$o.puts msg | |
end | |
end | |
ARGV.each do |path| | |
$o = StringIO.new("") | |
f = File.read(path) | |
RubyHlLvar::Extractor.new(true).extract(f) | |
$o.rewind | |
s = $o.read | |
next if s.empty? | |
puts path | |
print s | |
puts | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage
ruby test.rb target.rb target2.rb ...