Skip to content

Instantly share code, notes, and snippets.

@jeroenvandijk
Created December 21, 2009 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jeroenvandijk/260861 to your computer and use it in GitHub Desktop.
Save jeroenvandijk/260861 to your computer and use it in GitHub Desktop.
# In example.rb
module Example
# This method does something
def command1(arg1, arg2, options = {})
end
# This method does something else
def command2(arg1, arg2, options = {})
end
end
# In run_example.rb
require 'rubygems'
require 'boson'
Boson.load_module(Example) # or a similar command that loads the module
Boson.start
# The following would be possible from the command line
# ./run_example.rb command1 arg1 arg2 --option1=foo --option2=bar
# ./run_example.rb command2 arg1 arg2 --option1=foo --option2=bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment