Skip to content

Instantly share code, notes, and snippets.

@plasticine
Created January 18, 2012 06:28
Show Gist options
  • Select an option

  • Save plasticine/1631442 to your computer and use it in GitHub Desktop.

Select an option

Save plasticine/1631442 to your computer and use it in GitHub Desktop.
@module = (names, fn) ->
names = names.split '.' if typeof names is 'string'
space = @[names.shift()] ||= {}
space.module ||= @module
if names.length
space.module names, fn
else
fn.call space
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment