Module: Dsfr::Assets

Defined in:
lib/dsfr/assets.rb,
lib/dsfr/assets/railtie.rb,
lib/dsfr/assets/version.rb

Overview

:nodoc:

Defined Under Namespace

Classes: Engine, LicenseError

Constant Summary collapse

VERSION =
"1.15.1"
CGU_VERSION =
"1.0.1"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.accepted_license_version=(value) ⇒ Object (writeonly)

Sets the attribute accepted_license_version

Parameters:

  • value

    the value to set the attribute accepted_license_version to.



11
12
13
# File 'lib/dsfr/assets.rb', line 11

def accepted_license_version=(value)
  @accepted_license_version = value
end

Class Method Details

.cgu_urlObject



13
14
15
# File 'lib/dsfr/assets.rb', line 13

def cgu_url
  "https://github.com/GouvernementFR/dsfr/blob/v#{VERSION}/doc/legal/cgu.md"
end

.check_license!Object



17
18
19
20
21
22
23
24
25
# File 'lib/dsfr/assets.rb', line 17

def check_license!
  return if license_env_bypass?

  if @accepted_license_version.nil?
    raise LicenseError, missing_license_message
  elsif @accepted_license_version != CGU_VERSION
    raise LicenseError, license_version_mismatch_message(@accepted_license_version)
  end
end