New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

brainopia-assets

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brainopia-assets

  • 0.9.10
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

This gem was born out of frustration when I was dealing with assets in non-rails environment. I wanted an experience similar to asset_packager: you just specify all your assets and then in development you have them as they are, but in production all compressed in one file.

As a result I produced a small library in just around 100 lines to manage assets in any rack-based framework. For compression this gem uses yuicompressor (so you'll need java installed, as opposed to jsmin.rb but it doesn't require you to put semicolons after each statement).

Workflow is simple. You define a specification of your assets in config/assets.yml: --- js: - http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js - jquery.tools - jquery.autocomplete - jquery.address - application css: - application

You can specify web and local assets. Local assets will be looked up in public/javascripts and public/stylesheets folders.

And then you use Assets.js.bundle and Assets.css.bundle to include assets in your view.

This gem doesn't produce compressed files on demand in production, cause such request would get slow. So instead you need to compress files when you deploy your application, just use Assets.js.compress and Assets.css.compress for this purpose.

You can easily change location of config file, javascripts and stylesheets folders, just look into code and you'll see how.

If you need help don't hesitate to ask me ;-)

FAQs

Package last updated on 11 Aug 2014

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