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
- #cache_enabled? ⇒ Boolean
- #copy_extensions ⇒ Object
- #temp_dir ⇒ Object
- #ts_extensions ⇒ Object
- #tsc_command ⇒ Object
Instance Method Details
#cache_enabled? ⇒ 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_extensions ⇒ Object
16 17 18 |
# File 'lib/jekyll/typescript/config.rb', line 16 def copy_extensions @copy_extensions ||= Array(config['copy_ext']) end |
#temp_dir ⇒ Object
20 21 22 |
# File 'lib/jekyll/typescript/config.rb', line 20 def temp_dir @temp_dir ||= config['temp_dir'] || '.typescript' end |
#ts_extensions ⇒ Object
12 13 14 |
# File 'lib/jekyll/typescript/config.rb', line 12 def ts_extensions @ts_extensions ||= Array(config['extensions'] || %w[.ts .tsx]) end |
#tsc_command ⇒ Object
24 25 26 |
# File 'lib/jekyll/typescript/config.rb', line 24 def tsc_command @tsc_command ||= Array(config['command'] || ['tsc']) end |