Skip to content

Instantly share code, notes, and snippets.

@cldwalker
Created January 29, 2010 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cldwalker/290074 to your computer and use it in GitHub Desktop.
Save cldwalker/290074 to your computer and use it in GitHub Desktop.
Example of overriding a boson core command in a separate library
module MyCore
def self.config
{:force=>true}
end
# My overridden version that also handles arrays of hashes with :url
def browser(*urls)
urls.map! {|e| e[:url] } if urls[0].is_a?(Hash) and urls[0].has_key?(:url)
system('open', *urls)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment