Socket
Book a DemoInstallSign in
Socket

assets_ledger

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

assets_ledger

0.0.2
bundlerRubygems
Version published
Maintainers
2
Created
Source

AssetsLedger

Keep track of JS/CSS dependencies and makes sure they are only included once.

Installation

Add this line to your application's Gemfile:

gem 'assets_ledger'

And then execute:

$ bundle

Or install it yourself as:

$ gem install assets_ledger

Usage

ledger = AssetsLedger::Ledger.new
ledger.add_js('path/to/js')
ledger.add_css('path/to/css')

# You can add many dependencies at once
ledger.add_js('/js/jquery.js', 'js/jquery.datatables.js')

# or pass an array
js_dependencies = ['/js/jquery.js', 'js/jquery.datatables.js']
ledger.add_js(js_dependencies)

if you use Rails you can generate the include tags by:

# In application.html.erb
stylesheet_link_tag *ledger.css_dependencies
# ...
javascript_include_tag *ledger.js_dependencies

Contributing

  • Fork it ( https://github.com/trialbee/assets_ledger/fork )
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create a new Pull Request

FAQs

Package last updated on 21 Apr 2015

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.