Navigation Menu

Skip to content

Commit

Permalink
Update the sprockets plugin for asset provisioning
Browse files Browse the repository at this point in the history
  • Loading branch information
sstephenson committed Jan 31, 2009
1 parent 5c07d8a commit a50f8f0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions config/sprockets.yml
@@ -1,3 +1,4 @@
:asset_root: public
:load_path:
- app/javascripts
- vendor/sprockets/*/src
Expand Down
6 changes: 5 additions & 1 deletion lib/sprockets_application.rb
Expand Up @@ -8,9 +8,13 @@ def source
output_file.to_s
end

def generate_asset!
def install_script
output_file.save_to(asset_path)
end

def install_assets
secretary.install_assets
end

protected
def secretary
Expand Down
12 changes: 9 additions & 3 deletions tasks/sprockets_tasks.rake
@@ -1,7 +1,13 @@
namespace :sprockets do
desc "Generate the Sprockets concatenated JavaScript file"
task :generate_asset do
desc "Generate and install the Sprockets concatenated JavaScript file"
task :install_script do
require "config/environment"
SprocketsApplication.generate_asset!
SprocketsApplication.install_script
end

desc "Install any assets provided by Sprockets scripts"
task :install_assets do
require "config/environment"
SprocketsApplication.install_assets
end
end

0 comments on commit a50f8f0

Please sign in to comment.