backbone-fails/lib/backbone-rails/generators.rb
2011-05-17 19:43:02 -04:00

20 lines
439 B
Ruby

require 'rails/generators'
module Backbone
class Install < ::Rails::Generators::Base
JAVASCRIPTS = File.expand_path('../../../vendor/assets/javascripts', __FILE__)
def self.source_root
@source_root ||= JAVASCRIPTS
end
def copy_backbone
Dir[File.join(JAVASCRIPTS, '*.js')].each do |file|
file = File.split(file).last
copy_file file, "public/javascripts/#{file}"
end
end
end
end