summaryrefslogtreecommitdiff
path: root/lib/chef/mixin/template.rb
Commit message (Collapse)AuthorAgeFilesLines
* Improving error handling for template renderGabriel Mazetto2019-05-291-9/+14
| | | | | | | | | | | | While Chef already implements a nice amount of information in `TemplateError#to_s`, when using ChefSpec with RSpec, the `#to_s` is not called, leaving us with no source information for template errors. By adding the filename to `Erubis::Eruby` initialization, we can get a better backtrace that will show up in RSpec output. Signed-off-by: Gabriel Mazetto <brodock@gmail.com>
* Cleanup a bit of YARD and add a few thingsTim Smith2018-01-221-3/+1
| | | | | | Mostly remove some warnings when running yard on the CLI Signed-off-by: Tim Smith <tsmith@chef.io>
* chefstyle Style/AndOr fixesLamont Granquist2016-03-141-1/+1
| | | | | this is part of our informal style guide, lets make it formal since clearly its not getting followed very well.
* autofixing whitespace copsLamont Granquist2016-02-051-5/+4
| | | | | | | | | | | | | | | | | | | | | | 4174 Style/SpaceInsideHashLiteralBraces 1860 Style/SpaceAroundOperators 1336 Style/SpaceInsideBlockBraces 1292 Style/AlignHash 997 Style/SpaceAfterComma 860 Style/SpaceAroundEqualsInParameterDefault 310 Style/EmptyLines 294 Style/IndentationConsistency 267 Style/TrailingWhitespace 238 Style/ExtraSpacing 212 Style/SpaceBeforeBlockBraces 166 Style/MultilineOperationIndentation 144 Style/TrailingBlankLines 120 Style/EmptyLineBetweenDefs 101 Style/IndentationWidth 82 Style/SpaceAroundBlockParameters 40 Style/EmptyLinesAroundMethodBody 29 Style/EmptyLinesAroundAccessModifier 1 Style/RescueEnsureAlignment
* Update all auth email address from opscode.com and getchef.com to chef.io.Noah Kantrowitz2016-02-021-1/+1
| | | Generated via git ls-files | xargs perl -pi -e "s/(Author.*?<[^@]+@)(?:opscode\\.com|getchef\\.com)(>)/\\1chef.io\\2/gi"
* Replace all Opscode copyrights with Chef Software.Noah Kantrowitz2016-02-021-1/+1
| | | Created via git ls-files | xargs perl -pi -e "s/(Copyright.*?), Opscode(,)? Inc(\.)?/\\1, Chef Software Inc./gi"
* Copyright year update for 2016 and massive cleanup.Noah Kantrowitz2016-02-021-1/+1
| | | Generated via git ls-files | xargs perl -pi -e "s/[Cc]opyright (?:\([Cc]\) )?((?\!$(date +%Y))\\d{4})(-\\d{4})?([, ][ \d]+)*(,|(?= ))/Copyright \\1-$(date +%Y),/g"
* Use double quotes by defaultThom May2016-01-141-2/+2
| | | | | | | This is an entirely mechanically generated (chefstyle -a) change, to go along with chef/chefstyle#5 . We should pick something and use it consistently, and my opinion is that double quotes are the appropriate thing.
* Merge pull request #3510 from ckaushik/issue_2513Thom May2015-09-021-0/+1
|\ | | | | Fixing Issue #2513 - the broken render of nested partial templates
| * Fixing Issue #2513 - the broken render of nested partial templates with ↵Kaushik C2015-07-271-0/+1
| | | | | | | | | | | | variables Authors: Kaushik C <kaushik.chand@gmail.com>, Sam Dunne <sam@sam-dunne.com>
* | PR feedbackLamont Granquist2015-08-181-39/+39
| |
* | CHEF-5012: add methods for template breadcrumbsLamont Granquist2015-08-181-0/+47
|/ | | | | | | | | | | | | | adds: - cookbook_name - recipe_name - recipe_line_string - recipe_path - recipe_line - template_name - template_path accessible both as instance var (@-) and method (bare), like @node/node.
* Remove binread functions (ruby 1.8 specific, issue #2497)Xabier de Zuazo2015-01-271-14/+2
|
* Use the platform's line endings when rendering templates.sersut2013-10-021-16/+13
|
* don't depend on line separator in partial testsdanielsdeleo2013-06-141-1/+1
| | | | | | | | | | | In some windows testing environments no line separator conversion is happening. This may be a function of git settings, or something else in our test cluster environment. In any case, line separators are irrelevant to these tests, as they are testing the partial template feature. We could remove the line endings from the test fixture files, but editors like vim add hidden newlines at the end of files, so this is difficult to maintain. Stripping the line endings within the test code is more sustainable option.
* Explain optional \r in newline conversion regexdanielsdeleo2013-06-071-0/+4
|
* Improve line separator conversion on windowsDaniel DeLeo2013-06-071-1/+1
| | | | | | | | * Unconditionally convert \r\n or \n to \r\n. This fixes cases where double converversion would result in \r\r\n * Use binmode to avoid double conversion in IO streams * Use binmode in tests to make sure we're not processing content before testing it.
* Add ruby 1.8 fallbacks for IO.binreaddanielsdeleo2013-06-071-2/+14
|
* Fix method override warnings tests for the new methods.sersut2013-05-301-1/+2
|
* Make sure that windows line endings are protected during template rendering.sersut2013-05-301-19/+35
|
* Add warning when overriding core template functionalitydanielsdeleo2013-05-301-0/+5
|
* Add inline doc for TemplateContextdanielsdeleo2013-05-291-2/+13
|
* Move helper module compilation inside template resourcedanielsdeleo2013-05-291-22/+0
| | | | | | | - Resource::Template compiles helper methods/module bodies into a collection of modules for inclusion into the template context. - Resource::Template checks for obvious invalid input to helper definition methods.
* Pass template extensions through to partialsdanielsdeleo2013-05-291-10/+73
| | | | | | | - move the new TemplateContext code into mixin/template and consolidate with ChefContext - Copy extension modules from parent template to partial template. - Functional tests for helpers with partials.
* fix whitespace and ruby warningsdanielsdeleo2013-05-291-15/+15
|
* [CHEF-3249] Add documentation on rendering partials.Andrea Campi2012-12-141-0/+23
|
* [CHEF-3249] Fix nested partials; add a test for that.Andrea Campi2012-12-141-1/+2
|
* [CHEF-3249] Refactor template name resolution out to a separate class for ↵Andrea Campi2012-12-141-4/+4
| | | | DRYness and readability. While here let's also extend the API to support local templates, as well as templates from other cookbooks.
* [CHEF-3249] Basic implementation of partials in templates.Andrea Campi2012-12-141-0/+16
|
* [OC-3564] move core Chef to the repo root \o/ \m/Seth Chisamore2012-10-301-0/+100
| | | | The opscode/chef repository now only contains the core Chef library code used by chef-client, knife and chef-solo!
* big refactor of the repo layout. move to a chef gem and a chef-server gem ↵Ezra Zygmuntowicz2008-10-081-39/+0
| | | | all with proper deps
* Adding specs for new resource types, fixes to node, mixin::templateAdam Jacob2008-09-081-6/+0
|
* Factoring out template rendering to a mixinAdam Jacob2008-09-011-0/+45