Module: Jekyll::Typescript::Config

Included in:
Manager
Defined in:
lib/jekyll/typescript/config.rb

Overview

module adding methods to access the config variables for this plugin from the users _config.yml.

these methods are also expected to attach the default values for these options should they be unassigned.

Instance Method Summary collapse

Instance Method Details

#cache_enabled?Boolean

Returns:

  • (Boolean)


28
29
30
31
32
33
34
# File 'lib/jekyll/typescript/config.rb', line 28

def cache_enabled?
  if @cache_enabled.nil?
    @cache_enabled = config.fetch('cache', true)
  end

  @cache_enabled
end

#copy_extensionsObject



16
17
18
# File 'lib/jekyll/typescript/config.rb', line 16

def copy_extensions
  @copy_extensions ||= Array(config['copy_ext'])
end

#temp_dirObject



20
21
22
# File 'lib/jekyll/typescript/config.rb', line 20

def temp_dir
  @temp_dir ||= config['temp_dir'] || '.typescript'
end

#ts_extensionsObject



12
13
14
# File 'lib/jekyll/typescript/config.rb', line 12

def ts_extensions
  @ts_extensions ||= Array(config['extensions'] || %w[.ts .tsx])
end

#tsc_commandObject



24
25
26
# File 'lib/jekyll/typescript/config.rb', line 24

def tsc_command
  @tsc_command ||= Array(config['command'] || ['tsc'])
end