In terms of globbing, how about something like;

```ruby
Dir["#{@root}/lib/**/*.js"].each do |file|
  name          = Pathname.new(file).relative_path_from(@root)
  content       = File.read(file)
  modules[name] = content
end   
```