Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

capistrano-local-precompile

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

capistrano-local-precompile

  • 1.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

Capistrano Local Precompile

If your Rails apps are anything like mine, one of the slowest parts of your deployment is waiting for asset pipeline precompilation. It's sometimes so slow, it's painful. So I went searching for some solutions. turbo-sprockets helped, but it's not a silver bullet. This gem isn't a silver bullet either, but it can help. Capistrano Local Precompile takes a different approach. It builds your assets locally and rsync's them to your web server(s).

Usage

Add capistrano-local-precompile to your Gemfile:

group :development do
  # Capistrano v2 should use '~> 0.0.5'
  # Capistrano v3 should use '~> 1.0.0'
  # Capistrano v3.8+ should use '~> 1.2.0'
  gem 'capistrano-local-precompile', '~> 1.2.0', require: false
end

Then add the following line to your Capfile:

require 'capistrano/local_precompile'

Remove the following line from your Capfile:

require 'capistrano/rails/assets'

Here's the full set of configurable options:

set :precompile_env             # default: fetch(:rails_env) || 'production'
set :assets_dir                 # default: "public/assets"
set :rsync_cmd                  # default: "rsync -av --delete"

Capistrano supports dry run mode. In that case the rsync command will not actually be run but only shown in stdout:

cap production deploy --dry-run

Acknowledgement

This gem is derived from gists by uhlenbrock and keighl.

Contributing

Pull requests welcome: fork, make a topic branch, commit (squash when possible) with tests and I'll happily consider.

Copyright (c) 2019 Steve Agalloco / Tom Caflisch. See LICENSE for detail

FAQs

Package last updated on 19 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc