module FullCalendar

Constants

VERSION

Public Class Methods

assets_path() click to toggle source
# File lib/full_calendar.rb, line 30
def assets_path
  @assets_path ||= File.join gem_path, 'vendor/assets'
end
gem_path() click to toggle source

Paths

# File lib/full_calendar.rb, line 18
def gem_path
  @gem_path ||= File.expand_path '..', File.dirname(__FILE__)
end
hanami?() click to toggle source
# File lib/full_calendar.rb, line 43
def hanami?
  defined?(::Hanami)
end
javascripts_path() click to toggle source
# File lib/full_calendar.rb, line 26
def javascripts_path
  File.join assets_path, 'javascripts'
end
load!() click to toggle source

Inspired by Kaminari

# File lib/full_calendar.rb, line 7
def load!
  if rails?
    register_rails_engine
  elsif hanami?
    register_hanami
  elsif sprockets?
    register_sprockets
  end
end
rails?() click to toggle source
# File lib/full_calendar.rb, line 39
def rails?
  defined?(::Rails)
end
sprockets?() click to toggle source

Environment detection helpers

# File lib/full_calendar.rb, line 35
def sprockets?
  defined?(::Sprockets)
end
stylesheets_path() click to toggle source
# File lib/full_calendar.rb, line 22
def stylesheets_path
  File.join assets_path, 'stylesheets'
end

Private Class Methods

register_hanami() click to toggle source
# File lib/full_calendar.rb, line 58
def register_hanami
  Hanami::Assets.sources << assets_path
end
register_rails_engine() click to toggle source
# File lib/full_calendar.rb, line 49
def register_rails_engine
  require 'full_calendar/engine'
end
register_sprockets() click to toggle source
# File lib/full_calendar.rb, line 53
def register_sprockets
  Sprockets.append_path(stylesheets_path)
  Sprockets.append_path(javascripts_path)
end