03
Nov
10

ruby one-liner of the day



Get the contents of the PATH with entries matching command line arguments removed ( god damn this CSS style ):


puts ENV["PATH"].split(File::PATH_SEPARATOR).reject {|f| ARGV.any? {|a| f=~/#{a}/i}}.join(File::PATH_SEPARATOR)

Advertisements

0 Responses to “ruby one-liner of the day”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Blog Stats

  • 228,119 hits

%d bloggers like this: