module Bundler::Thor::Actions

def apply(path, config = {})


apply "recipes/jquery.rb"

apply "http://gist.github.com/103208"

==== Examples

a relative path from the source root.
path:: The path to the file to execute. Can be a web address or
==== Parameters

Loads an external file and execute it in the instance binding.
def apply(path, config = {})
  verbose = config.fetch(:verbose, true)
  is_uri  = path =~ %r{^https?\://}
  path    = find_in_source_paths(path) unless is_uri
  say_status :apply, path, verbose
  shell.padding += 1 if verbose
  contents = if is_uri
    require "open-uri"
    URI.open(path, "Accept" => "application/x-thor-template", &:read)
  else
    File.open(path, &:read)
  end
  instance_eval(contents, path)
  shell.padding -= 1 if verbose
end