module Bootstrap::BookingSync
Constants
- VERSION
Public Class Methods
assets_path()
click to toggle source
# File lib/bootstrap-bookingsync-sass.rb, line 43 def assets_path @assets_path ||= File.join gem_path, 'assets' end
compass?()
click to toggle source
# File lib/bootstrap-bookingsync-sass.rb, line 52 def compass? defined?(::Compass::Frameworks) end
fonts_path()
click to toggle source
# File lib/bootstrap-bookingsync-sass.rb, line 35 def fonts_path File.join assets_path, 'fonts' end
gem_path()
click to toggle source
Paths
# File lib/bootstrap-bookingsync-sass.rb, line 27 def gem_path @gem_path ||= File.expand_path '..', File.dirname(__FILE__) end
javascripts_path()
click to toggle source
# File lib/bootstrap-bookingsync-sass.rb, line 39 def javascripts_path File.join assets_path, 'javascripts' end
load!()
click to toggle source
Inspired by Kaminari
# File lib/bootstrap-bookingsync-sass.rb, line 7 def load! register_compass_extension if compass? if rails? register_rails_engine elsif sprockets? register_sprockets elsif defined?(::Sass) && ::Sass.respond_to?(:load_paths) # The deprecated `sass` gem: ::Sass.load_paths << stylesheets_path end if defined?(::Sass::Script::Value::Number) # Set precision to 6 as per: # https://github.com/twbs/bootstrap/blob/da717b03e6e72d7a61c007acb9223b9626ae5ee5/package.json#L28 ::Sass::Script::Number.precision = [6, ::Sass::Script::Number.precision].max end end
rails?()
click to toggle source
# File lib/bootstrap-bookingsync-sass.rb, line 56 def rails? defined?(::Rails) end
sprockets?()
click to toggle source
Environment detection helpers
# File lib/bootstrap-bookingsync-sass.rb, line 48 def sprockets? defined?(::Sprockets) end
stylesheets_path()
click to toggle source
# File lib/bootstrap-bookingsync-sass.rb, line 31 def stylesheets_path File.join assets_path, 'stylesheets' end
Private Class Methods
register_compass_extension()
click to toggle source
# File lib/bootstrap-bookingsync-sass.rb, line 62 def register_compass_extension ::Compass::Frameworks.register( 'bootstrap-bookinsync', :version => Bootstrap::BookingSync::VERSION, :path => gem_path, :stylesheets_directory => stylesheets_path, :templates_directory => File.join(gem_path, 'templates') ) end
register_rails_engine()
click to toggle source
# File lib/bootstrap-bookingsync-sass.rb, line 72 def register_rails_engine require 'bootstrap/bookingsync/engine' end
register_sprockets()
click to toggle source
# File lib/bootstrap-bookingsync-sass.rb, line 76 def register_sprockets Sprockets.append_path(stylesheets_path) Sprockets.append_path(fonts_path) Sprockets.append_path(javascripts_path) end