Skip to content

Instantly share code, notes, and snippets.

@tosik
Created September 8, 2012 16:24
Show Gist options
  • Select an option

  • Save tosik/3676732 to your computer and use it in GitHub Desktop.

Select an option

Save tosik/3676732 to your computer and use it in GitHub Desktop.
Creates Motion::Project::Config#dependencies(from: path, to: path)
class Motion::Project::Config
def dependencies(args)
from, to = args[:from], args[:to]
Dir[from].each do |from_file|
Dir[to].each do |to_file|
files_dependencies from_file => to_file
end
end
end
end
# usage
Motion::Project::App.setup do |app|
# Use `rake config' to see complete project settings.
app.name = 'foo'
app.dependencies from: 'app/controllers/*.rb', to: 'app/lib/hello.rb'
app.dependencies from: 'app/lib/hello.rb', to: 'app/lib/hello/**/*.rb'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment