summaryrefslogtreecommitdiff
path: root/lib/chef/resource/conditional.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add a warning for guard blocks that return a non-empty string.Noah Kantrowitz2016-08-221-1/+9
| | | | | | | This will hopefully catch errors like this: myresource 'name' do not_if { 'some command' } end
* autofixing whitespace copsLamont Granquist2016-02-051-4/+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.
* Add Chef::GuardInterpreter.for_resource method to reduce duplicationSteven Danna2015-02-171-13/+2
|
* support arrays for not_if and only_ifDave Eddy2015-01-251-1/+1
|
* Differentiate between the default and the user set guard_attributes in order ↵Serdar Sutay2014-10-161-20/+16
| | | | to be able to warn users correctly when they configure a guard_attribute but use a ruby block in the guard.
* Enable guard_interpreters for the execute resource and set the default ↵Serdar Sutay2014-10-161-14/+20
| | | | | | interpreter for the execute resource to be :execute. This ensures that attributes of the resource like :environment & :cwd can be inherited by the guard when guard is specified as a string.
* Remove duplicate exceptionBryan McLellan2014-09-301-1/+3
| | | | | We already check for command || block_given? in initialize, so command cannot be nil && not have a block when we get here.
* unit test for guard_interpreter creation during compilationBryan McLellan2014-09-301-0/+1
| | | | | | make sure we don't evaluate the guard_interpreter immediately, i.e. during compilation of the resource, as the conditional may be seen before the guard_interpreter attribute.
* refactor conditional to evaluate for guards laterBryan McLellan2014-09-301-7/+17
| | | | | | | | If we don't create the guard_interpreter until we're ready to test it, we're sure to already have all the resource attributes evaluated. Previously we set up the guard_interpreter upon initialization, that is when it was first set on the resource.
* update functional tests for guard_interpreterBryan McLellan2014-09-301-1/+1
| | | | | | | we now raise an error when passed a block and a guard_interpreter is specified other than :default. When other interpreters become the "default" (which actually means use the default shell for that platform) we will need to consider those as well, i.e. #1495.
* guard_interpreter requires a commandBryan McLellan2014-09-301-0/+5
| | | | | | | | Raises an exception if guard_interpreter is set (not :default) and we are not given a command (i.e. we are given a block). This is not supported, as we pass a command to an external interpreter. Related to #1943
* CR feedback: move command evaluation to guard interpreterAdam Edwards2014-03-291-13/+11
|
* Fix namespacing issues caused by moving guard_interpreter logic out of ↵Adam Edwards2014-03-291-3/+15
| | | | Chef::Resource
* CR feedback: refactor guard interpreter logic out of Resource into ConditionalAdam Edwards2014-03-291-4/+7
|
* [CHEF-972] created a ConditionalAction class to be used in ↵Xabier de Zuazo2013-06-191-0/+4
| | | | resource#should_skip? method
* [OC-3564] move core Chef to the repo root \o/ \m/Seth Chisamore2012-10-301-0/+101
The opscode/chef repository now only contains the core Chef library code used by chef-client, knife and chef-solo!