Module: ConversationForms

Defined in:
lib/conversation_forms.rb,
lib/conversation_forms/engine.rb,
lib/conversation_forms/version.rb

Defined Under Namespace

Modules: Rails

Constant Summary collapse

VERSION =
"2.0.2"

Class Method Summary collapse

Class Method Details

.assets_pathObject



30
31
32
# File 'lib/conversation_forms.rb', line 30

def assets_path
  @assets_path ||= File.join gem_path, 'assets'
end

.compass?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/conversation_forms.rb', line 39

def compass?
  defined?(::Compass::Frameworks)
end

.gem_pathObject

Paths



18
19
20
# File 'lib/conversation_forms.rb', line 18

def gem_path
  @gem_path ||= File.expand_path '..', File.dirname(__FILE__)
end

.javascripts_pathObject



26
27
28
# File 'lib/conversation_forms.rb', line 26

def javascripts_path
  File.join assets_path, 'javascripts'
end

.load!Object

Inspired by Kaminari through bootstrap-sass



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/conversation_forms.rb', line 5

def load!
  register_compass_extension if compass?

  if rails?
    register_rails_engine
  elsif sprockets?
    register_sprockets
  end

  configure_sass
end

.rails?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/conversation_forms.rb', line 43

def rails?
  defined?(::Rails)
end

.sprockets?Boolean

Environment detection helpers

Returns:

  • (Boolean)


35
36
37
# File 'lib/conversation_forms.rb', line 35

def sprockets?
  defined?(::Sprockets)
end

.stylesheets_pathObject



22
23
24
# File 'lib/conversation_forms.rb', line 22

def stylesheets_path
  File.join assets_path, 'stylesheets'
end