Skip to content

Instantly share code, notes, and snippets.

@pocke
Last active August 29, 2015 14:26
Show Gist options
  • Save pocke/76065ede1ded33146880 to your computer and use it in GitHub Desktop.
Save pocke/76065ede1ded33146880 to your computer and use it in GitHub Desktop.
for ruby_hl_lvar.vim
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
@pocke
Copy link
Author

pocke commented Jul 30, 2015

Usage

ruby test.rb target.rb target2.rb ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment