backbone-fails/lib/backbone-rails/generators.rb

20 lines
439 B
Ruby
Raw Normal View History

2011-05-17 23:43:02 +00:00
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