Module: Jasmine::Dependencies

Defined in:
lib/jasmine/dependencies.rb

Class Method Summary collapse

Class Method Details

.rails4?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/jasmine/dependencies.rb', line 5

def rails4?
  rails? && Rails.version.to_i == 4
end

.rails5?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/jasmine/dependencies.rb', line 9

def rails5?
  rails? && Rails.version.to_i == 5
end

.rails6?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/jasmine/dependencies.rb', line 13

def rails6?
  rails? && Rails.version.to_i == 6
end

.rails?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/jasmine/dependencies.rb', line 17

def rails?
  defined?(Rails) && Rails.respond_to?(:version)
end

.use_asset_pipeline?Boolean

Returns:

  • (Boolean)


21
22
23
24
25
26
# File 'lib/jasmine/dependencies.rb', line 21

def use_asset_pipeline?
  (rails4? || rails5? || rails6?) &&
    Rails.respond_to?(:application) &&
    Rails.application.respond_to?(:assets) &&
    !Rails.application.assets.nil?
end