Skip to content

Instantly share code, notes, and snippets.

@syohex
Created October 3, 2012 12:26
Show Gist options
  • Save syohex/3826673 to your computer and use it in GitHub Desktop.
Save syohex/3826673 to your computer and use it in GitHub Desktop.
simple match ruby
#!/usr/bin/env ruby
# -*- coding:utf-8 -*-
file = ARGV[0] || File.expand_path("~/.zshrc")
File.open(file) do |f|
f.each_line do |line|
if matched = line.match(/^source/)
puts line
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment