Skip to content

redpist/easy_template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EasyTemplate Gem Version

Easy template language in ruby, with only variable substitution.

Documentation

# Arguments:
#   text: (String)
#         the string containing your template
#   variables: (Hash)
#         the hash containing the values to substitute in place of the keys
#         enclosed by { and }.
EasyTemplate::process(text, variables)

NB: If you want to use raw { in your template you can escape it with \.

Examples:

EasyTemplate::process('Hello Mr {last name}!', {
    'last name' => 'Bowie'
  })

Hello Mr Bowie!

EasyTemplate::process('\{first name} {last name}!', {
    'first name' => 'Nina',
    'last name' => 'Simone'
  })

{first name} Simone!

License

Copyright © 2016 Jérémy Lecerf, EasyTemplate is free software, and may be redistributed under the terms specified in the license.

About

Easy template language in ruby, with only variable substitution

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages