Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

improve Rakefile

 - fix for Ruby 1.8
 - be a bit more verbose about what's happening
  • Loading branch information...
commit 874e3fdc9b4c2028a8e8783254486e20171a8bce 1 parent 37a4925
@mislav authored
Showing with 9 additions and 6 deletions.
  1. +9 −6 Rakefile
15 Rakefile
@@ -1,18 +1,21 @@
#!/usr/bin/env rake
-# encoding: UTF-8
-SET_FILE = "/Developer/usr/bin/SetFile"
-NON_SCRIPTS = %w[ MIT_LICENSE Rakefile lib ]
-HIDE_EXTS = "rb"
+SET_FILE = '/Developer/usr/bin/SetFile'
+HIDE_EXTS = %w[ rb ]
task :default => [:"hide-extensions", :"hide-nonscripts"]
desc "Set script files to have their extensions hidden in the Finder, and, hence, in the FastScripts menu."
task :"hide-extensions" do
- system SET_FILE, "-a", "E", *Dir["Applications/**/*.{#{HIDE_EXTS}}"], *Dir["*.{#{HIDE_EXTS}}"]
+ glob = "*.{#{HIDE_EXTS.join(',')}}"
+ files = Dir["Applications/**/#{glob}"] + Dir[glob]
+ puts "Hiding file extensions for #{files.size} files..."
+ system SET_FILE, "-a", "E", *files
desc "Hide files that are not scripts from the Finder, and, hence, from the FastScripts menu."
task :"hide-nonscripts" do
- system SET_FILE, "-a", "V", * { |f| File.exist? f }
+ files = %w[ MIT_LICENSE Rakefile lib ].select { |f| File.exist? f }
+ puts "Hiding #{files.size} non-script files..."
+ system SET_FILE, "-a", "V", *files
Please sign in to comment.
Something went wrong with that request. Please try again.