Module: EvilBlocks
- Defined in:
- lib/evil-blocks-rails.rb
Overview
Copyright 2013 Andrey “A.I.” Sitnik <[email protected]>, sponsored by Evil Martians.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <www.gnu.org/licenses/>.
Defined Under Namespace
Classes: Engine
Class Method Summary collapse
-
.install(sprockets) ⇒ Object
Add assets paths to standalone Sprockets environment.
-
.install_to_slim! ⇒ Object
Change Slim options to support @data-role shortcut.
Class Method Details
.install(sprockets) ⇒ Object
Add assets paths to standalone Sprockets environment.
33 34 35 |
# File 'lib/evil-blocks-rails.rb', line 33 def self.install(sprockets) sprockets.append_path(Pathname(__FILE__).dirname.join('assets/javascripts')) end |
.install_to_slim! ⇒ Object
Change Slim options to support @data-role shortcut.
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/evil-blocks-rails.rb', line 21 def self.install_to_slim! # Add @data-role alias to Slim. # # Copy from role-rails by Sasha Koss. # https://github.com/kossnocorp/role-rails shortcut = Slim::Parser.[:shortcut] shortcut['@'] = { :attr => 'data-role' } shortcut['@.'] = { :attr => ['data-role', 'class'] } Slim::Engine.[:merge_attrs]['data-role'] = ' ' end |