Sha256: eae311a3fe730622d9b95a2bf4f5c96c131aa05d78f9e17e41df1f6fc4ce5209

Contents?: true

Size: 1004 Bytes

Versions: 35

Compression:

Stored size: 1004 Bytes

Contents

gem 'jammit'

after_bundler do
  if config['pre_commit']
    say_wizard "Adding git pre-commit hook..."
    create_file ".git/hooks/pre-commit", <<-BASH
#!/bin/sh

echo "Packaging assets with Jammit..."
jammit
git add public/assets
BASH
    run "chmod +x .git/hooks/pre-commit"
  end

  create_file "config/assets.yml", <<-YAML
javascripts:
  app:
    - public/javascripts/*.js
stylesheets:
  app:
    - public/stylesheets/*.css
YAML

  gsub_file "app/views/layouts/application.html.erb", "<%= javascript_include_tag :defaults %>", "<%= include_javascripts :app %>"
  gsub_file "app/views/layouts/application.html.erb", "<%= stylesheet_link_tag :all %>", "<%= include_stylesheets :app %>"
end

__END__

name: Jammit
description: "Use Jammit to package your application's assets."
author: mbleigh

exclusive: asset_packaging
category: assets
tags: [packaging]

config:
  - pre_commit:
      type: boolean
      prompt: "Create a git pre-commit hook to generate assets for Heroku?"
      if_recipe: heroku

Version data entries

35 entries across 35 versions & 3 rubygems

Version Path
rails_apps_composer-1.0.26 recipes/jammit.rb
rails_apps_composer-1.0.25 recipes/jammit.rb
rails_apps_composer-1.0.24 recipes/jammit.rb
rails_apps_composer-1.0.23 recipes/jammit.rb
rails_apps_composer-1.0.22 recipes/jammit.rb
rails_apps_composer-1.0.21 recipes/jammit.rb
rails_apps_composer-1.0.20 recipes/jammit.rb
rails_apps_composer-1.0.19 recipes/jammit.rb
rails_apps_composer-1.0.18 recipes/jammit.rb
rails_apps_composer-1.0.17 recipes/jammit.rb
rails_apps_composer-1.0.16 recipes/jammit.rb
rails_apps_composer-1.0.15 recipes/jammit.rb
rails_apps_composer-1.0.14 recipes/jammit.rb
rails_apps_composer-1.0.12 recipes/jammit.rb
rails_apps_composer-1.0.11 recipes/jammit.rb
rails_apps_composer-1.0.10 recipes/jammit.rb
rails_apps_composer-1.0.7 recipes/jammit.rb
rails_apps_composer-1.0.6 recipes/jammit.rb
rails_apps_composer-1.0.5 recipes/jammit.rb
rails_apps_composer-1.0.4 recipes/jammit.rb