summaryrefslogtreecommitdiff
path: root/lib/chef/cookbook
Commit message (Collapse)AuthorAgeFilesLines
* Workaround rubygems slow requires by only running require for chef-utils/distLance Albertson2020-09-151-1/+1
| | | | Signed-off-by: Lance Albertson <lance@osuosl.org>
* merge all dist files back into dist.rbMarc Chamberland2020-09-151-1/+1
| | | | | Signed-off-by: Marc Chamberland <chamberland.marc@gmail.com> Signed-off-by: Lance Albertson <lance@osuosl.org>
* tighten all require statements for dist implementationMarc Chamberland2020-09-151-1/+1
| | | | | Signed-off-by: Marc Chamberland <chamberland.marc@gmail.com> Signed-off-by: Lance Albertson <lance@osuosl.org>
* move dist implementation into chef-utilsMarc Chamberland2020-09-151-2/+2
| | | | | Signed-off-by: Marc Chamberland <chamberland.marc@gmail.com> Signed-off-by: Lance Albertson <lance@osuosl.org>
* Bump deps and resolve new Chefstyle warningsTim Smith2020-08-251-1/+1
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* Avoid assigning variables before returning if we don't have toTim Smith2020-07-072-5/+2
| | | | | | These seemed pretty straight forward. There's a new Rubocop cop for these. Signed-off-by: Tim Smith <tsmith@chef.io>
* Use .match? not =~ when match values aren't necessaryTim Smith2020-06-112-2/+2
| | | | | | Autocorrected from RuboCop Performance which is now smart enough to detect when you use the match and when you don't. Using match? does not create any objects so it's slightly faster and uses less memory. Signed-off-by: Tim Smith <tsmith@chef.io>
* Add back reference to chef "zolo".Pete Higgins2020-05-181-1/+1
| | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* Get lib/ free of spelling violations.Pete Higgins2020-05-183-3/+3
| | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* Stop handling the deprecated Chef version constraintsDan Webb2020-04-201-21/+20
| | | | | | | | | handle_deprecated_constraints has been a work around since Chef 10 Remove old specs that checked that the metadata was transformed correctly Signed-off-by: Daniel Webb <dan.webb@damacus.io>
* Remove copyright dateslcg/remove-copyright-datesLamont Granquist2020-04-1310-10/+10
| | | | | | | | Legally incredibly dubious, particularly since we don't follow it strictly as policy, and we have git history instead, which does it right. This is just a waste of time and a cargo cult. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Revert someVivek Singh2020-04-071-1/+1
| | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Fix typoVivek Singh2020-04-062-5/+5
| | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Implement eager_load_libraries metadata optionLamont Granquist2020-04-031-2/+26
| | | | | | | | This implements RFC-40 from the old chef rfc repo: https://github.com/chef-boneyard/chef-rfc/blob/master/rfc040-on-demand-cookbook-libraries.md Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Switch to canonical "https://rubygems.org" URL for rubygems.Pete Higgins2020-03-231-1/+1
| | | | Signed-off-by: Pete Higgins <pete@peterhiggins.org>
* Found some tests that fail when run by themselves on master.Ryan Davis2020-03-161-0/+1
| | | | | | But the failures are exacerbated by random order. Signed-off-by: Ryan Davis <zenspider@chef.io>
* Update all our links to use the new docs site formatTim Smith2020-03-041-4/+5
| | | | | | When we migrated to hugo the URLs changed a bit. Nothing ends in .html and we moved all the resources into their own dir. Signed-off-by: Tim Smith <tsmith@chef.io>
* switch the load method back to not raising + deprecationlcg/tweak-cbvLamont Granquist2020-01-241-2/+2
| | | | | | | use a proper deprecation instead of a warning and don't raise in the load method. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Provider a better error message in Chef::Cookbook::CookbookVersionLoaderTim Smith2020-01-231-1/+1
| | | | | | | When this shows up in logs it's impossible to figure out what actually needs to be updated Signed-off-by: Tim Smith <tsmith@chef.io>
* raising exception for empty cookbooks instead of skippingVasu11052020-01-221-1/+15
| | | | Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
* Removed comments.Vasu11052020-01-221-3/+0
| | | | Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
* Deprecated the load method in cookbook_version_loader and added deprecation ↵Vasu11052020-01-221-24/+4
| | | | | | warning for it. Updated code to raise error if cookbook repo has cookbook directory without cookbook files, this is to make sure user should fix their cookbook repo and remove any garbage from cookbook repository and then do bulk upload. Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
* Added deprecation warning for load and checking the impactVasu11052020-01-221-10/+25
| | | | Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
* Invoke chefignore for cookbook_dir itselfVivek Singh2019-10-281-1/+1
| | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Fix knife cookbook site share chefignore lookupVivek Singh2019-10-282-5/+5
| | | | | | | | Fix cookbook syntax_check dir path error if cookbook_path is an array Fix invalid error if cookbook_path set to nil or empty Array and TypeError: no implicit conversion of nil into String Chefignore for each cookbooks/:cookbook Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Update the #find_ignore_file to ignore file till root dirVivek Singh2019-10-281-11/+18
| | | | | | | - Minor update in #readable_file_or_symlink? method to use arg path params instead of instance var. - Change log level trace to debug for missing lookup path. Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Added support to provide additional options to bundle installAmol Shinde2019-09-041-2/+7
| | | | | | | - Added option to skip gem metadata installation - Added test cases for gem installer Signed-off-by: Amol Shinde <amol.shinde@msystechnologies.com>
* Style/SymbolProcLamont Granquist2019-07-053-3/+3
| | | | | | enforce pretzels. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/StringLiteralsInInterpolationLamont Granquist2019-07-053-3/+3
| | | | | | since we use double quotes, be consistent everywhere. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/ClassCheckLamont Granquist2019-07-051-2/+2
| | | | | | convert kind_of? to is_a? Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/RegexpLiteralLamont Granquist2019-07-053-4/+4
| | | | | | | given how many regexps we have with /'s in the match this seems like a very good one. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/MethodCallWithoutArgsParenthesesLamont Granquist2019-07-021-2/+2
| | | | | | | | zero args methods don't get parens. this certainly reads better than the inverse. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/SymbolArrayLamont Granquist2019-07-021-4/+4
| | | | | | start enforcing using %i{} instead of arrays of symbols Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Layout/EmptyLineAfterGuardClauseLamont Granquist2019-07-029-0/+16
| | | | | | | i like this one, gives visual priority to returns or raises that are buried in the middle of things. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* This hits the ones that are most frequently required.lcg/require-idempotencyLamont Granquist2019-05-203-5/+5
| | | | | | | | | Stops the kernel from scanning through all the activated gems every time in order to resolve names into pathnames. See rubygems/rubygems#2762 Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Convert require to require_relativeLamont Granquist2019-05-0810-29/+29
| | | | | | | This gives a speed boost since rubygems does not have to scan through every gem in the gemset in order to find the file. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* chef-client => Chef::Dist::CLIENTMarc Chamberland2019-04-261-1/+2
| | | | Signed-off-by: Marc Chamberland <mchamberland@pbsc.com>
* Remove 'attributes' attribute from cookbook metadataTim Smith2019-01-221-53/+2
| | | | | | | | We have a foodcritic rule to tell people not to do this It's not being used anywhere and is just a pile of code we run for no reason We should start warning that it's an unknown attribute when cookbooks contain these as it's wasted effort on the part of cookbook authors Signed-off-by: Tim Smith <tsmith@chef.io>
* Add a few missing license headersTim Smith2019-01-2210-8/+29
| | | | | | We should probably have these everywhere. Signed-off-by: Tim Smith <tsmith@chef.io>
* changes for rubocop engine upgrades.lcg/rubocop-upgradesLamont Granquist2019-01-152-21/+21
| | | | | | | this is the result of changes to rules we already previously had enabled. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* more removal of cookbook shadowing/merginglcg/chef-15-cleanup-cookbook-loaderLamont Granquist2018-10-301-5/+2
| | | | | | we no longer support reading cookbooks from multiple cookbook paths. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* clean up some ivars and mark some methods privateLamont Granquist2018-10-301-41/+43
| | | | | | not all of this class should be considered public Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* More cookbook loader cleanup and documentationLamont Granquist2018-10-301-12/+10
| | | | | | | | Removes a bit more cruft left over from removing cookbook merging. Tries to document what the loader actually is and what it does. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* replace some instances of to_hash with to_hlcg/to-h-cleanupLamont Granquist2018-09-263-42/+53
| | | | | | | | | | | to_hash on a lot of these objects should go away, but even eliminating all our calls to to_hash on these objects internally is difficult. (e.g. converting the knife ui code to call #to_h means we wind up calling nil#to_h which "helpfully" becomes '{}' which is hilarious and i don't know why someone thought that was a good idea). Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #6168 from oclaussen/generate_valid_gemfileTim Smith2018-07-161-0/+7
|\ | | | | Make gem_installer generate a valid Gemfile
| * Fail loudly when the gem installer finds conflicting gem requirementsOle Claussen2017-05-291-1/+1
| | | | | | | | Signed-off-by: Ole Claussen <claussen.ole@gmail.com>
| * Generate a valid Gemfile, even multiple gem declaration with keyword ↵Ole Claussen2017-05-291-0/+7
| | | | | | | | | | | | | | | | arguments exist. Previously, keyword argemunts to the gem declarations would just be appended, resulting in invalid Gemfiles. Now, keyword arguments are merged together. In case of conflict, the last declaration will win. Signed-off-by: Ole Claussen <claussen.ole@gmail.com>
* | fix Style/MutableConstantLamont Granquist2018-07-022-3/+3
| | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | fix Style/PreferredHashMethodsLamont Granquist2018-07-024-21/+21
| | | | | | | | | | | | | | absolutely hard requirement on the fixes that went into chef-config 2.2.11, so the floor of that gem is bumped up. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | fix Layout/LeadingCommentSpaceLamont Granquist2018-07-021-1/+1
| | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>