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

stasis-extensions

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stasis-extensions

  • 1.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

stasis-extensions Build Status

stasis-extensions is a gem that extends the functionality of stasis to support i18n and fingerprinting of assets.

Installation

Add this line to your application's Gemfile:

gem 'stasis-extensions'

And then execute:

$ bundle

Or install it yourself as:

$ gem install stasis-extensions

Usage

i18n helpers

body_class

Use to generate classes for your body (or other html tag). The current locale and the current view name will be included.

translate(key, options = {})

Use in your views to localize text. Aliased as t. See ActionView::Helpers::TranslationHelper.

root_url

Use in your views to generate a "root" url for your site by adding the protocol hostname (looked up as "hostname" in your locale .yml file).

asset support

All files in the css, images and js folders will be fingerprinted with MD5 digests of the source content (allowing simpler use with caching or CDNs).

asset helpers

In addition to compiling the fingerprinted asset files, helper methods have been added for use in views and in sass/scss.

asset_path(file)

Similar to the Rails asset_path helper, the specified path will be expanded to the fingerprinted version.

asset_url(file)

Similar to the preceding asset_path helper, the specified path will be expanded to the fingerprinted version and will be prepended with the protocol and hostname (as provided by the root_url helper above).

asset-url(file)

Similar to the asset_path helper, but the path is rendered for css use (ie. wrapped in url(...)).

content helper

A helper method has been added to support Rails-like deferred content.

content_for(symbol)

Similar to the Rails content_for helper which allows the user to yield content defined in a view from within a layout.

Instead of using yield to render the content within the layout, simply call the helper without a block to retrieve the previously rendered content.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

FAQs

Package last updated on 29 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