Module: Dkdeploy::Typo3::Cms::Helpers::Erb

Defined in:
lib/dkdeploy/typo3/cms/helpers/erb.rb

Overview

Erb related helpers

Instance Method Summary collapse

Instance Method Details

#default_template_fileString

Return path to default template file for “AdditionalConfiguration.php” at gem

Returns:

  • (String)


18
19
20
# File 'lib/dkdeploy/typo3/cms/helpers/erb.rb', line 18

def default_template_file
  File.join(__dir__, '..', '..', '..', '..', '..', 'vendor', 'AdditionalConfiguration.php.erb')
end

#sanitize_php(php_code) ⇒ String

Remove “<?php” at beginning and “?>” at end of string

Parameters:

  • php_code (String)

    PHP Code to sanitize

Returns:

  • (String)


11
12
13
# File 'lib/dkdeploy/typo3/cms/helpers/erb.rb', line 11

def sanitize_php(php_code)
  php_code.strip.reverse.chomp('php?<').reverse.chomp('?>').strip.concat("\n")
end