@appthreat/atom-parsetools 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (838) hide show
  1. package/package.json +3 -3
  2. package/plugins/autoload.php +1 -1
  3. package/plugins/bin/bundler +1 -1
  4. package/plugins/bin/ruby_ast_gen +1 -1
  5. package/plugins/composer/autoload_classmap.php +22 -8
  6. package/plugins/composer/autoload_real.php +4 -4
  7. package/plugins/composer/autoload_static.php +26 -12
  8. package/plugins/composer/installed.json +12 -10
  9. package/plugins/composer/installed.php +9 -9
  10. package/plugins/nikic/php-parser/README.md +20 -12
  11. package/plugins/nikic/php-parser/bin/php-parse +11 -10
  12. package/plugins/nikic/php-parser/composer.json +6 -4
  13. package/plugins/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php +19 -17
  14. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Class_.php +35 -30
  15. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Declaration.php +11 -4
  16. package/plugins/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php +8 -7
  17. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Enum_.php +26 -27
  18. package/plugins/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php +7 -7
  19. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Function_.php +7 -7
  20. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Interface_.php +11 -10
  21. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Method.php +16 -15
  22. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php +5 -5
  23. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Param.php +38 -35
  24. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Property.php +82 -20
  25. package/plugins/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php +6 -5
  26. package/plugins/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php +25 -28
  27. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Trait_.php +16 -11
  28. package/plugins/nikic/php-parser/lib/PhpParser/Builder/Use_.php +8 -8
  29. package/plugins/nikic/php-parser/lib/PhpParser/Builder.php +2 -3
  30. package/plugins/nikic/php-parser/lib/PhpParser/BuilderFactory.php +46 -70
  31. package/plugins/nikic/php-parser/lib/PhpParser/BuilderHelpers.php +23 -20
  32. package/plugins/nikic/php-parser/lib/PhpParser/Comment/Doc.php +1 -2
  33. package/plugins/nikic/php-parser/lib/PhpParser/Comment.php +37 -67
  34. package/plugins/nikic/php-parser/lib/PhpParser/ConstExprEvaluationException.php +3 -3
  35. package/plugins/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php +15 -10
  36. package/plugins/nikic/php-parser/lib/PhpParser/Error.php +26 -33
  37. package/plugins/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php +6 -9
  38. package/plugins/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php +2 -3
  39. package/plugins/nikic/php-parser/lib/PhpParser/ErrorHandler.php +2 -3
  40. package/plugins/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php +11 -7
  41. package/plugins/nikic/php-parser/lib/PhpParser/Internal/Differ.php +36 -22
  42. package/plugins/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php +20 -13
  43. package/plugins/nikic/php-parser/lib/PhpParser/Internal/TokenPolyfill.php +237 -0
  44. package/plugins/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php +70 -74
  45. package/plugins/nikic/php-parser/lib/PhpParser/JsonDecoder.php +15 -10
  46. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php +72 -97
  47. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AsymmetricVisibilityTokenEmulator.php +93 -0
  48. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php +11 -18
  49. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php +10 -15
  50. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php +12 -11
  51. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php +24 -26
  52. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php +6 -10
  53. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php +22 -29
  54. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/PropertyTokenEmulator.php +19 -0
  55. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php +3 -3
  56. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php +10 -15
  57. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php +6 -5
  58. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php +10 -5
  59. package/plugins/nikic/php-parser/lib/PhpParser/Lexer.php +69 -513
  60. package/plugins/nikic/php-parser/lib/PhpParser/Modifiers.php +85 -0
  61. package/plugins/nikic/php-parser/lib/PhpParser/NameContext.php +24 -25
  62. package/plugins/nikic/php-parser/lib/PhpParser/Node/Arg.php +13 -15
  63. package/plugins/nikic/php-parser/lib/PhpParser/Node/ArrayItem.php +43 -0
  64. package/plugins/nikic/php-parser/lib/PhpParser/Node/Attribute.php +9 -10
  65. package/plugins/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php +5 -7
  66. package/plugins/nikic/php-parser/lib/PhpParser/Node/ClosureUse.php +36 -0
  67. package/plugins/nikic/php-parser/lib/PhpParser/Node/ComplexType.php +1 -2
  68. package/plugins/nikic/php-parser/lib/PhpParser/Node/Const_.php +9 -10
  69. package/plugins/nikic/php-parser/lib/PhpParser/Node/DeclareItem.php +37 -0
  70. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php +10 -11
  71. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php +4 -34
  72. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php +11 -11
  73. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php +33 -28
  74. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php +9 -10
  75. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php +2 -3
  76. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php +2 -3
  77. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php +2 -3
  78. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Coalesce.php +2 -3
  79. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Concat.php +2 -3
  80. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Div.php +2 -3
  81. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Minus.php +2 -3
  82. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mod.php +2 -3
  83. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mul.php +2 -3
  84. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Plus.php +2 -3
  85. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Pow.php +2 -3
  86. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php +2 -3
  87. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php +2 -3
  88. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php +7 -8
  89. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php +9 -10
  90. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php +4 -5
  91. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php +4 -5
  92. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php +4 -5
  93. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php +4 -5
  94. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php +4 -5
  95. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php +4 -5
  96. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Concat.php +4 -5
  97. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Div.php +4 -5
  98. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Equal.php +4 -5
  99. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Greater.php +4 -5
  100. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php +4 -5
  101. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php +4 -5
  102. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php +4 -5
  103. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php +4 -5
  104. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php +4 -5
  105. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Minus.php +4 -5
  106. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mod.php +4 -5
  107. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mul.php +4 -5
  108. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php +4 -5
  109. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php +4 -5
  110. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Plus.php +4 -5
  111. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Pow.php +4 -5
  112. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php +4 -5
  113. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php +4 -5
  114. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php +4 -5
  115. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php +4 -5
  116. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php +4 -5
  117. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php +8 -11
  118. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php +7 -8
  119. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php +7 -8
  120. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php +3 -7
  121. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php +2 -3
  122. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.php +2 -3
  123. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Double.php +5 -6
  124. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int_.php +2 -3
  125. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Object_.php +2 -3
  126. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.php +2 -3
  127. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Unset_.php +2 -3
  128. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php +5 -6
  129. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php +10 -10
  130. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php +7 -8
  131. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php +33 -26
  132. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php +4 -27
  133. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php +7 -8
  134. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php +7 -8
  135. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php +5 -6
  136. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php +7 -8
  137. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php +7 -8
  138. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php +10 -11
  139. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php +10 -11
  140. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php +13 -14
  141. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php +11 -11
  142. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php +7 -8
  143. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php +12 -8
  144. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php +8 -7
  145. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php +12 -12
  146. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php +10 -11
  147. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php +12 -12
  148. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php +10 -10
  149. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php +7 -8
  150. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php +7 -8
  151. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php +6 -7
  152. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php +7 -8
  153. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php +7 -8
  154. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php +10 -10
  155. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php +9 -9
  156. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php +12 -13
  157. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php +11 -11
  158. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php +12 -13
  159. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php +6 -7
  160. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php +7 -8
  161. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php +7 -8
  162. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php +6 -7
  163. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php +7 -8
  164. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php +10 -11
  165. package/plugins/nikic/php-parser/lib/PhpParser/Node/Expr.php +1 -2
  166. package/plugins/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php +5 -8
  167. package/plugins/nikic/php-parser/lib/PhpParser/Node/Identifier.php +24 -14
  168. package/plugins/nikic/php-parser/lib/PhpParser/Node/InterpolatedStringPart.php +32 -0
  169. package/plugins/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php +6 -9
  170. package/plugins/nikic/php-parser/lib/PhpParser/Node/MatchArm.php +8 -10
  171. package/plugins/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php +8 -9
  172. package/plugins/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php +8 -9
  173. package/plugins/nikic/php-parser/lib/PhpParser/Node/Name.php +78 -54
  174. package/plugins/nikic/php-parser/lib/PhpParser/Node/NullableType.php +11 -10
  175. package/plugins/nikic/php-parser/lib/PhpParser/Node/Param.php +83 -24
  176. package/plugins/nikic/php-parser/lib/PhpParser/Node/PropertyHook.php +105 -0
  177. package/plugins/nikic/php-parser/lib/PhpParser/Node/PropertyItem.php +37 -0
  178. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php +4 -70
  179. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php +4 -24
  180. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php +5 -22
  181. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/Float_.php +78 -0
  182. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php +82 -0
  183. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/InterpolatedString.php +34 -0
  184. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php +4 -73
  185. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php +4 -5
  186. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php +4 -5
  187. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.php +4 -5
  188. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php +4 -5
  189. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php +4 -5
  190. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php +4 -5
  191. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php +4 -5
  192. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Property.php +15 -0
  193. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php +4 -5
  194. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php +4 -5
  195. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php +30 -26
  196. package/plugins/nikic/php-parser/lib/PhpParser/Node/Scalar.php +1 -2
  197. package/plugins/nikic/php-parser/lib/PhpParser/Node/StaticVar.php +39 -0
  198. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Block.php +29 -0
  199. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php +8 -9
  200. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php +10 -11
  201. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php +11 -12
  202. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php +24 -32
  203. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php +17 -17
  204. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php +47 -54
  205. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php +46 -89
  206. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php +17 -10
  207. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php +8 -9
  208. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php +5 -26
  209. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php +12 -12
  210. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php +9 -10
  211. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php +7 -8
  212. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php +9 -10
  213. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php +7 -8
  214. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php +11 -12
  215. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php +17 -13
  216. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php +7 -8
  217. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php +7 -8
  218. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php +19 -15
  219. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php +20 -17
  220. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php +28 -24
  221. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php +7 -8
  222. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php +7 -8
  223. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php +16 -14
  224. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php +7 -8
  225. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php +18 -15
  226. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php +7 -8
  227. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php +13 -10
  228. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php +7 -8
  229. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php +11 -12
  230. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php +4 -5
  231. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php +68 -38
  232. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php +5 -26
  233. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php +8 -9
  234. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php +4 -30
  235. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php +8 -8
  236. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php +9 -10
  237. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php +8 -9
  238. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php +12 -13
  239. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php +9 -10
  240. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php +3 -4
  241. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php +10 -8
  242. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php +11 -12
  243. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php +7 -8
  244. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php +5 -44
  245. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php +16 -16
  246. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php +9 -10
  247. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt.php +1 -2
  248. package/plugins/nikic/php-parser/lib/PhpParser/Node/UnionType.php +7 -8
  249. package/plugins/nikic/php-parser/lib/PhpParser/Node/UseItem.php +55 -0
  250. package/plugins/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php +2 -3
  251. package/plugins/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php +2 -2
  252. package/plugins/nikic/php-parser/lib/PhpParser/Node.php +28 -29
  253. package/plugins/nikic/php-parser/lib/PhpParser/NodeAbstract.php +23 -20
  254. package/plugins/nikic/php-parser/lib/PhpParser/NodeDumper.php +177 -84
  255. package/plugins/nikic/php-parser/lib/PhpParser/NodeFinder.php +28 -19
  256. package/plugins/nikic/php-parser/lib/PhpParser/NodeTraverser.php +156 -160
  257. package/plugins/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php +4 -7
  258. package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php +1 -2
  259. package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php +82 -0
  260. package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php +6 -7
  261. package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php +6 -7
  262. package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php +37 -28
  263. package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php +29 -8
  264. package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php +23 -13
  265. package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitor.php +59 -7
  266. package/plugins/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php +1 -2
  267. package/plugins/nikic/php-parser/lib/PhpParser/Parser/Php7.php +2034 -2141
  268. package/plugins/nikic/php-parser/lib/PhpParser/Parser/Php8.php +2814 -0
  269. package/plugins/nikic/php-parser/lib/PhpParser/Parser.php +9 -3
  270. package/plugins/nikic/php-parser/lib/PhpParser/ParserAbstract.php +503 -269
  271. package/plugins/nikic/php-parser/lib/PhpParser/ParserFactory.php +15 -49
  272. package/plugins/nikic/php-parser/lib/PhpParser/PhpVersion.php +171 -0
  273. package/plugins/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php +428 -339
  274. package/plugins/nikic/php-parser/lib/PhpParser/PrettyPrinter.php +51 -0
  275. package/plugins/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php +563 -445
  276. package/plugins/nikic/php-parser/lib/PhpParser/Token.php +18 -0
  277. package/plugins/nikic/php-parser/lib/PhpParser/compatibility_tokens.php +68 -0
  278. package/plugins/rubyastgen/Gemfile +3 -2
  279. package/plugins/rubyastgen/Gemfile.lock +10 -5
  280. package/plugins/rubyastgen/bundle/bundler/setup.rb +4 -2
  281. package/plugins/rubyastgen/bundle/ruby/3.4.0/bin/bundle +29 -0
  282. package/plugins/rubyastgen/bundle/ruby/3.4.0/bin/bundler +29 -0
  283. package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/{ruby_ast_gen-2a9186207494 → ruby_ast_gen-8738b155eb4f}/Gemfile +2 -1
  284. package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/{ruby_ast_gen-2a9186207494 → ruby_ast_gen-8738b155eb4f}/README.md +7 -4
  285. package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-8738b155eb4f/bin/console +11 -0
  286. package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-8738b155eb4f/exe/ruby_ast_gen +60 -0
  287. package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/{ruby_ast_gen-2a9186207494 → ruby_ast_gen-8738b155eb4f}/lib/ruby_ast_gen/node_handling.rb +49 -31
  288. package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/{ruby_ast_gen-2a9186207494 → ruby_ast_gen-8738b155eb4f}/lib/ruby_ast_gen/version.rb +1 -1
  289. package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/{ruby_ast_gen-2a9186207494 → ruby_ast_gen-8738b155eb4f}/lib/ruby_ast_gen.rb +24 -10
  290. package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/{ruby_ast_gen-2a9186207494 → ruby_ast_gen-8738b155eb4f}/ruby_ast_gen.gemspec +4 -4
  291. package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-8738b155eb4f/spec/ruby_ast_gen_spec.rb +299 -0
  292. package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/{ruby_ast_gen-2a9186207494 → ruby_ast_gen-8738b155eb4f}/update_version.rb +6 -5
  293. package/plugins/rubyastgen/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/prism-1.4.0/gem.build_complete +0 -0
  294. package/plugins/rubyastgen/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/prism-1.4.0/gem_make.out +44 -0
  295. package/plugins/rubyastgen/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/prism-1.4.0/mkmf.log +74 -0
  296. package/plugins/rubyastgen/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/prism-1.4.0/prism/prism.so +0 -0
  297. package/plugins/rubyastgen/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/racc-1.8.1/gem_make.out +6 -6
  298. package/plugins/rubyastgen/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/racc-1.8.1/racc/cparse.so +0 -0
  299. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/CHANGELOG.md +5239 -0
  300. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/LICENSE.md +22 -0
  301. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/README.md +58 -0
  302. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/bundler.gemspec +46 -0
  303. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/exe/bundle +29 -0
  304. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/exe/bundler +4 -0
  305. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/.document +1 -0
  306. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/build_metadata.rb +45 -0
  307. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/capistrano.rb +22 -0
  308. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/checksum.rb +264 -0
  309. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/ci_detector.rb +75 -0
  310. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/add.rb +49 -0
  311. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/binstubs.rb +57 -0
  312. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/cache.rb +43 -0
  313. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/check.rb +40 -0
  314. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/clean.rb +25 -0
  315. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/common.rb +138 -0
  316. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/config.rb +204 -0
  317. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/console.rb +42 -0
  318. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/doctor.rb +161 -0
  319. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/exec.rb +89 -0
  320. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/fund.rb +36 -0
  321. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/gem.rb +467 -0
  322. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/info.rb +83 -0
  323. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/init.rb +51 -0
  324. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/inject.rb +60 -0
  325. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/install.rb +199 -0
  326. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/issue.rb +41 -0
  327. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/list.rb +66 -0
  328. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/lock.rb +94 -0
  329. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/open.rb +29 -0
  330. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/outdated.rb +297 -0
  331. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/platform.rb +48 -0
  332. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/plugin.rb +35 -0
  333. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/pristine.rb +60 -0
  334. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/remove.rb +17 -0
  335. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/show.rb +75 -0
  336. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/update.rb +123 -0
  337. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli/viz.rb +31 -0
  338. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/cli.rb +799 -0
  339. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/compact_index_client/cache.rb +96 -0
  340. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/compact_index_client/cache_file.rb +148 -0
  341. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/compact_index_client/parser.rb +84 -0
  342. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/compact_index_client/updater.rb +105 -0
  343. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/compact_index_client.rb +97 -0
  344. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/constants.rb +14 -0
  345. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/current_ruby.rb +82 -0
  346. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/definition.rb +1170 -0
  347. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/dependency.rb +151 -0
  348. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/deployment.rb +69 -0
  349. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/deprecate.rb +44 -0
  350. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/digest.rb +71 -0
  351. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/dsl.rb +638 -0
  352. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/endpoint_specification.rb +174 -0
  353. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/env.rb +148 -0
  354. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/environment_preserver.rb +68 -0
  355. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/errors.rb +281 -0
  356. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/feature_flag.rb +50 -0
  357. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/fetcher/base.rb +52 -0
  358. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/fetcher/compact_index.rb +120 -0
  359. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/fetcher/dependency.rb +78 -0
  360. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/fetcher/downloader.rb +91 -0
  361. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/fetcher/gem_remote_fetcher.rb +16 -0
  362. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/fetcher/index.rb +25 -0
  363. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/fetcher.rb +331 -0
  364. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/force_platform.rb +16 -0
  365. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/friendly_errors.rb +126 -0
  366. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/gem_helper.rb +237 -0
  367. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/gem_helpers.rb +144 -0
  368. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/gem_tasks.rb +7 -0
  369. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/gem_version_promoter.rb +147 -0
  370. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/graph.rb +152 -0
  371. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/index.rb +205 -0
  372. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/injector.rb +285 -0
  373. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/inline.rb +98 -0
  374. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/installer/gem_installer.rb +85 -0
  375. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/installer/parallel_installer.rb +203 -0
  376. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/installer/standalone.rb +113 -0
  377. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/installer.rb +243 -0
  378. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/lazy_specification.rb +234 -0
  379. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/lockfile_generator.rb +104 -0
  380. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/lockfile_parser.rb +300 -0
  381. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/.document +1 -0
  382. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-add.1 +76 -0
  383. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-add.1.ronn +87 -0
  384. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-binstubs.1 +33 -0
  385. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-binstubs.1.ronn +44 -0
  386. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-cache.1 +68 -0
  387. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-cache.1.ronn +108 -0
  388. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-check.1 +24 -0
  389. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-check.1.ronn +31 -0
  390. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-clean.1 +17 -0
  391. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-clean.1.ronn +18 -0
  392. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-config.1 +317 -0
  393. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-config.1.ronn +408 -0
  394. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-console.1 +33 -0
  395. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-console.1.ronn +39 -0
  396. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-doctor.1 +30 -0
  397. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-doctor.1.ronn +33 -0
  398. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-env.1 +9 -0
  399. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-env.1.ronn +10 -0
  400. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-exec.1 +107 -0
  401. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-exec.1.ronn +154 -0
  402. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-fund.1 +22 -0
  403. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-fund.1.ronn +25 -0
  404. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-gem.1 +87 -0
  405. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-gem.1.ronn +149 -0
  406. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-help.1 +9 -0
  407. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-help.1.ronn +12 -0
  408. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-info.1 +17 -0
  409. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-info.1.ronn +21 -0
  410. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-init.1 +20 -0
  411. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-init.1.ronn +32 -0
  412. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-inject.1 +31 -0
  413. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-inject.1.ronn +32 -0
  414. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-install.1 +218 -0
  415. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-install.1.ronn +387 -0
  416. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-issue.1 +45 -0
  417. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-issue.1.ronn +37 -0
  418. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-licenses.1 +9 -0
  419. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-licenses.1.ronn +10 -0
  420. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-list.1 +35 -0
  421. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-list.1.ronn +36 -0
  422. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-lock.1 +75 -0
  423. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-lock.1.ronn +115 -0
  424. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-open.1 +32 -0
  425. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-open.1.ronn +28 -0
  426. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-outdated.1 +103 -0
  427. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-outdated.1.ronn +110 -0
  428. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-platform.1 +49 -0
  429. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-platform.1.ronn +49 -0
  430. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-plugin.1 +58 -0
  431. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-plugin.1.ronn +63 -0
  432. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-pristine.1 +23 -0
  433. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-pristine.1.ronn +34 -0
  434. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-remove.1 +21 -0
  435. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-remove.1.ronn +23 -0
  436. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-show.1 +19 -0
  437. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-show.1.ronn +25 -0
  438. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-update.1 +281 -0
  439. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-update.1.ronn +359 -0
  440. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-version.1 +22 -0
  441. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-version.1.ronn +24 -0
  442. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-viz.1 +30 -0
  443. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle-viz.1.ronn +36 -0
  444. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle.1 +102 -0
  445. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/bundle.1.ronn +116 -0
  446. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/gemfile.5 +472 -0
  447. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/gemfile.5.ronn +558 -0
  448. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/man/index.txt +33 -0
  449. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/match_metadata.rb +30 -0
  450. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/match_platform.rb +23 -0
  451. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/match_remote_metadata.rb +29 -0
  452. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/materialization.rb +59 -0
  453. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/mirror.rb +221 -0
  454. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/plugin/api/source.rb +322 -0
  455. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/plugin/api.rb +81 -0
  456. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/plugin/dsl.rb +53 -0
  457. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/plugin/events.rb +85 -0
  458. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/plugin/index.rb +197 -0
  459. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/plugin/installer/git.rb +34 -0
  460. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/plugin/installer/path.rb +26 -0
  461. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/plugin/installer/rubygems.rb +19 -0
  462. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/plugin/installer.rb +132 -0
  463. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/plugin/source_list.rb +31 -0
  464. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/plugin.rb +378 -0
  465. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/process_lock.rb +20 -0
  466. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/remote_specification.rb +126 -0
  467. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/resolver/base.rb +118 -0
  468. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/resolver/candidate.rb +85 -0
  469. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/resolver/incompatibility.rb +15 -0
  470. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/resolver/package.rb +94 -0
  471. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/resolver/root.rb +25 -0
  472. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/resolver/spec_group.rb +74 -0
  473. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/resolver/strategy.rb +40 -0
  474. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/resolver.rb +522 -0
  475. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/retry.rb +66 -0
  476. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/ruby_dsl.rb +62 -0
  477. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/ruby_version.rb +137 -0
  478. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/rubygems_ext.rb +485 -0
  479. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/rubygems_gem_installer.rb +172 -0
  480. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/rubygems_integration.rb +455 -0
  481. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/runtime.rb +320 -0
  482. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/safe_marshal.rb +31 -0
  483. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/self_manager.rb +206 -0
  484. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/settings/validator.rb +102 -0
  485. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/settings.rb +599 -0
  486. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/setup.rb +39 -0
  487. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/shared_helpers.rb +398 -0
  488. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/similarity_detector.rb +63 -0
  489. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/source/gemspec.rb +15 -0
  490. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/source/git/git_proxy.rb +472 -0
  491. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/source/git.rb +452 -0
  492. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/source/metadata.rb +63 -0
  493. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/source/path/installer.rb +53 -0
  494. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/source/path.rb +250 -0
  495. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/source/rubygems/remote.rb +76 -0
  496. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/source/rubygems.rb +522 -0
  497. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/source/rubygems_aggregate.rb +68 -0
  498. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/source.rb +118 -0
  499. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/source_list.rb +273 -0
  500. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/source_map.rb +71 -0
  501. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/spec_set.rb +367 -0
  502. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/stub_specification.rb +146 -0
  503. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/.document +1 -0
  504. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/Executable +27 -0
  505. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/Executable.bundler +109 -0
  506. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/Executable.standalone +14 -0
  507. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/Gemfile +5 -0
  508. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
  509. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +132 -0
  510. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/Cargo.toml.tt +7 -0
  511. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/Gemfile.tt +24 -0
  512. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/LICENSE.txt.tt +21 -0
  513. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/README.md.tt +49 -0
  514. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/Rakefile.tt +67 -0
  515. package/plugins/rubyastgen/bundle/ruby/3.4.0/{bundler/gems/ruby_ast_gen-2a9186207494/bin/console → gems/bundler-2.6.7/lib/bundler/templates/newgem/bin/console.tt} +1 -1
  516. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/{ostruct-0.6.1/bin/setup → bundler-2.6.7/lib/bundler/templates/newgem/bin/setup.tt} +0 -0
  517. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/circleci/config.yml.tt +25 -0
  518. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
  519. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
  520. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt +10 -0
  521. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
  522. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +9 -0
  523. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +6 -0
  524. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
  525. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/github/workflows/main.yml.tt +37 -0
  526. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/gitignore.tt +23 -0
  527. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/gitlab-ci.yml.tt +18 -0
  528. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +9 -0
  529. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/lib/newgem.rb.tt +15 -0
  530. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/newgem.gemspec.tt +52 -0
  531. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/rspec.tt +3 -0
  532. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/rubocop.yml.tt +8 -0
  533. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
  534. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +11 -0
  535. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +15 -0
  536. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/standard.yml.tt +3 -0
  537. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/test/minitest/test_helper.rb.tt +6 -0
  538. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/test/minitest/test_newgem.rb.tt +13 -0
  539. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
  540. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
  541. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/ui/rg_proxy.rb +19 -0
  542. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/ui/shell.rb +187 -0
  543. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/ui/silent.rb +96 -0
  544. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/ui.rb +9 -0
  545. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/uri_credentials_filter.rb +43 -0
  546. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/uri_normalizer.rb +23 -0
  547. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/.document +1 -0
  548. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/connection_pool/.document +1 -0
  549. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/connection_pool/LICENSE +20 -0
  550. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +224 -0
  551. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
  552. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +56 -0
  553. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +186 -0
  554. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/fileutils/.document +1 -0
  555. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/fileutils/lib/fileutils.rb +2696 -0
  556. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/net-http-persistent/.document +1 -0
  557. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
  558. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +41 -0
  559. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +65 -0
  560. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
  561. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1111 -0
  562. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/pub_grub/.document +1 -0
  563. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/pub_grub/LICENSE.txt +21 -0
  564. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
  565. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +169 -0
  566. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
  567. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +150 -0
  568. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
  569. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
  570. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
  571. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
  572. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +61 -0
  573. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/pub_grub/lib/pub_grub/strategy.rb +42 -0
  574. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
  575. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
  576. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +129 -0
  577. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +423 -0
  578. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +236 -0
  579. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +178 -0
  580. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +31 -0
  581. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/securerandom/.document +1 -0
  582. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/securerandom/COPYING +56 -0
  583. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/securerandom/lib/securerandom.rb +102 -0
  584. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/.document +1 -0
  585. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/LICENSE.md +20 -0
  586. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +105 -0
  587. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +61 -0
  588. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +108 -0
  589. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +143 -0
  590. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +371 -0
  591. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +130 -0
  592. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/actions.rb +340 -0
  593. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/base.rb +825 -0
  594. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/command.rb +151 -0
  595. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +107 -0
  596. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/error.rb +106 -0
  597. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/group.rb +292 -0
  598. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/invocation.rb +178 -0
  599. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +37 -0
  600. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +88 -0
  601. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/line_editor.rb +17 -0
  602. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
  603. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +86 -0
  604. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +195 -0
  605. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/parser/option.rb +178 -0
  606. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/parser/options.rb +294 -0
  607. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -0
  608. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +72 -0
  609. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/runner.rb +335 -0
  610. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +388 -0
  611. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/shell/color.rb +112 -0
  612. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/shell/column_printer.rb +29 -0
  613. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/shell/html.rb +81 -0
  614. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +118 -0
  615. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/shell/terminal.rb +42 -0
  616. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb +38 -0
  617. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/shell.rb +81 -0
  618. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/util.rb +285 -0
  619. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor/version.rb +3 -0
  620. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/thor/lib/thor.rb +674 -0
  621. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/tsort/.document +1 -0
  622. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
  623. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/tsort/lib/tsort.rb +455 -0
  624. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/uri/.document +1 -0
  625. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/uri/COPYING +56 -0
  626. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/uri/lib/uri/common.rb +880 -0
  627. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/uri/lib/uri/file.rb +100 -0
  628. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
  629. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/uri/lib/uri/generic.rb +1579 -0
  630. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/uri/lib/uri/http.rb +125 -0
  631. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
  632. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
  633. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/uri/lib/uri/ldaps.rb +22 -0
  634. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/uri/lib/uri/mailto.rb +293 -0
  635. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
  636. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +206 -0
  637. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
  638. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/uri/lib/uri/ws.rb +83 -0
  639. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/uri/lib/uri/wss.rb +23 -0
  640. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendor/uri/lib/uri.rb +104 -0
  641. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendored_fileutils.rb +4 -0
  642. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendored_net_http.rb +23 -0
  643. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendored_persistent.rb +11 -0
  644. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendored_pub_grub.rb +4 -0
  645. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendored_securerandom.rb +12 -0
  646. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendored_thor.rb +8 -0
  647. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendored_timeout.rb +12 -0
  648. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendored_tsort.rb +4 -0
  649. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vendored_uri.rb +21 -0
  650. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/version.rb +13 -0
  651. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/vlad.rb +17 -0
  652. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/worker.rb +117 -0
  653. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler/yaml_serializer.rb +98 -0
  654. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/bundler-2.6.7/lib/bundler.rb +701 -0
  655. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.3/COPYING +56 -0
  656. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/ostruct-0.6.3/bin/setup +8 -0
  657. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/{ostruct-0.6.1 → ostruct-0.6.3}/lib/ostruct.rb +5 -2
  658. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/{ostruct-0.6.1 → ostruct-0.6.3}/ostruct.gemspec +2 -0
  659. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/BSDmakefile +58 -0
  660. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/CHANGELOG.md +684 -0
  661. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/CODE_OF_CONDUCT.md +76 -0
  662. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/CONTRIBUTING.md +58 -0
  663. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/LICENSE.md +7 -0
  664. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/Makefile +108 -0
  665. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/README.md +141 -0
  666. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/config.yml +4486 -0
  667. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/docs/build_system.md +119 -0
  668. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/docs/configuration.md +68 -0
  669. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/docs/cruby_compilation.md +27 -0
  670. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/docs/design.md +53 -0
  671. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/docs/encoding.md +121 -0
  672. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/docs/fuzzing.md +88 -0
  673. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/docs/heredocs.md +36 -0
  674. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/docs/javascript.md +118 -0
  675. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/docs/local_variable_depth.md +229 -0
  676. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/docs/mapping.md +117 -0
  677. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/docs/parser_translation.md +39 -0
  678. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/docs/parsing_rules.md +22 -0
  679. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/docs/releasing.md +96 -0
  680. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/docs/relocation.md +34 -0
  681. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/docs/ripper_translation.md +72 -0
  682. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/docs/ruby_api.md +44 -0
  683. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/docs/ruby_parser_translation.md +19 -0
  684. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/docs/serialization.md +233 -0
  685. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/docs/testing.md +55 -0
  686. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/ext/prism/Makefile +273 -0
  687. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/ext/prism/api_node.c +6939 -0
  688. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/ext/prism/api_pack.c +276 -0
  689. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/ext/prism/extconf.rb +127 -0
  690. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/ext/prism/extension.c +1406 -0
  691. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/ext/prism/extension.h +19 -0
  692. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/ast.h +7964 -0
  693. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/defines.h +260 -0
  694. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/diagnostic.h +451 -0
  695. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/encoding.h +283 -0
  696. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/node.h +129 -0
  697. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/options.h +442 -0
  698. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/pack.h +163 -0
  699. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/parser.h +933 -0
  700. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/prettyprint.h +34 -0
  701. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/regexp.h +43 -0
  702. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/static_literals.h +121 -0
  703. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/util/pm_buffer.h +228 -0
  704. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/util/pm_char.h +204 -0
  705. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/util/pm_constant_pool.h +218 -0
  706. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/util/pm_integer.h +126 -0
  707. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/util/pm_list.h +97 -0
  708. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/util/pm_memchr.h +29 -0
  709. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/util/pm_newline_list.h +113 -0
  710. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/util/pm_string.h +190 -0
  711. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/util/pm_strncasecmp.h +32 -0
  712. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/util/pm_strpbrk.h +46 -0
  713. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism/version.h +29 -0
  714. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/include/prism.h +383 -0
  715. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/compiler.rb +496 -0
  716. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/desugar_compiler.rb +391 -0
  717. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/dispatcher.rb +2194 -0
  718. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/dot_visitor.rb +4758 -0
  719. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/dsl.rb +1000 -0
  720. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/ffi.rb +560 -0
  721. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/inspect_visitor.rb +2389 -0
  722. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/lex_compat.rb +927 -0
  723. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/mutation_compiler.rb +769 -0
  724. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/node.rb +18645 -0
  725. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/node_ext.rb +508 -0
  726. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/pack.rb +228 -0
  727. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/parse_result/comments.rb +187 -0
  728. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/parse_result/errors.rb +65 -0
  729. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/parse_result/newlines.rb +154 -0
  730. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/parse_result.rb +910 -0
  731. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/pattern.rb +268 -0
  732. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/polyfill/append_as_bytes.rb +15 -0
  733. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/polyfill/byteindex.rb +13 -0
  734. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/polyfill/unpack1.rb +14 -0
  735. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/prism.so +0 -0
  736. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/reflection.rb +413 -0
  737. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/relocation.rb +504 -0
  738. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/serialize.rb +2392 -0
  739. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/string_query.rb +30 -0
  740. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/translation/parser/builder.rb +61 -0
  741. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/translation/parser/compiler.rb +2212 -0
  742. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/translation/parser/lexer.rb +812 -0
  743. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/translation/parser.rb +355 -0
  744. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/translation/parser33.rb +12 -0
  745. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/translation/parser34.rb +12 -0
  746. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/translation/parser35.rb +12 -0
  747. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/translation/ripper/sexp.rb +125 -0
  748. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/translation/ripper/shim.rb +5 -0
  749. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/translation/ripper.rb +3458 -0
  750. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/translation/ruby_parser.rb +1646 -0
  751. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/translation.rb +14 -0
  752. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism/visitor.rb +508 -0
  753. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/lib/prism.rb +89 -0
  754. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/prism.gemspec +170 -0
  755. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/rbi/prism/compiler.rbi +12 -0
  756. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/rbi/prism/dsl.rbi +524 -0
  757. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/rbi/prism/inspect_visitor.rbi +12 -0
  758. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/rbi/prism/node.rbi +8722 -0
  759. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/rbi/prism/node_ext.rbi +107 -0
  760. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/rbi/prism/parse_result.rbi +404 -0
  761. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/rbi/prism/reflection.rbi +58 -0
  762. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/rbi/prism/string_query.rbi +12 -0
  763. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/rbi/prism/translation/parser.rbi +11 -0
  764. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/rbi/prism/translation/parser33.rbi +6 -0
  765. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/rbi/prism/translation/parser34.rbi +6 -0
  766. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/rbi/prism/translation/parser35.rbi +6 -0
  767. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/rbi/prism/translation/ripper.rbi +15 -0
  768. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/rbi/prism/visitor.rbi +473 -0
  769. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/rbi/prism.rbi +66 -0
  770. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/sig/prism/compiler.rbs +9 -0
  771. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/sig/prism/dispatcher.rbs +16 -0
  772. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/sig/prism/dot_visitor.rbs +6 -0
  773. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/sig/prism/dsl.rbs +351 -0
  774. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/sig/prism/inspect_visitor.rbs +22 -0
  775. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/sig/prism/lex_compat.rbs +10 -0
  776. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/sig/prism/mutation_compiler.rbs +159 -0
  777. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/sig/prism/node.rbs +3614 -0
  778. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/sig/prism/node_ext.rbs +82 -0
  779. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/sig/prism/pack.rbs +43 -0
  780. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/sig/prism/parse_result.rbs +192 -0
  781. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/sig/prism/pattern.rbs +13 -0
  782. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/sig/prism/reflection.rbs +50 -0
  783. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/sig/prism/relocation.rbs +185 -0
  784. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/sig/prism/serialize.rbs +8 -0
  785. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/sig/prism/string_query.rbs +11 -0
  786. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/sig/prism/visitor.rbs +169 -0
  787. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/sig/prism.rbs +254 -0
  788. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/src/diagnostic.c +842 -0
  789. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/src/encoding.c +5235 -0
  790. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/src/node.c +8674 -0
  791. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/src/options.c +328 -0
  792. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/src/pack.c +509 -0
  793. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/src/prettyprint.c +8939 -0
  794. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/src/prism.c +23184 -0
  795. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/src/regexp.c +790 -0
  796. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/src/serialize.c +2266 -0
  797. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/src/static_literals.c +617 -0
  798. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/src/token_type.c +701 -0
  799. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/src/util/pm_buffer.c +357 -0
  800. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/src/util/pm_char.c +318 -0
  801. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/src/util/pm_constant_pool.c +342 -0
  802. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/src/util/pm_integer.c +670 -0
  803. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/src/util/pm_list.c +49 -0
  804. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/src/util/pm_memchr.c +35 -0
  805. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/src/util/pm_newline_list.c +125 -0
  806. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/src/util/pm_string.c +383 -0
  807. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/src/util/pm_strncasecmp.c +36 -0
  808. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/prism-1.4.0/src/util/pm_strpbrk.c +206 -0
  809. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/ext/racc/cparse/Makefile +3 -3
  810. package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/racc-1.8.1/lib/racc/cparse.so +0 -0
  811. package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/ast-2.4.3.gemspec +1 -1
  812. package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/bundler-2.6.7.gemspec +25 -0
  813. package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/{ostruct-0.6.1.gemspec → ostruct-0.6.3.gemspec} +5 -4
  814. package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/parser-3.3.8.0.gemspec +1 -1
  815. package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/prism-1.4.0.gemspec +24 -0
  816. package/plugins/rubyastgen/bundle/ruby/3.4.0/specifications/racc-1.8.1.gemspec +1 -1
  817. package/rbastgen.js +1 -1
  818. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php +0 -47
  819. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php +0 -76
  820. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php +0 -23
  821. package/plugins/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php +0 -105
  822. package/plugins/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php +0 -30
  823. package/plugins/nikic/php-parser/lib/PhpParser/Parser/Multiple.php +0 -55
  824. package/plugins/nikic/php-parser/lib/PhpParser/Parser/Php5.php +0 -2682
  825. package/plugins/nikic/php-parser/lib/PhpParser/Parser/Tokens.php +0 -148
  826. package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-2a9186207494/exe/ruby_ast_gen +0 -59
  827. package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/ruby_ast_gen-2a9186207494/spec/ruby_ast_gen_spec.rb +0 -175
  828. /package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/{ruby_ast_gen-2a9186207494 → ruby_ast_gen-8738b155eb4f}/.rspec +0 -0
  829. /package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/{ruby_ast_gen-2a9186207494 → ruby_ast_gen-8738b155eb4f}/LICENSE.txt +0 -0
  830. /package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/{ruby_ast_gen-2a9186207494 → ruby_ast_gen-8738b155eb4f}/Rakefile +0 -0
  831. /package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/{ruby_ast_gen-2a9186207494 → ruby_ast_gen-8738b155eb4f}/bin/setup +0 -0
  832. /package/plugins/rubyastgen/bundle/ruby/3.4.0/bundler/gems/{ruby_ast_gen-2a9186207494 → ruby_ast_gen-8738b155eb4f}/spec/spec_helper.rb +0 -0
  833. /package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/{ostruct-0.6.1 → bundler-2.6.7/lib/bundler/vendor/fileutils}/COPYING +0 -0
  834. /package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/{ostruct-0.6.1 → ostruct-0.6.3}/BSDL +0 -0
  835. /package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/{ostruct-0.6.1 → ostruct-0.6.3}/Gemfile +0 -0
  836. /package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/{ostruct-0.6.1 → ostruct-0.6.3}/README.md +0 -0
  837. /package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/{ostruct-0.6.1 → ostruct-0.6.3}/Rakefile +0 -0
  838. /package/plugins/rubyastgen/bundle/ruby/3.4.0/gems/{ostruct-0.6.1 → ostruct-0.6.3}/bin/console +0 -0
@@ -0,0 +1,2696 @@
1
+ # frozen_string_literal: true
2
+
3
+ begin
4
+ require 'rbconfig'
5
+ rescue LoadError
6
+ # for make rjit-headers
7
+ end
8
+
9
+ # Namespace for file utility methods for copying, moving, removing, etc.
10
+ #
11
+ # == What's Here
12
+ #
13
+ # First, what’s elsewhere. \Module \Bundler::FileUtils:
14
+ #
15
+ # - Inherits from {class Object}[https://docs.ruby-lang.org/en/master/Object.html].
16
+ # - Supplements {class File}[https://docs.ruby-lang.org/en/master/File.html]
17
+ # (but is not included or extended there).
18
+ #
19
+ # Here, module \Bundler::FileUtils provides methods that are useful for:
20
+ #
21
+ # - {Creating}[rdoc-ref:FileUtils@Creating].
22
+ # - {Deleting}[rdoc-ref:FileUtils@Deleting].
23
+ # - {Querying}[rdoc-ref:FileUtils@Querying].
24
+ # - {Setting}[rdoc-ref:FileUtils@Setting].
25
+ # - {Comparing}[rdoc-ref:FileUtils@Comparing].
26
+ # - {Copying}[rdoc-ref:FileUtils@Copying].
27
+ # - {Moving}[rdoc-ref:FileUtils@Moving].
28
+ # - {Options}[rdoc-ref:FileUtils@Options].
29
+ #
30
+ # === Creating
31
+ #
32
+ # - ::mkdir: Creates directories.
33
+ # - ::mkdir_p, ::makedirs, ::mkpath: Creates directories,
34
+ # also creating ancestor directories as needed.
35
+ # - ::link_entry: Creates a hard link.
36
+ # - ::ln, ::link: Creates hard links.
37
+ # - ::ln_s, ::symlink: Creates symbolic links.
38
+ # - ::ln_sf: Creates symbolic links, overwriting if necessary.
39
+ # - ::ln_sr: Creates symbolic links relative to targets
40
+ #
41
+ # === Deleting
42
+ #
43
+ # - ::remove_dir: Removes a directory and its descendants.
44
+ # - ::remove_entry: Removes an entry, including its descendants if it is a directory.
45
+ # - ::remove_entry_secure: Like ::remove_entry, but removes securely.
46
+ # - ::remove_file: Removes a file entry.
47
+ # - ::rm, ::remove: Removes entries.
48
+ # - ::rm_f, ::safe_unlink: Like ::rm, but removes forcibly.
49
+ # - ::rm_r: Removes entries and their descendants.
50
+ # - ::rm_rf, ::rmtree: Like ::rm_r, but removes forcibly.
51
+ # - ::rmdir: Removes directories.
52
+ #
53
+ # === Querying
54
+ #
55
+ # - ::pwd, ::getwd: Returns the path to the working directory.
56
+ # - ::uptodate?: Returns whether a given entry is newer than given other entries.
57
+ #
58
+ # === Setting
59
+ #
60
+ # - ::cd, ::chdir: Sets the working directory.
61
+ # - ::chmod: Sets permissions for an entry.
62
+ # - ::chmod_R: Sets permissions for an entry and its descendants.
63
+ # - ::chown: Sets the owner and group for entries.
64
+ # - ::chown_R: Sets the owner and group for entries and their descendants.
65
+ # - ::touch: Sets modification and access times for entries,
66
+ # creating if necessary.
67
+ #
68
+ # === Comparing
69
+ #
70
+ # - ::compare_file, ::cmp, ::identical?: Returns whether two entries are identical.
71
+ # - ::compare_stream: Returns whether two streams are identical.
72
+ #
73
+ # === Copying
74
+ #
75
+ # - ::copy_entry: Recursively copies an entry.
76
+ # - ::copy_file: Copies an entry.
77
+ # - ::copy_stream: Copies a stream.
78
+ # - ::cp, ::copy: Copies files.
79
+ # - ::cp_lr: Recursively creates hard links.
80
+ # - ::cp_r: Recursively copies files, retaining mode, owner, and group.
81
+ # - ::install: Recursively copies files, optionally setting mode,
82
+ # owner, and group.
83
+ #
84
+ # === Moving
85
+ #
86
+ # - ::mv, ::move: Moves entries.
87
+ #
88
+ # === Options
89
+ #
90
+ # - ::collect_method: Returns the names of methods that accept a given option.
91
+ # - ::commands: Returns the names of methods that accept options.
92
+ # - ::have_option?: Returns whether a given method accepts a given option.
93
+ # - ::options: Returns all option names.
94
+ # - ::options_of: Returns the names of the options for a given method.
95
+ #
96
+ # == Path Arguments
97
+ #
98
+ # Some methods in \Bundler::FileUtils accept _path_ arguments,
99
+ # which are interpreted as paths to filesystem entries:
100
+ #
101
+ # - If the argument is a string, that value is the path.
102
+ # - If the argument has method +:to_path+, it is converted via that method.
103
+ # - If the argument has method +:to_str+, it is converted via that method.
104
+ #
105
+ # == About the Examples
106
+ #
107
+ # Some examples here involve trees of file entries.
108
+ # For these, we sometimes display trees using the
109
+ # {tree command-line utility}[https://en.wikipedia.org/wiki/Tree_(command)],
110
+ # which is a recursive directory-listing utility that produces
111
+ # a depth-indented listing of files and directories.
112
+ #
113
+ # We use a helper method to launch the command and control the format:
114
+ #
115
+ # def tree(dirpath = '.')
116
+ # command = "tree --noreport --charset=ascii #{dirpath}"
117
+ # system(command)
118
+ # end
119
+ #
120
+ # To illustrate:
121
+ #
122
+ # tree('src0')
123
+ # # => src0
124
+ # # |-- sub0
125
+ # # | |-- src0.txt
126
+ # # | `-- src1.txt
127
+ # # `-- sub1
128
+ # # |-- src2.txt
129
+ # # `-- src3.txt
130
+ #
131
+ # == Avoiding the TOCTTOU Vulnerability
132
+ #
133
+ # For certain methods that recursively remove entries,
134
+ # there is a potential vulnerability called the
135
+ # {Time-of-check to time-of-use}[https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use],
136
+ # or TOCTTOU, vulnerability that can exist when:
137
+ #
138
+ # - An ancestor directory of the entry at the target path is world writable;
139
+ # such directories include <tt>/tmp</tt>.
140
+ # - The directory tree at the target path includes:
141
+ #
142
+ # - A world-writable descendant directory.
143
+ # - A symbolic link.
144
+ #
145
+ # To avoid that vulnerability, you can use this method to remove entries:
146
+ #
147
+ # - Bundler::FileUtils.remove_entry_secure: removes recursively
148
+ # if the target path points to a directory.
149
+ #
150
+ # Also available are these methods,
151
+ # each of which calls \Bundler::FileUtils.remove_entry_secure:
152
+ #
153
+ # - Bundler::FileUtils.rm_r with keyword argument <tt>secure: true</tt>.
154
+ # - Bundler::FileUtils.rm_rf with keyword argument <tt>secure: true</tt>.
155
+ #
156
+ # Finally, this method for moving entries calls \Bundler::FileUtils.remove_entry_secure
157
+ # if the source and destination are on different file systems
158
+ # (which means that the "move" is really a copy and remove):
159
+ #
160
+ # - Bundler::FileUtils.mv with keyword argument <tt>secure: true</tt>.
161
+ #
162
+ # \Method \Bundler::FileUtils.remove_entry_secure removes securely
163
+ # by applying a special pre-process:
164
+ #
165
+ # - If the target path points to a directory, this method uses methods
166
+ # {File#chown}[https://docs.ruby-lang.org/en/master/File.html#method-i-chown]
167
+ # and {File#chmod}[https://docs.ruby-lang.org/en/master/File.html#method-i-chmod]
168
+ # in removing directories.
169
+ # - The owner of the target directory should be either the current process
170
+ # or the super user (root).
171
+ #
172
+ # WARNING: You must ensure that *ALL* parent directories cannot be
173
+ # moved by other untrusted users. For example, parent directories
174
+ # should not be owned by untrusted users, and should not be world
175
+ # writable except when the sticky bit is set.
176
+ #
177
+ # For details of this security vulnerability, see Perl cases:
178
+ #
179
+ # - {CVE-2005-0448}[https://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-0448].
180
+ # - {CVE-2004-0452}[https://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0452].
181
+ #
182
+ module Bundler::FileUtils
183
+ # The version number.
184
+ VERSION = "1.7.3"
185
+
186
+ def self.private_module_function(name) #:nodoc:
187
+ module_function name
188
+ private_class_method name
189
+ end
190
+
191
+ #
192
+ # Returns a string containing the path to the current directory:
193
+ #
194
+ # Bundler::FileUtils.pwd # => "/rdoc/fileutils"
195
+ #
196
+ # Related: Bundler::FileUtils.cd.
197
+ #
198
+ def pwd
199
+ Dir.pwd
200
+ end
201
+ module_function :pwd
202
+
203
+ alias getwd pwd
204
+ module_function :getwd
205
+
206
+ # Changes the working directory to the given +dir+, which
207
+ # should be {interpretable as a path}[rdoc-ref:FileUtils@Path+Arguments]:
208
+ #
209
+ # With no block given,
210
+ # changes the current directory to the directory at +dir+; returns zero:
211
+ #
212
+ # Bundler::FileUtils.pwd # => "/rdoc/fileutils"
213
+ # Bundler::FileUtils.cd('..')
214
+ # Bundler::FileUtils.pwd # => "/rdoc"
215
+ # Bundler::FileUtils.cd('fileutils')
216
+ #
217
+ # With a block given, changes the current directory to the directory
218
+ # at +dir+, calls the block with argument +dir+,
219
+ # and restores the original current directory; returns the block's value:
220
+ #
221
+ # Bundler::FileUtils.pwd # => "/rdoc/fileutils"
222
+ # Bundler::FileUtils.cd('..') { |arg| [arg, Bundler::FileUtils.pwd] } # => ["..", "/rdoc"]
223
+ # Bundler::FileUtils.pwd # => "/rdoc/fileutils"
224
+ #
225
+ # Keyword arguments:
226
+ #
227
+ # - <tt>verbose: true</tt> - prints an equivalent command:
228
+ #
229
+ # Bundler::FileUtils.cd('..')
230
+ # Bundler::FileUtils.cd('fileutils')
231
+ #
232
+ # Output:
233
+ #
234
+ # cd ..
235
+ # cd fileutils
236
+ #
237
+ # Related: Bundler::FileUtils.pwd.
238
+ #
239
+ def cd(dir, verbose: nil, &block) # :yield: dir
240
+ fu_output_message "cd #{dir}" if verbose
241
+ result = Dir.chdir(dir, &block)
242
+ fu_output_message 'cd -' if verbose and block
243
+ result
244
+ end
245
+ module_function :cd
246
+
247
+ alias chdir cd
248
+ module_function :chdir
249
+
250
+ #
251
+ # Returns +true+ if the file at path +new+
252
+ # is newer than all the files at paths in array +old_list+;
253
+ # +false+ otherwise.
254
+ #
255
+ # Argument +new+ and the elements of +old_list+
256
+ # should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments]:
257
+ #
258
+ # Bundler::FileUtils.uptodate?('Rakefile', ['Gemfile', 'README.md']) # => true
259
+ # Bundler::FileUtils.uptodate?('Gemfile', ['Rakefile', 'README.md']) # => false
260
+ #
261
+ # A non-existent file is considered to be infinitely old.
262
+ #
263
+ # Related: Bundler::FileUtils.touch.
264
+ #
265
+ def uptodate?(new, old_list)
266
+ return false unless File.exist?(new)
267
+ new_time = File.mtime(new)
268
+ old_list.each do |old|
269
+ if File.exist?(old)
270
+ return false unless new_time > File.mtime(old)
271
+ end
272
+ end
273
+ true
274
+ end
275
+ module_function :uptodate?
276
+
277
+ def remove_trailing_slash(dir) #:nodoc:
278
+ dir == '/' ? dir : dir.chomp(?/)
279
+ end
280
+ private_module_function :remove_trailing_slash
281
+
282
+ #
283
+ # Creates directories at the paths in the given +list+
284
+ # (a single path or an array of paths);
285
+ # returns +list+ if it is an array, <tt>[list]</tt> otherwise.
286
+ #
287
+ # Argument +list+ or its elements
288
+ # should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
289
+ #
290
+ # With no keyword arguments, creates a directory at each +path+ in +list+
291
+ # by calling: <tt>Dir.mkdir(path, mode)</tt>;
292
+ # see {Dir.mkdir}[https://docs.ruby-lang.org/en/master/Dir.html#method-c-mkdir]:
293
+ #
294
+ # Bundler::FileUtils.mkdir(%w[tmp0 tmp1]) # => ["tmp0", "tmp1"]
295
+ # Bundler::FileUtils.mkdir('tmp4') # => ["tmp4"]
296
+ #
297
+ # Keyword arguments:
298
+ #
299
+ # - <tt>mode: <i>mode</i></tt> - also calls <tt>File.chmod(mode, path)</tt>;
300
+ # see {File.chmod}[https://docs.ruby-lang.org/en/master/File.html#method-c-chmod].
301
+ # - <tt>noop: true</tt> - does not create directories.
302
+ # - <tt>verbose: true</tt> - prints an equivalent command:
303
+ #
304
+ # Bundler::FileUtils.mkdir(%w[tmp0 tmp1], verbose: true)
305
+ # Bundler::FileUtils.mkdir(%w[tmp2 tmp3], mode: 0700, verbose: true)
306
+ #
307
+ # Output:
308
+ #
309
+ # mkdir tmp0 tmp1
310
+ # mkdir -m 700 tmp2 tmp3
311
+ #
312
+ # Raises an exception if any path points to an existing
313
+ # file or directory, or if for any reason a directory cannot be created.
314
+ #
315
+ # Related: Bundler::FileUtils.mkdir_p.
316
+ #
317
+ def mkdir(list, mode: nil, noop: nil, verbose: nil)
318
+ list = fu_list(list)
319
+ fu_output_message "mkdir #{mode ? ('-m %03o ' % mode) : ''}#{list.join ' '}" if verbose
320
+ return if noop
321
+
322
+ list.each do |dir|
323
+ fu_mkdir dir, mode
324
+ end
325
+ end
326
+ module_function :mkdir
327
+
328
+ #
329
+ # Creates directories at the paths in the given +list+
330
+ # (a single path or an array of paths),
331
+ # also creating ancestor directories as needed;
332
+ # returns +list+ if it is an array, <tt>[list]</tt> otherwise.
333
+ #
334
+ # Argument +list+ or its elements
335
+ # should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
336
+ #
337
+ # With no keyword arguments, creates a directory at each +path+ in +list+,
338
+ # along with any needed ancestor directories,
339
+ # by calling: <tt>Dir.mkdir(path, mode)</tt>;
340
+ # see {Dir.mkdir}[https://docs.ruby-lang.org/en/master/Dir.html#method-c-mkdir]:
341
+ #
342
+ # Bundler::FileUtils.mkdir_p(%w[tmp0/tmp1 tmp2/tmp3]) # => ["tmp0/tmp1", "tmp2/tmp3"]
343
+ # Bundler::FileUtils.mkdir_p('tmp4/tmp5') # => ["tmp4/tmp5"]
344
+ #
345
+ # Keyword arguments:
346
+ #
347
+ # - <tt>mode: <i>mode</i></tt> - also calls <tt>File.chmod(mode, path)</tt>;
348
+ # see {File.chmod}[https://docs.ruby-lang.org/en/master/File.html#method-c-chmod].
349
+ # - <tt>noop: true</tt> - does not create directories.
350
+ # - <tt>verbose: true</tt> - prints an equivalent command:
351
+ #
352
+ # Bundler::FileUtils.mkdir_p(%w[tmp0 tmp1], verbose: true)
353
+ # Bundler::FileUtils.mkdir_p(%w[tmp2 tmp3], mode: 0700, verbose: true)
354
+ #
355
+ # Output:
356
+ #
357
+ # mkdir -p tmp0 tmp1
358
+ # mkdir -p -m 700 tmp2 tmp3
359
+ #
360
+ # Raises an exception if for any reason a directory cannot be created.
361
+ #
362
+ # Bundler::FileUtils.mkpath and Bundler::FileUtils.makedirs are aliases for Bundler::FileUtils.mkdir_p.
363
+ #
364
+ # Related: Bundler::FileUtils.mkdir.
365
+ #
366
+ def mkdir_p(list, mode: nil, noop: nil, verbose: nil)
367
+ list = fu_list(list)
368
+ fu_output_message "mkdir -p #{mode ? ('-m %03o ' % mode) : ''}#{list.join ' '}" if verbose
369
+ return *list if noop
370
+
371
+ list.each do |item|
372
+ path = remove_trailing_slash(item)
373
+
374
+ stack = []
375
+ until File.directory?(path) || File.dirname(path) == path
376
+ stack.push path
377
+ path = File.dirname(path)
378
+ end
379
+ stack.reverse_each do |dir|
380
+ begin
381
+ fu_mkdir dir, mode
382
+ rescue SystemCallError
383
+ raise unless File.directory?(dir)
384
+ end
385
+ end
386
+ end
387
+
388
+ return *list
389
+ end
390
+ module_function :mkdir_p
391
+
392
+ alias mkpath mkdir_p
393
+ alias makedirs mkdir_p
394
+ module_function :mkpath
395
+ module_function :makedirs
396
+
397
+ def fu_mkdir(path, mode) #:nodoc:
398
+ path = remove_trailing_slash(path)
399
+ if mode
400
+ Dir.mkdir path, mode
401
+ File.chmod mode, path
402
+ else
403
+ Dir.mkdir path
404
+ end
405
+ end
406
+ private_module_function :fu_mkdir
407
+
408
+ #
409
+ # Removes directories at the paths in the given +list+
410
+ # (a single path or an array of paths);
411
+ # returns +list+, if it is an array, <tt>[list]</tt> otherwise.
412
+ #
413
+ # Argument +list+ or its elements
414
+ # should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
415
+ #
416
+ # With no keyword arguments, removes the directory at each +path+ in +list+,
417
+ # by calling: <tt>Dir.rmdir(path)</tt>;
418
+ # see {Dir.rmdir}[https://docs.ruby-lang.org/en/master/Dir.html#method-c-rmdir]:
419
+ #
420
+ # Bundler::FileUtils.rmdir(%w[tmp0/tmp1 tmp2/tmp3]) # => ["tmp0/tmp1", "tmp2/tmp3"]
421
+ # Bundler::FileUtils.rmdir('tmp4/tmp5') # => ["tmp4/tmp5"]
422
+ #
423
+ # Keyword arguments:
424
+ #
425
+ # - <tt>parents: true</tt> - removes successive ancestor directories
426
+ # if empty.
427
+ # - <tt>noop: true</tt> - does not remove directories.
428
+ # - <tt>verbose: true</tt> - prints an equivalent command:
429
+ #
430
+ # Bundler::FileUtils.rmdir(%w[tmp0/tmp1 tmp2/tmp3], parents: true, verbose: true)
431
+ # Bundler::FileUtils.rmdir('tmp4/tmp5', parents: true, verbose: true)
432
+ #
433
+ # Output:
434
+ #
435
+ # rmdir -p tmp0/tmp1 tmp2/tmp3
436
+ # rmdir -p tmp4/tmp5
437
+ #
438
+ # Raises an exception if a directory does not exist
439
+ # or if for any reason a directory cannot be removed.
440
+ #
441
+ # Related: {methods for deleting}[rdoc-ref:FileUtils@Deleting].
442
+ #
443
+ def rmdir(list, parents: nil, noop: nil, verbose: nil)
444
+ list = fu_list(list)
445
+ fu_output_message "rmdir #{parents ? '-p ' : ''}#{list.join ' '}" if verbose
446
+ return if noop
447
+ list.each do |dir|
448
+ Dir.rmdir(dir = remove_trailing_slash(dir))
449
+ if parents
450
+ begin
451
+ until (parent = File.dirname(dir)) == '.' or parent == dir
452
+ dir = parent
453
+ Dir.rmdir(dir)
454
+ end
455
+ rescue Errno::ENOTEMPTY, Errno::EEXIST, Errno::ENOENT
456
+ end
457
+ end
458
+ end
459
+ end
460
+ module_function :rmdir
461
+
462
+ # Creates {hard links}[https://en.wikipedia.org/wiki/Hard_link].
463
+ #
464
+ # Arguments +src+ (a single path or an array of paths)
465
+ # and +dest+ (a single path)
466
+ # should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
467
+ #
468
+ # When +src+ is the path to an existing file
469
+ # and +dest+ is the path to a non-existent file,
470
+ # creates a hard link at +dest+ pointing to +src+; returns zero:
471
+ #
472
+ # Dir.children('tmp0/') # => ["t.txt"]
473
+ # Dir.children('tmp1/') # => []
474
+ # Bundler::FileUtils.ln('tmp0/t.txt', 'tmp1/t.lnk') # => 0
475
+ # Dir.children('tmp1/') # => ["t.lnk"]
476
+ #
477
+ # When +src+ is the path to an existing file
478
+ # and +dest+ is the path to an existing directory,
479
+ # creates a hard link at <tt>dest/src</tt> pointing to +src+; returns zero:
480
+ #
481
+ # Dir.children('tmp2') # => ["t.dat"]
482
+ # Dir.children('tmp3') # => []
483
+ # Bundler::FileUtils.ln('tmp2/t.dat', 'tmp3') # => 0
484
+ # Dir.children('tmp3') # => ["t.dat"]
485
+ #
486
+ # When +src+ is an array of paths to existing files
487
+ # and +dest+ is the path to an existing directory,
488
+ # then for each path +target+ in +src+,
489
+ # creates a hard link at <tt>dest/target</tt> pointing to +target+;
490
+ # returns +src+:
491
+ #
492
+ # Dir.children('tmp4/') # => []
493
+ # Bundler::FileUtils.ln(['tmp0/t.txt', 'tmp2/t.dat'], 'tmp4/') # => ["tmp0/t.txt", "tmp2/t.dat"]
494
+ # Dir.children('tmp4/') # => ["t.dat", "t.txt"]
495
+ #
496
+ # Keyword arguments:
497
+ #
498
+ # - <tt>force: true</tt> - overwrites +dest+ if it exists.
499
+ # - <tt>noop: true</tt> - does not create links.
500
+ # - <tt>verbose: true</tt> - prints an equivalent command:
501
+ #
502
+ # Bundler::FileUtils.ln('tmp0/t.txt', 'tmp1/t.lnk', verbose: true)
503
+ # Bundler::FileUtils.ln('tmp2/t.dat', 'tmp3', verbose: true)
504
+ # Bundler::FileUtils.ln(['tmp0/t.txt', 'tmp2/t.dat'], 'tmp4/', verbose: true)
505
+ #
506
+ # Output:
507
+ #
508
+ # ln tmp0/t.txt tmp1/t.lnk
509
+ # ln tmp2/t.dat tmp3
510
+ # ln tmp0/t.txt tmp2/t.dat tmp4/
511
+ #
512
+ # Raises an exception if +dest+ is the path to an existing file
513
+ # and keyword argument +force+ is not +true+.
514
+ #
515
+ # Related: Bundler::FileUtils.link_entry (has different options).
516
+ #
517
+ def ln(src, dest, force: nil, noop: nil, verbose: nil)
518
+ fu_output_message "ln#{force ? ' -f' : ''} #{[src,dest].flatten.join ' '}" if verbose
519
+ return if noop
520
+ fu_each_src_dest0(src, dest) do |s,d|
521
+ remove_file d, true if force
522
+ File.link s, d
523
+ end
524
+ end
525
+ module_function :ln
526
+
527
+ alias link ln
528
+ module_function :link
529
+
530
+ # Creates {hard links}[https://en.wikipedia.org/wiki/Hard_link].
531
+ #
532
+ # Arguments +src+ (a single path or an array of paths)
533
+ # and +dest+ (a single path)
534
+ # should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
535
+ #
536
+ # If +src+ is the path to a directory and +dest+ does not exist,
537
+ # creates links +dest+ and descendents pointing to +src+ and its descendents:
538
+ #
539
+ # tree('src0')
540
+ # # => src0
541
+ # # |-- sub0
542
+ # # | |-- src0.txt
543
+ # # | `-- src1.txt
544
+ # # `-- sub1
545
+ # # |-- src2.txt
546
+ # # `-- src3.txt
547
+ # File.exist?('dest0') # => false
548
+ # Bundler::FileUtils.cp_lr('src0', 'dest0')
549
+ # tree('dest0')
550
+ # # => dest0
551
+ # # |-- sub0
552
+ # # | |-- src0.txt
553
+ # # | `-- src1.txt
554
+ # # `-- sub1
555
+ # # |-- src2.txt
556
+ # # `-- src3.txt
557
+ #
558
+ # If +src+ and +dest+ are both paths to directories,
559
+ # creates links <tt>dest/src</tt> and descendents
560
+ # pointing to +src+ and its descendents:
561
+ #
562
+ # tree('src1')
563
+ # # => src1
564
+ # # |-- sub0
565
+ # # | |-- src0.txt
566
+ # # | `-- src1.txt
567
+ # # `-- sub1
568
+ # # |-- src2.txt
569
+ # # `-- src3.txt
570
+ # Bundler::FileUtils.mkdir('dest1')
571
+ # Bundler::FileUtils.cp_lr('src1', 'dest1')
572
+ # tree('dest1')
573
+ # # => dest1
574
+ # # `-- src1
575
+ # # |-- sub0
576
+ # # | |-- src0.txt
577
+ # # | `-- src1.txt
578
+ # # `-- sub1
579
+ # # |-- src2.txt
580
+ # # `-- src3.txt
581
+ #
582
+ # If +src+ is an array of paths to entries and +dest+ is the path to a directory,
583
+ # for each path +filepath+ in +src+, creates a link at <tt>dest/filepath</tt>
584
+ # pointing to that path:
585
+ #
586
+ # tree('src2')
587
+ # # => src2
588
+ # # |-- sub0
589
+ # # | |-- src0.txt
590
+ # # | `-- src1.txt
591
+ # # `-- sub1
592
+ # # |-- src2.txt
593
+ # # `-- src3.txt
594
+ # Bundler::FileUtils.mkdir('dest2')
595
+ # Bundler::FileUtils.cp_lr(['src2/sub0', 'src2/sub1'], 'dest2')
596
+ # tree('dest2')
597
+ # # => dest2
598
+ # # |-- sub0
599
+ # # | |-- src0.txt
600
+ # # | `-- src1.txt
601
+ # # `-- sub1
602
+ # # |-- src2.txt
603
+ # # `-- src3.txt
604
+ #
605
+ # Keyword arguments:
606
+ #
607
+ # - <tt>dereference_root: false</tt> - if +src+ is a symbolic link,
608
+ # does not dereference it.
609
+ # - <tt>noop: true</tt> - does not create links.
610
+ # - <tt>remove_destination: true</tt> - removes +dest+ before creating links.
611
+ # - <tt>verbose: true</tt> - prints an equivalent command:
612
+ #
613
+ # Bundler::FileUtils.cp_lr('src0', 'dest0', noop: true, verbose: true)
614
+ # Bundler::FileUtils.cp_lr('src1', 'dest1', noop: true, verbose: true)
615
+ # Bundler::FileUtils.cp_lr(['src2/sub0', 'src2/sub1'], 'dest2', noop: true, verbose: true)
616
+ #
617
+ # Output:
618
+ #
619
+ # cp -lr src0 dest0
620
+ # cp -lr src1 dest1
621
+ # cp -lr src2/sub0 src2/sub1 dest2
622
+ #
623
+ # Raises an exception if +dest+ is the path to an existing file or directory
624
+ # and keyword argument <tt>remove_destination: true</tt> is not given.
625
+ #
626
+ # Related: {methods for copying}[rdoc-ref:FileUtils@Copying].
627
+ #
628
+ def cp_lr(src, dest, noop: nil, verbose: nil,
629
+ dereference_root: true, remove_destination: false)
630
+ fu_output_message "cp -lr#{remove_destination ? ' --remove-destination' : ''} #{[src,dest].flatten.join ' '}" if verbose
631
+ return if noop
632
+ fu_each_src_dest(src, dest) do |s, d|
633
+ link_entry s, d, dereference_root, remove_destination
634
+ end
635
+ end
636
+ module_function :cp_lr
637
+
638
+ # Creates {symbolic links}[https://en.wikipedia.org/wiki/Symbolic_link].
639
+ #
640
+ # Arguments +src+ (a single path or an array of paths)
641
+ # and +dest+ (a single path)
642
+ # should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
643
+ #
644
+ # If +src+ is the path to an existing file:
645
+ #
646
+ # - When +dest+ is the path to a non-existent file,
647
+ # creates a symbolic link at +dest+ pointing to +src+:
648
+ #
649
+ # Bundler::FileUtils.touch('src0.txt')
650
+ # File.exist?('dest0.txt') # => false
651
+ # Bundler::FileUtils.ln_s('src0.txt', 'dest0.txt')
652
+ # File.symlink?('dest0.txt') # => true
653
+ #
654
+ # - When +dest+ is the path to an existing file,
655
+ # creates a symbolic link at +dest+ pointing to +src+
656
+ # if and only if keyword argument <tt>force: true</tt> is given
657
+ # (raises an exception otherwise):
658
+ #
659
+ # Bundler::FileUtils.touch('src1.txt')
660
+ # Bundler::FileUtils.touch('dest1.txt')
661
+ # Bundler::FileUtils.ln_s('src1.txt', 'dest1.txt', force: true)
662
+ # FileTest.symlink?('dest1.txt') # => true
663
+ #
664
+ # Bundler::FileUtils.ln_s('src1.txt', 'dest1.txt') # Raises Errno::EEXIST.
665
+ #
666
+ # If +dest+ is the path to a directory,
667
+ # creates a symbolic link at <tt>dest/src</tt> pointing to +src+:
668
+ #
669
+ # Bundler::FileUtils.touch('src2.txt')
670
+ # Bundler::FileUtils.mkdir('destdir2')
671
+ # Bundler::FileUtils.ln_s('src2.txt', 'destdir2')
672
+ # File.symlink?('destdir2/src2.txt') # => true
673
+ #
674
+ # If +src+ is an array of paths to existing files and +dest+ is a directory,
675
+ # for each child +child+ in +src+ creates a symbolic link <tt>dest/child</tt>
676
+ # pointing to +child+:
677
+ #
678
+ # Bundler::FileUtils.mkdir('srcdir3')
679
+ # Bundler::FileUtils.touch('srcdir3/src0.txt')
680
+ # Bundler::FileUtils.touch('srcdir3/src1.txt')
681
+ # Bundler::FileUtils.mkdir('destdir3')
682
+ # Bundler::FileUtils.ln_s(['srcdir3/src0.txt', 'srcdir3/src1.txt'], 'destdir3')
683
+ # File.symlink?('destdir3/src0.txt') # => true
684
+ # File.symlink?('destdir3/src1.txt') # => true
685
+ #
686
+ # Keyword arguments:
687
+ #
688
+ # - <tt>force: true</tt> - overwrites +dest+ if it exists.
689
+ # - <tt>relative: false</tt> - create links relative to +dest+.
690
+ # - <tt>noop: true</tt> - does not create links.
691
+ # - <tt>verbose: true</tt> - prints an equivalent command:
692
+ #
693
+ # Bundler::FileUtils.ln_s('src0.txt', 'dest0.txt', noop: true, verbose: true)
694
+ # Bundler::FileUtils.ln_s('src1.txt', 'destdir1', noop: true, verbose: true)
695
+ # Bundler::FileUtils.ln_s('src2.txt', 'dest2.txt', force: true, noop: true, verbose: true)
696
+ # Bundler::FileUtils.ln_s(['srcdir3/src0.txt', 'srcdir3/src1.txt'], 'destdir3', noop: true, verbose: true)
697
+ #
698
+ # Output:
699
+ #
700
+ # ln -s src0.txt dest0.txt
701
+ # ln -s src1.txt destdir1
702
+ # ln -sf src2.txt dest2.txt
703
+ # ln -s srcdir3/src0.txt srcdir3/src1.txt destdir3
704
+ #
705
+ # Related: Bundler::FileUtils.ln_sf.
706
+ #
707
+ def ln_s(src, dest, force: nil, relative: false, target_directory: true, noop: nil, verbose: nil)
708
+ if relative
709
+ return ln_sr(src, dest, force: force, noop: noop, verbose: verbose)
710
+ end
711
+ fu_output_message "ln -s#{force ? 'f' : ''} #{[src,dest].flatten.join ' '}" if verbose
712
+ return if noop
713
+ fu_each_src_dest0(src, dest) do |s,d|
714
+ remove_file d, true if force
715
+ File.symlink s, d
716
+ end
717
+ end
718
+ module_function :ln_s
719
+
720
+ alias symlink ln_s
721
+ module_function :symlink
722
+
723
+ # Like Bundler::FileUtils.ln_s, but always with keyword argument <tt>force: true</tt> given.
724
+ #
725
+ def ln_sf(src, dest, noop: nil, verbose: nil)
726
+ ln_s src, dest, force: true, noop: noop, verbose: verbose
727
+ end
728
+ module_function :ln_sf
729
+
730
+ # Like Bundler::FileUtils.ln_s, but create links relative to +dest+.
731
+ #
732
+ def ln_sr(src, dest, target_directory: true, force: nil, noop: nil, verbose: nil)
733
+ options = "#{force ? 'f' : ''}#{target_directory ? '' : 'T'}"
734
+ dest = File.path(dest)
735
+ srcs = Array(src)
736
+ link = proc do |s, target_dir_p = true|
737
+ s = File.path(s)
738
+ if target_dir_p
739
+ d = File.join(destdirs = dest, File.basename(s))
740
+ else
741
+ destdirs = File.dirname(d = dest)
742
+ end
743
+ destdirs = fu_split_path(File.realpath(destdirs))
744
+ if fu_starting_path?(s)
745
+ srcdirs = fu_split_path((File.realdirpath(s) rescue File.expand_path(s)))
746
+ base = fu_relative_components_from(srcdirs, destdirs)
747
+ s = File.join(*base)
748
+ else
749
+ srcdirs = fu_clean_components(*fu_split_path(s))
750
+ base = fu_relative_components_from(fu_split_path(Dir.pwd), destdirs)
751
+ while srcdirs.first&. == ".." and base.last&.!=("..") and !fu_starting_path?(base.last)
752
+ srcdirs.shift
753
+ base.pop
754
+ end
755
+ s = File.join(*base, *srcdirs)
756
+ end
757
+ fu_output_message "ln -s#{options} #{s} #{d}" if verbose
758
+ next if noop
759
+ remove_file d, true if force
760
+ File.symlink s, d
761
+ end
762
+ case srcs.size
763
+ when 0
764
+ when 1
765
+ link[srcs[0], target_directory && File.directory?(dest)]
766
+ else
767
+ srcs.each(&link)
768
+ end
769
+ end
770
+ module_function :ln_sr
771
+
772
+ # Creates {hard links}[https://en.wikipedia.org/wiki/Hard_link]; returns +nil+.
773
+ #
774
+ # Arguments +src+ and +dest+
775
+ # should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
776
+ #
777
+ # If +src+ is the path to a file and +dest+ does not exist,
778
+ # creates a hard link at +dest+ pointing to +src+:
779
+ #
780
+ # Bundler::FileUtils.touch('src0.txt')
781
+ # File.exist?('dest0.txt') # => false
782
+ # Bundler::FileUtils.link_entry('src0.txt', 'dest0.txt')
783
+ # File.file?('dest0.txt') # => true
784
+ #
785
+ # If +src+ is the path to a directory and +dest+ does not exist,
786
+ # recursively creates hard links at +dest+ pointing to paths in +src+:
787
+ #
788
+ # Bundler::FileUtils.mkdir_p(['src1/dir0', 'src1/dir1'])
789
+ # src_file_paths = [
790
+ # 'src1/dir0/t0.txt',
791
+ # 'src1/dir0/t1.txt',
792
+ # 'src1/dir1/t2.txt',
793
+ # 'src1/dir1/t3.txt',
794
+ # ]
795
+ # Bundler::FileUtils.touch(src_file_paths)
796
+ # File.directory?('dest1') # => true
797
+ # Bundler::FileUtils.link_entry('src1', 'dest1')
798
+ # File.file?('dest1/dir0/t0.txt') # => true
799
+ # File.file?('dest1/dir0/t1.txt') # => true
800
+ # File.file?('dest1/dir1/t2.txt') # => true
801
+ # File.file?('dest1/dir1/t3.txt') # => true
802
+ #
803
+ # Keyword arguments:
804
+ #
805
+ # - <tt>dereference_root: true</tt> - dereferences +src+ if it is a symbolic link.
806
+ # - <tt>remove_destination: true</tt> - removes +dest+ before creating links.
807
+ #
808
+ # Raises an exception if +dest+ is the path to an existing file or directory
809
+ # and keyword argument <tt>remove_destination: true</tt> is not given.
810
+ #
811
+ # Related: Bundler::FileUtils.ln (has different options).
812
+ #
813
+ def link_entry(src, dest, dereference_root = false, remove_destination = false)
814
+ Entry_.new(src, nil, dereference_root).traverse do |ent|
815
+ destent = Entry_.new(dest, ent.rel, false)
816
+ File.unlink destent.path if remove_destination && File.file?(destent.path)
817
+ ent.link destent.path
818
+ end
819
+ end
820
+ module_function :link_entry
821
+
822
+ # Copies files.
823
+ #
824
+ # Arguments +src+ (a single path or an array of paths)
825
+ # and +dest+ (a single path)
826
+ # should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
827
+ #
828
+ # If +src+ is the path to a file and +dest+ is not the path to a directory,
829
+ # copies +src+ to +dest+:
830
+ #
831
+ # Bundler::FileUtils.touch('src0.txt')
832
+ # File.exist?('dest0.txt') # => false
833
+ # Bundler::FileUtils.cp('src0.txt', 'dest0.txt')
834
+ # File.file?('dest0.txt') # => true
835
+ #
836
+ # If +src+ is the path to a file and +dest+ is the path to a directory,
837
+ # copies +src+ to <tt>dest/src</tt>:
838
+ #
839
+ # Bundler::FileUtils.touch('src1.txt')
840
+ # Bundler::FileUtils.mkdir('dest1')
841
+ # Bundler::FileUtils.cp('src1.txt', 'dest1')
842
+ # File.file?('dest1/src1.txt') # => true
843
+ #
844
+ # If +src+ is an array of paths to files and +dest+ is the path to a directory,
845
+ # copies from each +src+ to +dest+:
846
+ #
847
+ # src_file_paths = ['src2.txt', 'src2.dat']
848
+ # Bundler::FileUtils.touch(src_file_paths)
849
+ # Bundler::FileUtils.mkdir('dest2')
850
+ # Bundler::FileUtils.cp(src_file_paths, 'dest2')
851
+ # File.file?('dest2/src2.txt') # => true
852
+ # File.file?('dest2/src2.dat') # => true
853
+ #
854
+ # Keyword arguments:
855
+ #
856
+ # - <tt>preserve: true</tt> - preserves file times.
857
+ # - <tt>noop: true</tt> - does not copy files.
858
+ # - <tt>verbose: true</tt> - prints an equivalent command:
859
+ #
860
+ # Bundler::FileUtils.cp('src0.txt', 'dest0.txt', noop: true, verbose: true)
861
+ # Bundler::FileUtils.cp('src1.txt', 'dest1', noop: true, verbose: true)
862
+ # Bundler::FileUtils.cp(src_file_paths, 'dest2', noop: true, verbose: true)
863
+ #
864
+ # Output:
865
+ #
866
+ # cp src0.txt dest0.txt
867
+ # cp src1.txt dest1
868
+ # cp src2.txt src2.dat dest2
869
+ #
870
+ # Raises an exception if +src+ is a directory.
871
+ #
872
+ # Related: {methods for copying}[rdoc-ref:FileUtils@Copying].
873
+ #
874
+ def cp(src, dest, preserve: nil, noop: nil, verbose: nil)
875
+ fu_output_message "cp#{preserve ? ' -p' : ''} #{[src,dest].flatten.join ' '}" if verbose
876
+ return if noop
877
+ fu_each_src_dest(src, dest) do |s, d|
878
+ copy_file s, d, preserve
879
+ end
880
+ end
881
+ module_function :cp
882
+
883
+ alias copy cp
884
+ module_function :copy
885
+
886
+ # Recursively copies files.
887
+ #
888
+ # Arguments +src+ (a single path or an array of paths)
889
+ # and +dest+ (a single path)
890
+ # should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
891
+ #
892
+ # The mode, owner, and group are retained in the copy;
893
+ # to change those, use Bundler::FileUtils.install instead.
894
+ #
895
+ # If +src+ is the path to a file and +dest+ is not the path to a directory,
896
+ # copies +src+ to +dest+:
897
+ #
898
+ # Bundler::FileUtils.touch('src0.txt')
899
+ # File.exist?('dest0.txt') # => false
900
+ # Bundler::FileUtils.cp_r('src0.txt', 'dest0.txt')
901
+ # File.file?('dest0.txt') # => true
902
+ #
903
+ # If +src+ is the path to a file and +dest+ is the path to a directory,
904
+ # copies +src+ to <tt>dest/src</tt>:
905
+ #
906
+ # Bundler::FileUtils.touch('src1.txt')
907
+ # Bundler::FileUtils.mkdir('dest1')
908
+ # Bundler::FileUtils.cp_r('src1.txt', 'dest1')
909
+ # File.file?('dest1/src1.txt') # => true
910
+ #
911
+ # If +src+ is the path to a directory and +dest+ does not exist,
912
+ # recursively copies +src+ to +dest+:
913
+ #
914
+ # tree('src2')
915
+ # # => src2
916
+ # # |-- dir0
917
+ # # | |-- src0.txt
918
+ # # | `-- src1.txt
919
+ # # `-- dir1
920
+ # # |-- src2.txt
921
+ # # `-- src3.txt
922
+ # Bundler::FileUtils.exist?('dest2') # => false
923
+ # Bundler::FileUtils.cp_r('src2', 'dest2')
924
+ # tree('dest2')
925
+ # # => dest2
926
+ # # |-- dir0
927
+ # # | |-- src0.txt
928
+ # # | `-- src1.txt
929
+ # # `-- dir1
930
+ # # |-- src2.txt
931
+ # # `-- src3.txt
932
+ #
933
+ # If +src+ and +dest+ are paths to directories,
934
+ # recursively copies +src+ to <tt>dest/src</tt>:
935
+ #
936
+ # tree('src3')
937
+ # # => src3
938
+ # # |-- dir0
939
+ # # | |-- src0.txt
940
+ # # | `-- src1.txt
941
+ # # `-- dir1
942
+ # # |-- src2.txt
943
+ # # `-- src3.txt
944
+ # Bundler::FileUtils.mkdir('dest3')
945
+ # Bundler::FileUtils.cp_r('src3', 'dest3')
946
+ # tree('dest3')
947
+ # # => dest3
948
+ # # `-- src3
949
+ # # |-- dir0
950
+ # # | |-- src0.txt
951
+ # # | `-- src1.txt
952
+ # # `-- dir1
953
+ # # |-- src2.txt
954
+ # # `-- src3.txt
955
+ #
956
+ # If +src+ is an array of paths and +dest+ is a directory,
957
+ # recursively copies from each path in +src+ to +dest+;
958
+ # the paths in +src+ may point to files and/or directories.
959
+ #
960
+ # Keyword arguments:
961
+ #
962
+ # - <tt>dereference_root: false</tt> - if +src+ is a symbolic link,
963
+ # does not dereference it.
964
+ # - <tt>noop: true</tt> - does not copy files.
965
+ # - <tt>preserve: true</tt> - preserves file times.
966
+ # - <tt>remove_destination: true</tt> - removes +dest+ before copying files.
967
+ # - <tt>verbose: true</tt> - prints an equivalent command:
968
+ #
969
+ # Bundler::FileUtils.cp_r('src0.txt', 'dest0.txt', noop: true, verbose: true)
970
+ # Bundler::FileUtils.cp_r('src1.txt', 'dest1', noop: true, verbose: true)
971
+ # Bundler::FileUtils.cp_r('src2', 'dest2', noop: true, verbose: true)
972
+ # Bundler::FileUtils.cp_r('src3', 'dest3', noop: true, verbose: true)
973
+ #
974
+ # Output:
975
+ #
976
+ # cp -r src0.txt dest0.txt
977
+ # cp -r src1.txt dest1
978
+ # cp -r src2 dest2
979
+ # cp -r src3 dest3
980
+ #
981
+ # Raises an exception of +src+ is the path to a directory
982
+ # and +dest+ is the path to a file.
983
+ #
984
+ # Related: {methods for copying}[rdoc-ref:FileUtils@Copying].
985
+ #
986
+ def cp_r(src, dest, preserve: nil, noop: nil, verbose: nil,
987
+ dereference_root: true, remove_destination: nil)
988
+ fu_output_message "cp -r#{preserve ? 'p' : ''}#{remove_destination ? ' --remove-destination' : ''} #{[src,dest].flatten.join ' '}" if verbose
989
+ return if noop
990
+ fu_each_src_dest(src, dest) do |s, d|
991
+ copy_entry s, d, preserve, dereference_root, remove_destination
992
+ end
993
+ end
994
+ module_function :cp_r
995
+
996
+ # Recursively copies files from +src+ to +dest+.
997
+ #
998
+ # Arguments +src+ and +dest+
999
+ # should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
1000
+ #
1001
+ # If +src+ is the path to a file, copies +src+ to +dest+:
1002
+ #
1003
+ # Bundler::FileUtils.touch('src0.txt')
1004
+ # File.exist?('dest0.txt') # => false
1005
+ # Bundler::FileUtils.copy_entry('src0.txt', 'dest0.txt')
1006
+ # File.file?('dest0.txt') # => true
1007
+ #
1008
+ # If +src+ is a directory, recursively copies +src+ to +dest+:
1009
+ #
1010
+ # tree('src1')
1011
+ # # => src1
1012
+ # # |-- dir0
1013
+ # # | |-- src0.txt
1014
+ # # | `-- src1.txt
1015
+ # # `-- dir1
1016
+ # # |-- src2.txt
1017
+ # # `-- src3.txt
1018
+ # Bundler::FileUtils.copy_entry('src1', 'dest1')
1019
+ # tree('dest1')
1020
+ # # => dest1
1021
+ # # |-- dir0
1022
+ # # | |-- src0.txt
1023
+ # # | `-- src1.txt
1024
+ # # `-- dir1
1025
+ # # |-- src2.txt
1026
+ # # `-- src3.txt
1027
+ #
1028
+ # The recursive copying preserves file types for regular files,
1029
+ # directories, and symbolic links;
1030
+ # other file types (FIFO streams, device files, etc.) are not supported.
1031
+ #
1032
+ # Keyword arguments:
1033
+ #
1034
+ # - <tt>dereference_root: true</tt> - if +src+ is a symbolic link,
1035
+ # follows the link.
1036
+ # - <tt>preserve: true</tt> - preserves file times.
1037
+ # - <tt>remove_destination: true</tt> - removes +dest+ before copying files.
1038
+ #
1039
+ # Related: {methods for copying}[rdoc-ref:FileUtils@Copying].
1040
+ #
1041
+ def copy_entry(src, dest, preserve = false, dereference_root = false, remove_destination = false)
1042
+ if dereference_root
1043
+ src = File.realpath(src)
1044
+ end
1045
+
1046
+ Entry_.new(src, nil, false).wrap_traverse(proc do |ent|
1047
+ destent = Entry_.new(dest, ent.rel, false)
1048
+ File.unlink destent.path if remove_destination && (File.file?(destent.path) || File.symlink?(destent.path))
1049
+ ent.copy destent.path
1050
+ end, proc do |ent|
1051
+ destent = Entry_.new(dest, ent.rel, false)
1052
+ ent.copy_metadata destent.path if preserve
1053
+ end)
1054
+ end
1055
+ module_function :copy_entry
1056
+
1057
+ # Copies file from +src+ to +dest+, which should not be directories.
1058
+ #
1059
+ # Arguments +src+ and +dest+
1060
+ # should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
1061
+ #
1062
+ # Examples:
1063
+ #
1064
+ # Bundler::FileUtils.touch('src0.txt')
1065
+ # Bundler::FileUtils.copy_file('src0.txt', 'dest0.txt')
1066
+ # File.file?('dest0.txt') # => true
1067
+ #
1068
+ # Keyword arguments:
1069
+ #
1070
+ # - <tt>dereference: false</tt> - if +src+ is a symbolic link,
1071
+ # does not follow the link.
1072
+ # - <tt>preserve: true</tt> - preserves file times.
1073
+ # - <tt>remove_destination: true</tt> - removes +dest+ before copying files.
1074
+ #
1075
+ # Related: {methods for copying}[rdoc-ref:FileUtils@Copying].
1076
+ #
1077
+ def copy_file(src, dest, preserve = false, dereference = true)
1078
+ ent = Entry_.new(src, nil, dereference)
1079
+ ent.copy_file dest
1080
+ ent.copy_metadata dest if preserve
1081
+ end
1082
+ module_function :copy_file
1083
+
1084
+ # Copies \IO stream +src+ to \IO stream +dest+ via
1085
+ # {IO.copy_stream}[https://docs.ruby-lang.org/en/master/IO.html#method-c-copy_stream].
1086
+ #
1087
+ # Related: {methods for copying}[rdoc-ref:FileUtils@Copying].
1088
+ #
1089
+ def copy_stream(src, dest)
1090
+ IO.copy_stream(src, dest)
1091
+ end
1092
+ module_function :copy_stream
1093
+
1094
+ # Moves entries.
1095
+ #
1096
+ # Arguments +src+ (a single path or an array of paths)
1097
+ # and +dest+ (a single path)
1098
+ # should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
1099
+ #
1100
+ # If +src+ and +dest+ are on different file systems,
1101
+ # first copies, then removes +src+.
1102
+ #
1103
+ # May cause a local vulnerability if not called with keyword argument
1104
+ # <tt>secure: true</tt>;
1105
+ # see {Avoiding the TOCTTOU Vulnerability}[rdoc-ref:FileUtils@Avoiding+the+TOCTTOU+Vulnerability].
1106
+ #
1107
+ # If +src+ is the path to a single file or directory and +dest+ does not exist,
1108
+ # moves +src+ to +dest+:
1109
+ #
1110
+ # tree('src0')
1111
+ # # => src0
1112
+ # # |-- src0.txt
1113
+ # # `-- src1.txt
1114
+ # File.exist?('dest0') # => false
1115
+ # Bundler::FileUtils.mv('src0', 'dest0')
1116
+ # File.exist?('src0') # => false
1117
+ # tree('dest0')
1118
+ # # => dest0
1119
+ # # |-- src0.txt
1120
+ # # `-- src1.txt
1121
+ #
1122
+ # If +src+ is an array of paths to files and directories
1123
+ # and +dest+ is the path to a directory,
1124
+ # copies from each path in the array to +dest+:
1125
+ #
1126
+ # File.file?('src1.txt') # => true
1127
+ # tree('src1')
1128
+ # # => src1
1129
+ # # |-- src.dat
1130
+ # # `-- src.txt
1131
+ # Dir.empty?('dest1') # => true
1132
+ # Bundler::FileUtils.mv(['src1.txt', 'src1'], 'dest1')
1133
+ # tree('dest1')
1134
+ # # => dest1
1135
+ # # |-- src1
1136
+ # # | |-- src.dat
1137
+ # # | `-- src.txt
1138
+ # # `-- src1.txt
1139
+ #
1140
+ # Keyword arguments:
1141
+ #
1142
+ # - <tt>force: true</tt> - if the move includes removing +src+
1143
+ # (that is, if +src+ and +dest+ are on different file systems),
1144
+ # ignores raised exceptions of StandardError and its descendants.
1145
+ # - <tt>noop: true</tt> - does not move files.
1146
+ # - <tt>secure: true</tt> - removes +src+ securely;
1147
+ # see details at Bundler::FileUtils.remove_entry_secure.
1148
+ # - <tt>verbose: true</tt> - prints an equivalent command:
1149
+ #
1150
+ # Bundler::FileUtils.mv('src0', 'dest0', noop: true, verbose: true)
1151
+ # Bundler::FileUtils.mv(['src1.txt', 'src1'], 'dest1', noop: true, verbose: true)
1152
+ #
1153
+ # Output:
1154
+ #
1155
+ # mv src0 dest0
1156
+ # mv src1.txt src1 dest1
1157
+ #
1158
+ def mv(src, dest, force: nil, noop: nil, verbose: nil, secure: nil)
1159
+ fu_output_message "mv#{force ? ' -f' : ''} #{[src,dest].flatten.join ' '}" if verbose
1160
+ return if noop
1161
+ fu_each_src_dest(src, dest) do |s, d|
1162
+ destent = Entry_.new(d, nil, true)
1163
+ begin
1164
+ if destent.exist?
1165
+ if destent.directory?
1166
+ raise Errno::EEXIST, d
1167
+ end
1168
+ end
1169
+ begin
1170
+ File.rename s, d
1171
+ rescue Errno::EXDEV,
1172
+ Errno::EPERM # move from unencrypted to encrypted dir (ext4)
1173
+ copy_entry s, d, true
1174
+ if secure
1175
+ remove_entry_secure s, force
1176
+ else
1177
+ remove_entry s, force
1178
+ end
1179
+ end
1180
+ rescue SystemCallError
1181
+ raise unless force
1182
+ end
1183
+ end
1184
+ end
1185
+ module_function :mv
1186
+
1187
+ alias move mv
1188
+ module_function :move
1189
+
1190
+ # Removes entries at the paths in the given +list+
1191
+ # (a single path or an array of paths)
1192
+ # returns +list+, if it is an array, <tt>[list]</tt> otherwise.
1193
+ #
1194
+ # Argument +list+ or its elements
1195
+ # should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
1196
+ #
1197
+ # With no keyword arguments, removes files at the paths given in +list+:
1198
+ #
1199
+ # Bundler::FileUtils.touch(['src0.txt', 'src0.dat'])
1200
+ # Bundler::FileUtils.rm(['src0.dat', 'src0.txt']) # => ["src0.dat", "src0.txt"]
1201
+ #
1202
+ # Keyword arguments:
1203
+ #
1204
+ # - <tt>force: true</tt> - ignores raised exceptions of StandardError
1205
+ # and its descendants.
1206
+ # - <tt>noop: true</tt> - does not remove files; returns +nil+.
1207
+ # - <tt>verbose: true</tt> - prints an equivalent command:
1208
+ #
1209
+ # Bundler::FileUtils.rm(['src0.dat', 'src0.txt'], noop: true, verbose: true)
1210
+ #
1211
+ # Output:
1212
+ #
1213
+ # rm src0.dat src0.txt
1214
+ #
1215
+ # Related: {methods for deleting}[rdoc-ref:FileUtils@Deleting].
1216
+ #
1217
+ def rm(list, force: nil, noop: nil, verbose: nil)
1218
+ list = fu_list(list)
1219
+ fu_output_message "rm#{force ? ' -f' : ''} #{list.join ' '}" if verbose
1220
+ return if noop
1221
+
1222
+ list.each do |path|
1223
+ remove_file path, force
1224
+ end
1225
+ end
1226
+ module_function :rm
1227
+
1228
+ alias remove rm
1229
+ module_function :remove
1230
+
1231
+ # Equivalent to:
1232
+ #
1233
+ # Bundler::FileUtils.rm(list, force: true, **kwargs)
1234
+ #
1235
+ # Argument +list+ (a single path or an array of paths)
1236
+ # should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
1237
+ #
1238
+ # See Bundler::FileUtils.rm for keyword arguments.
1239
+ #
1240
+ # Related: {methods for deleting}[rdoc-ref:FileUtils@Deleting].
1241
+ #
1242
+ def rm_f(list, noop: nil, verbose: nil)
1243
+ rm list, force: true, noop: noop, verbose: verbose
1244
+ end
1245
+ module_function :rm_f
1246
+
1247
+ alias safe_unlink rm_f
1248
+ module_function :safe_unlink
1249
+
1250
+ # Removes entries at the paths in the given +list+
1251
+ # (a single path or an array of paths);
1252
+ # returns +list+, if it is an array, <tt>[list]</tt> otherwise.
1253
+ #
1254
+ # Argument +list+ or its elements
1255
+ # should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
1256
+ #
1257
+ # May cause a local vulnerability if not called with keyword argument
1258
+ # <tt>secure: true</tt>;
1259
+ # see {Avoiding the TOCTTOU Vulnerability}[rdoc-ref:FileUtils@Avoiding+the+TOCTTOU+Vulnerability].
1260
+ #
1261
+ # For each file path, removes the file at that path:
1262
+ #
1263
+ # Bundler::FileUtils.touch(['src0.txt', 'src0.dat'])
1264
+ # Bundler::FileUtils.rm_r(['src0.dat', 'src0.txt'])
1265
+ # File.exist?('src0.txt') # => false
1266
+ # File.exist?('src0.dat') # => false
1267
+ #
1268
+ # For each directory path, recursively removes files and directories:
1269
+ #
1270
+ # tree('src1')
1271
+ # # => src1
1272
+ # # |-- dir0
1273
+ # # | |-- src0.txt
1274
+ # # | `-- src1.txt
1275
+ # # `-- dir1
1276
+ # # |-- src2.txt
1277
+ # # `-- src3.txt
1278
+ # Bundler::FileUtils.rm_r('src1')
1279
+ # File.exist?('src1') # => false
1280
+ #
1281
+ # Keyword arguments:
1282
+ #
1283
+ # - <tt>force: true</tt> - ignores raised exceptions of StandardError
1284
+ # and its descendants.
1285
+ # - <tt>noop: true</tt> - does not remove entries; returns +nil+.
1286
+ # - <tt>secure: true</tt> - removes +src+ securely;
1287
+ # see details at Bundler::FileUtils.remove_entry_secure.
1288
+ # - <tt>verbose: true</tt> - prints an equivalent command:
1289
+ #
1290
+ # Bundler::FileUtils.rm_r(['src0.dat', 'src0.txt'], noop: true, verbose: true)
1291
+ # Bundler::FileUtils.rm_r('src1', noop: true, verbose: true)
1292
+ #
1293
+ # Output:
1294
+ #
1295
+ # rm -r src0.dat src0.txt
1296
+ # rm -r src1
1297
+ #
1298
+ # Related: {methods for deleting}[rdoc-ref:FileUtils@Deleting].
1299
+ #
1300
+ def rm_r(list, force: nil, noop: nil, verbose: nil, secure: nil)
1301
+ list = fu_list(list)
1302
+ fu_output_message "rm -r#{force ? 'f' : ''} #{list.join ' '}" if verbose
1303
+ return if noop
1304
+ list.each do |path|
1305
+ if secure
1306
+ remove_entry_secure path, force
1307
+ else
1308
+ remove_entry path, force
1309
+ end
1310
+ end
1311
+ end
1312
+ module_function :rm_r
1313
+
1314
+ # Equivalent to:
1315
+ #
1316
+ # Bundler::FileUtils.rm_r(list, force: true, **kwargs)
1317
+ #
1318
+ # Argument +list+ or its elements
1319
+ # should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
1320
+ #
1321
+ # May cause a local vulnerability if not called with keyword argument
1322
+ # <tt>secure: true</tt>;
1323
+ # see {Avoiding the TOCTTOU Vulnerability}[rdoc-ref:FileUtils@Avoiding+the+TOCTTOU+Vulnerability].
1324
+ #
1325
+ # See Bundler::FileUtils.rm_r for keyword arguments.
1326
+ #
1327
+ # Related: {methods for deleting}[rdoc-ref:FileUtils@Deleting].
1328
+ #
1329
+ def rm_rf(list, noop: nil, verbose: nil, secure: nil)
1330
+ rm_r list, force: true, noop: noop, verbose: verbose, secure: secure
1331
+ end
1332
+ module_function :rm_rf
1333
+
1334
+ alias rmtree rm_rf
1335
+ module_function :rmtree
1336
+
1337
+ # Securely removes the entry given by +path+,
1338
+ # which should be the entry for a regular file, a symbolic link,
1339
+ # or a directory.
1340
+ #
1341
+ # Argument +path+
1342
+ # should be {interpretable as a path}[rdoc-ref:FileUtils@Path+Arguments].
1343
+ #
1344
+ # Avoids a local vulnerability that can exist in certain circumstances;
1345
+ # see {Avoiding the TOCTTOU Vulnerability}[rdoc-ref:FileUtils@Avoiding+the+TOCTTOU+Vulnerability].
1346
+ #
1347
+ # Optional argument +force+ specifies whether to ignore
1348
+ # raised exceptions of StandardError and its descendants.
1349
+ #
1350
+ # Related: {methods for deleting}[rdoc-ref:FileUtils@Deleting].
1351
+ #
1352
+ def remove_entry_secure(path, force = false)
1353
+ unless fu_have_symlink?
1354
+ remove_entry path, force
1355
+ return
1356
+ end
1357
+ fullpath = File.expand_path(path)
1358
+ st = File.lstat(fullpath)
1359
+ unless st.directory?
1360
+ File.unlink fullpath
1361
+ return
1362
+ end
1363
+ # is a directory.
1364
+ parent_st = File.stat(File.dirname(fullpath))
1365
+ unless parent_st.world_writable?
1366
+ remove_entry path, force
1367
+ return
1368
+ end
1369
+ unless parent_st.sticky?
1370
+ raise ArgumentError, "parent directory is world writable, Bundler::FileUtils#remove_entry_secure does not work; abort: #{path.inspect} (parent directory mode #{'%o' % parent_st.mode})"
1371
+ end
1372
+
1373
+ # freeze tree root
1374
+ euid = Process.euid
1375
+ dot_file = fullpath + "/."
1376
+ begin
1377
+ File.open(dot_file) {|f|
1378
+ unless fu_stat_identical_entry?(st, f.stat)
1379
+ # symlink (TOC-to-TOU attack?)
1380
+ File.unlink fullpath
1381
+ return
1382
+ end
1383
+ f.chown euid, -1
1384
+ f.chmod 0700
1385
+ }
1386
+ rescue Errno::EISDIR # JRuby in non-native mode can't open files as dirs
1387
+ File.lstat(dot_file).tap {|fstat|
1388
+ unless fu_stat_identical_entry?(st, fstat)
1389
+ # symlink (TOC-to-TOU attack?)
1390
+ File.unlink fullpath
1391
+ return
1392
+ end
1393
+ File.chown euid, -1, dot_file
1394
+ File.chmod 0700, dot_file
1395
+ }
1396
+ end
1397
+
1398
+ unless fu_stat_identical_entry?(st, File.lstat(fullpath))
1399
+ # TOC-to-TOU attack?
1400
+ File.unlink fullpath
1401
+ return
1402
+ end
1403
+
1404
+ # ---- tree root is frozen ----
1405
+ root = Entry_.new(path)
1406
+ root.preorder_traverse do |ent|
1407
+ if ent.directory?
1408
+ ent.chown euid, -1
1409
+ ent.chmod 0700
1410
+ end
1411
+ end
1412
+ root.postorder_traverse do |ent|
1413
+ begin
1414
+ ent.remove
1415
+ rescue
1416
+ raise unless force
1417
+ end
1418
+ end
1419
+ rescue
1420
+ raise unless force
1421
+ end
1422
+ module_function :remove_entry_secure
1423
+
1424
+ def fu_have_symlink? #:nodoc:
1425
+ File.symlink nil, nil
1426
+ rescue NotImplementedError
1427
+ return false
1428
+ rescue TypeError
1429
+ return true
1430
+ end
1431
+ private_module_function :fu_have_symlink?
1432
+
1433
+ def fu_stat_identical_entry?(a, b) #:nodoc:
1434
+ a.dev == b.dev and a.ino == b.ino
1435
+ end
1436
+ private_module_function :fu_stat_identical_entry?
1437
+
1438
+ # Removes the entry given by +path+,
1439
+ # which should be the entry for a regular file, a symbolic link,
1440
+ # or a directory.
1441
+ #
1442
+ # Argument +path+
1443
+ # should be {interpretable as a path}[rdoc-ref:FileUtils@Path+Arguments].
1444
+ #
1445
+ # Optional argument +force+ specifies whether to ignore
1446
+ # raised exceptions of StandardError and its descendants.
1447
+ #
1448
+ # Related: Bundler::FileUtils.remove_entry_secure.
1449
+ #
1450
+ def remove_entry(path, force = false)
1451
+ Entry_.new(path).postorder_traverse do |ent|
1452
+ begin
1453
+ ent.remove
1454
+ rescue
1455
+ raise unless force
1456
+ end
1457
+ end
1458
+ rescue
1459
+ raise unless force
1460
+ end
1461
+ module_function :remove_entry
1462
+
1463
+ # Removes the file entry given by +path+,
1464
+ # which should be the entry for a regular file or a symbolic link.
1465
+ #
1466
+ # Argument +path+
1467
+ # should be {interpretable as a path}[rdoc-ref:FileUtils@Path+Arguments].
1468
+ #
1469
+ # Optional argument +force+ specifies whether to ignore
1470
+ # raised exceptions of StandardError and its descendants.
1471
+ #
1472
+ # Related: {methods for deleting}[rdoc-ref:FileUtils@Deleting].
1473
+ #
1474
+ def remove_file(path, force = false)
1475
+ Entry_.new(path).remove_file
1476
+ rescue
1477
+ raise unless force
1478
+ end
1479
+ module_function :remove_file
1480
+
1481
+ # Recursively removes the directory entry given by +path+,
1482
+ # which should be the entry for a regular file, a symbolic link,
1483
+ # or a directory.
1484
+ #
1485
+ # Argument +path+
1486
+ # should be {interpretable as a path}[rdoc-ref:FileUtils@Path+Arguments].
1487
+ #
1488
+ # Optional argument +force+ specifies whether to ignore
1489
+ # raised exceptions of StandardError and its descendants.
1490
+ #
1491
+ # Related: {methods for deleting}[rdoc-ref:FileUtils@Deleting].
1492
+ #
1493
+ def remove_dir(path, force = false)
1494
+ remove_entry path, force # FIXME?? check if it is a directory
1495
+ end
1496
+ module_function :remove_dir
1497
+
1498
+ # Returns +true+ if the contents of files +a+ and +b+ are identical,
1499
+ # +false+ otherwise.
1500
+ #
1501
+ # Arguments +a+ and +b+
1502
+ # should be {interpretable as a path}[rdoc-ref:FileUtils@Path+Arguments].
1503
+ #
1504
+ # Bundler::FileUtils.identical? and Bundler::FileUtils.cmp are aliases for Bundler::FileUtils.compare_file.
1505
+ #
1506
+ # Related: Bundler::FileUtils.compare_stream.
1507
+ #
1508
+ def compare_file(a, b)
1509
+ return false unless File.size(a) == File.size(b)
1510
+ File.open(a, 'rb') {|fa|
1511
+ File.open(b, 'rb') {|fb|
1512
+ return compare_stream(fa, fb)
1513
+ }
1514
+ }
1515
+ end
1516
+ module_function :compare_file
1517
+
1518
+ alias identical? compare_file
1519
+ alias cmp compare_file
1520
+ module_function :identical?
1521
+ module_function :cmp
1522
+
1523
+ # Returns +true+ if the contents of streams +a+ and +b+ are identical,
1524
+ # +false+ otherwise.
1525
+ #
1526
+ # Arguments +a+ and +b+
1527
+ # should be {interpretable as a path}[rdoc-ref:FileUtils@Path+Arguments].
1528
+ #
1529
+ # Related: Bundler::FileUtils.compare_file.
1530
+ #
1531
+ def compare_stream(a, b)
1532
+ bsize = fu_stream_blksize(a, b)
1533
+
1534
+ sa = String.new(capacity: bsize)
1535
+ sb = String.new(capacity: bsize)
1536
+
1537
+ begin
1538
+ a.read(bsize, sa)
1539
+ b.read(bsize, sb)
1540
+ return true if sa.empty? && sb.empty?
1541
+ end while sa == sb
1542
+ false
1543
+ end
1544
+ module_function :compare_stream
1545
+
1546
+ # Copies a file entry.
1547
+ # See {install(1)}[https://man7.org/linux/man-pages/man1/install.1.html].
1548
+ #
1549
+ # Arguments +src+ (a single path or an array of paths)
1550
+ # and +dest+ (a single path)
1551
+ # should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments];
1552
+ #
1553
+ # If the entry at +dest+ does not exist, copies from +src+ to +dest+:
1554
+ #
1555
+ # File.read('src0.txt') # => "aaa\n"
1556
+ # File.exist?('dest0.txt') # => false
1557
+ # Bundler::FileUtils.install('src0.txt', 'dest0.txt')
1558
+ # File.read('dest0.txt') # => "aaa\n"
1559
+ #
1560
+ # If +dest+ is a file entry, copies from +src+ to +dest+, overwriting:
1561
+ #
1562
+ # File.read('src1.txt') # => "aaa\n"
1563
+ # File.read('dest1.txt') # => "bbb\n"
1564
+ # Bundler::FileUtils.install('src1.txt', 'dest1.txt')
1565
+ # File.read('dest1.txt') # => "aaa\n"
1566
+ #
1567
+ # If +dest+ is a directory entry, copies from +src+ to <tt>dest/src</tt>,
1568
+ # overwriting if necessary:
1569
+ #
1570
+ # File.read('src2.txt') # => "aaa\n"
1571
+ # File.read('dest2/src2.txt') # => "bbb\n"
1572
+ # Bundler::FileUtils.install('src2.txt', 'dest2')
1573
+ # File.read('dest2/src2.txt') # => "aaa\n"
1574
+ #
1575
+ # If +src+ is an array of paths and +dest+ points to a directory,
1576
+ # copies each path +path+ in +src+ to <tt>dest/path</tt>:
1577
+ #
1578
+ # File.file?('src3.txt') # => true
1579
+ # File.file?('src3.dat') # => true
1580
+ # Bundler::FileUtils.mkdir('dest3')
1581
+ # Bundler::FileUtils.install(['src3.txt', 'src3.dat'], 'dest3')
1582
+ # File.file?('dest3/src3.txt') # => true
1583
+ # File.file?('dest3/src3.dat') # => true
1584
+ #
1585
+ # Keyword arguments:
1586
+ #
1587
+ # - <tt>group: <i>group</i></tt> - changes the group if not +nil+,
1588
+ # using {File.chown}[https://docs.ruby-lang.org/en/master/File.html#method-c-chown].
1589
+ # - <tt>mode: <i>permissions</i></tt> - changes the permissions.
1590
+ # using {File.chmod}[https://docs.ruby-lang.org/en/master/File.html#method-c-chmod].
1591
+ # - <tt>noop: true</tt> - does not copy entries; returns +nil+.
1592
+ # - <tt>owner: <i>owner</i></tt> - changes the owner if not +nil+,
1593
+ # using {File.chown}[https://docs.ruby-lang.org/en/master/File.html#method-c-chown].
1594
+ # - <tt>preserve: true</tt> - preserve timestamps
1595
+ # using {File.utime}[https://docs.ruby-lang.org/en/master/File.html#method-c-utime].
1596
+ # - <tt>verbose: true</tt> - prints an equivalent command:
1597
+ #
1598
+ # Bundler::FileUtils.install('src0.txt', 'dest0.txt', noop: true, verbose: true)
1599
+ # Bundler::FileUtils.install('src1.txt', 'dest1.txt', noop: true, verbose: true)
1600
+ # Bundler::FileUtils.install('src2.txt', 'dest2', noop: true, verbose: true)
1601
+ #
1602
+ # Output:
1603
+ #
1604
+ # install -c src0.txt dest0.txt
1605
+ # install -c src1.txt dest1.txt
1606
+ # install -c src2.txt dest2
1607
+ #
1608
+ # Related: {methods for copying}[rdoc-ref:FileUtils@Copying].
1609
+ #
1610
+ def install(src, dest, mode: nil, owner: nil, group: nil, preserve: nil,
1611
+ noop: nil, verbose: nil)
1612
+ if verbose
1613
+ msg = +"install -c"
1614
+ msg << ' -p' if preserve
1615
+ msg << ' -m ' << mode_to_s(mode) if mode
1616
+ msg << " -o #{owner}" if owner
1617
+ msg << " -g #{group}" if group
1618
+ msg << ' ' << [src,dest].flatten.join(' ')
1619
+ fu_output_message msg
1620
+ end
1621
+ return if noop
1622
+ uid = fu_get_uid(owner)
1623
+ gid = fu_get_gid(group)
1624
+ fu_each_src_dest(src, dest) do |s, d|
1625
+ st = File.stat(s)
1626
+ unless File.exist?(d) and compare_file(s, d)
1627
+ remove_file d, true
1628
+ if d.end_with?('/')
1629
+ mkdir_p d
1630
+ copy_file s, d + File.basename(s)
1631
+ else
1632
+ mkdir_p File.expand_path('..', d)
1633
+ copy_file s, d
1634
+ end
1635
+ File.utime st.atime, st.mtime, d if preserve
1636
+ File.chmod fu_mode(mode, st), d if mode
1637
+ File.chown uid, gid, d if uid or gid
1638
+ end
1639
+ end
1640
+ end
1641
+ module_function :install
1642
+
1643
+ def user_mask(target) #:nodoc:
1644
+ target.each_char.inject(0) do |mask, chr|
1645
+ case chr
1646
+ when "u"
1647
+ mask | 04700
1648
+ when "g"
1649
+ mask | 02070
1650
+ when "o"
1651
+ mask | 01007
1652
+ when "a"
1653
+ mask | 07777
1654
+ else
1655
+ raise ArgumentError, "invalid 'who' symbol in file mode: #{chr}"
1656
+ end
1657
+ end
1658
+ end
1659
+ private_module_function :user_mask
1660
+
1661
+ def apply_mask(mode, user_mask, op, mode_mask) #:nodoc:
1662
+ case op
1663
+ when '='
1664
+ (mode & ~user_mask) | (user_mask & mode_mask)
1665
+ when '+'
1666
+ mode | (user_mask & mode_mask)
1667
+ when '-'
1668
+ mode & ~(user_mask & mode_mask)
1669
+ end
1670
+ end
1671
+ private_module_function :apply_mask
1672
+
1673
+ def symbolic_modes_to_i(mode_sym, path) #:nodoc:
1674
+ path = File.stat(path) unless File::Stat === path
1675
+ mode = path.mode
1676
+ mode_sym.split(/,/).inject(mode & 07777) do |current_mode, clause|
1677
+ target, *actions = clause.split(/([=+-])/)
1678
+ raise ArgumentError, "invalid file mode: #{mode_sym}" if actions.empty?
1679
+ target = 'a' if target.empty?
1680
+ user_mask = user_mask(target)
1681
+ actions.each_slice(2) do |op, perm|
1682
+ need_apply = op == '='
1683
+ mode_mask = (perm || '').each_char.inject(0) do |mask, chr|
1684
+ case chr
1685
+ when "r"
1686
+ mask | 0444
1687
+ when "w"
1688
+ mask | 0222
1689
+ when "x"
1690
+ mask | 0111
1691
+ when "X"
1692
+ if path.directory?
1693
+ mask | 0111
1694
+ else
1695
+ mask
1696
+ end
1697
+ when "s"
1698
+ mask | 06000
1699
+ when "t"
1700
+ mask | 01000
1701
+ when "u", "g", "o"
1702
+ if mask.nonzero?
1703
+ current_mode = apply_mask(current_mode, user_mask, op, mask)
1704
+ end
1705
+ need_apply = false
1706
+ copy_mask = user_mask(chr)
1707
+ (current_mode & copy_mask) / (copy_mask & 0111) * (user_mask & 0111)
1708
+ else
1709
+ raise ArgumentError, "invalid 'perm' symbol in file mode: #{chr}"
1710
+ end
1711
+ end
1712
+
1713
+ if mode_mask.nonzero? || need_apply
1714
+ current_mode = apply_mask(current_mode, user_mask, op, mode_mask)
1715
+ end
1716
+ end
1717
+ current_mode
1718
+ end
1719
+ end
1720
+ private_module_function :symbolic_modes_to_i
1721
+
1722
+ def fu_mode(mode, path) #:nodoc:
1723
+ mode.is_a?(String) ? symbolic_modes_to_i(mode, path) : mode
1724
+ end
1725
+ private_module_function :fu_mode
1726
+
1727
+ def mode_to_s(mode) #:nodoc:
1728
+ mode.is_a?(String) ? mode : "%o" % mode
1729
+ end
1730
+ private_module_function :mode_to_s
1731
+
1732
+ # Changes permissions on the entries at the paths given in +list+
1733
+ # (a single path or an array of paths)
1734
+ # to the permissions given by +mode+;
1735
+ # returns +list+ if it is an array, <tt>[list]</tt> otherwise:
1736
+ #
1737
+ # - Modifies each entry that is a regular file using
1738
+ # {File.chmod}[https://docs.ruby-lang.org/en/master/File.html#method-c-chmod].
1739
+ # - Modifies each entry that is a symbolic link using
1740
+ # {File.lchmod}[https://docs.ruby-lang.org/en/master/File.html#method-c-lchmod].
1741
+ #
1742
+ # Argument +list+ or its elements
1743
+ # should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
1744
+ #
1745
+ # Argument +mode+ may be either an integer or a string:
1746
+ #
1747
+ # - \Integer +mode+: represents the permission bits to be set:
1748
+ #
1749
+ # Bundler::FileUtils.chmod(0755, 'src0.txt')
1750
+ # Bundler::FileUtils.chmod(0644, ['src0.txt', 'src0.dat'])
1751
+ #
1752
+ # - \String +mode+: represents the permissions to be set:
1753
+ #
1754
+ # The string is of the form <tt>[targets][[operator][perms[,perms]]</tt>, where:
1755
+ #
1756
+ # - +targets+ may be any combination of these letters:
1757
+ #
1758
+ # - <tt>'u'</tt>: permissions apply to the file's owner.
1759
+ # - <tt>'g'</tt>: permissions apply to users in the file's group.
1760
+ # - <tt>'o'</tt>: permissions apply to other users not in the file's group.
1761
+ # - <tt>'a'</tt> (the default): permissions apply to all users.
1762
+ #
1763
+ # - +operator+ may be one of these letters:
1764
+ #
1765
+ # - <tt>'+'</tt>: adds permissions.
1766
+ # - <tt>'-'</tt>: removes permissions.
1767
+ # - <tt>'='</tt>: sets (replaces) permissions.
1768
+ #
1769
+ # - +perms+ (may be repeated, with separating commas)
1770
+ # may be any combination of these letters:
1771
+ #
1772
+ # - <tt>'r'</tt>: Read.
1773
+ # - <tt>'w'</tt>: Write.
1774
+ # - <tt>'x'</tt>: Execute (search, for a directory).
1775
+ # - <tt>'X'</tt>: Search (for a directories only;
1776
+ # must be used with <tt>'+'</tt>)
1777
+ # - <tt>'s'</tt>: Uid or gid.
1778
+ # - <tt>'t'</tt>: Sticky bit.
1779
+ #
1780
+ # Examples:
1781
+ #
1782
+ # Bundler::FileUtils.chmod('u=wrx,go=rx', 'src1.txt')
1783
+ # Bundler::FileUtils.chmod('u=wrx,go=rx', '/usr/bin/ruby')
1784
+ #
1785
+ # Keyword arguments:
1786
+ #
1787
+ # - <tt>noop: true</tt> - does not change permissions; returns +nil+.
1788
+ # - <tt>verbose: true</tt> - prints an equivalent command:
1789
+ #
1790
+ # Bundler::FileUtils.chmod(0755, 'src0.txt', noop: true, verbose: true)
1791
+ # Bundler::FileUtils.chmod(0644, ['src0.txt', 'src0.dat'], noop: true, verbose: true)
1792
+ # Bundler::FileUtils.chmod('u=wrx,go=rx', 'src1.txt', noop: true, verbose: true)
1793
+ # Bundler::FileUtils.chmod('u=wrx,go=rx', '/usr/bin/ruby', noop: true, verbose: true)
1794
+ #
1795
+ # Output:
1796
+ #
1797
+ # chmod 755 src0.txt
1798
+ # chmod 644 src0.txt src0.dat
1799
+ # chmod u=wrx,go=rx src1.txt
1800
+ # chmod u=wrx,go=rx /usr/bin/ruby
1801
+ #
1802
+ # Related: Bundler::FileUtils.chmod_R.
1803
+ #
1804
+ def chmod(mode, list, noop: nil, verbose: nil)
1805
+ list = fu_list(list)
1806
+ fu_output_message sprintf('chmod %s %s', mode_to_s(mode), list.join(' ')) if verbose
1807
+ return if noop
1808
+ list.each do |path|
1809
+ Entry_.new(path).chmod(fu_mode(mode, path))
1810
+ end
1811
+ end
1812
+ module_function :chmod
1813
+
1814
+ # Like Bundler::FileUtils.chmod, but changes permissions recursively.
1815
+ #
1816
+ def chmod_R(mode, list, noop: nil, verbose: nil, force: nil)
1817
+ list = fu_list(list)
1818
+ fu_output_message sprintf('chmod -R%s %s %s',
1819
+ (force ? 'f' : ''),
1820
+ mode_to_s(mode), list.join(' ')) if verbose
1821
+ return if noop
1822
+ list.each do |root|
1823
+ Entry_.new(root).traverse do |ent|
1824
+ begin
1825
+ ent.chmod(fu_mode(mode, ent.path))
1826
+ rescue
1827
+ raise unless force
1828
+ end
1829
+ end
1830
+ end
1831
+ end
1832
+ module_function :chmod_R
1833
+
1834
+ # Changes the owner and group on the entries at the paths given in +list+
1835
+ # (a single path or an array of paths)
1836
+ # to the given +user+ and +group+;
1837
+ # returns +list+ if it is an array, <tt>[list]</tt> otherwise:
1838
+ #
1839
+ # - Modifies each entry that is a regular file using
1840
+ # {File.chown}[https://docs.ruby-lang.org/en/master/File.html#method-c-chown].
1841
+ # - Modifies each entry that is a symbolic link using
1842
+ # {File.lchown}[https://docs.ruby-lang.org/en/master/File.html#method-c-lchown].
1843
+ #
1844
+ # Argument +list+ or its elements
1845
+ # should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
1846
+ #
1847
+ # User and group:
1848
+ #
1849
+ # - Argument +user+ may be a user name or a user id;
1850
+ # if +nil+ or +-1+, the user is not changed.
1851
+ # - Argument +group+ may be a group name or a group id;
1852
+ # if +nil+ or +-1+, the group is not changed.
1853
+ # - The user must be a member of the group.
1854
+ #
1855
+ # Examples:
1856
+ #
1857
+ # # One path.
1858
+ # # User and group as string names.
1859
+ # File.stat('src0.txt').uid # => 1004
1860
+ # File.stat('src0.txt').gid # => 1004
1861
+ # Bundler::FileUtils.chown('user2', 'group1', 'src0.txt')
1862
+ # File.stat('src0.txt').uid # => 1006
1863
+ # File.stat('src0.txt').gid # => 1005
1864
+ #
1865
+ # # User and group as uid and gid.
1866
+ # Bundler::FileUtils.chown(1004, 1004, 'src0.txt')
1867
+ # File.stat('src0.txt').uid # => 1004
1868
+ # File.stat('src0.txt').gid # => 1004
1869
+ #
1870
+ # # Array of paths.
1871
+ # Bundler::FileUtils.chown(1006, 1005, ['src0.txt', 'src0.dat'])
1872
+ #
1873
+ # # Directory (not recursive).
1874
+ # Bundler::FileUtils.chown('user2', 'group1', '.')
1875
+ #
1876
+ # Keyword arguments:
1877
+ #
1878
+ # - <tt>noop: true</tt> - does not change permissions; returns +nil+.
1879
+ # - <tt>verbose: true</tt> - prints an equivalent command:
1880
+ #
1881
+ # Bundler::FileUtils.chown('user2', 'group1', 'src0.txt', noop: true, verbose: true)
1882
+ # Bundler::FileUtils.chown(1004, 1004, 'src0.txt', noop: true, verbose: true)
1883
+ # Bundler::FileUtils.chown(1006, 1005, ['src0.txt', 'src0.dat'], noop: true, verbose: true)
1884
+ # Bundler::FileUtils.chown('user2', 'group1', path, noop: true, verbose: true)
1885
+ # Bundler::FileUtils.chown('user2', 'group1', '.', noop: true, verbose: true)
1886
+ #
1887
+ # Output:
1888
+ #
1889
+ # chown user2:group1 src0.txt
1890
+ # chown 1004:1004 src0.txt
1891
+ # chown 1006:1005 src0.txt src0.dat
1892
+ # chown user2:group1 src0.txt
1893
+ # chown user2:group1 .
1894
+ #
1895
+ # Related: Bundler::FileUtils.chown_R.
1896
+ #
1897
+ def chown(user, group, list, noop: nil, verbose: nil)
1898
+ list = fu_list(list)
1899
+ fu_output_message sprintf('chown %s %s',
1900
+ (group ? "#{user}:#{group}" : user || ':'),
1901
+ list.join(' ')) if verbose
1902
+ return if noop
1903
+ uid = fu_get_uid(user)
1904
+ gid = fu_get_gid(group)
1905
+ list.each do |path|
1906
+ Entry_.new(path).chown uid, gid
1907
+ end
1908
+ end
1909
+ module_function :chown
1910
+
1911
+ # Like Bundler::FileUtils.chown, but changes owner and group recursively.
1912
+ #
1913
+ def chown_R(user, group, list, noop: nil, verbose: nil, force: nil)
1914
+ list = fu_list(list)
1915
+ fu_output_message sprintf('chown -R%s %s %s',
1916
+ (force ? 'f' : ''),
1917
+ (group ? "#{user}:#{group}" : user || ':'),
1918
+ list.join(' ')) if verbose
1919
+ return if noop
1920
+ uid = fu_get_uid(user)
1921
+ gid = fu_get_gid(group)
1922
+ list.each do |root|
1923
+ Entry_.new(root).traverse do |ent|
1924
+ begin
1925
+ ent.chown uid, gid
1926
+ rescue
1927
+ raise unless force
1928
+ end
1929
+ end
1930
+ end
1931
+ end
1932
+ module_function :chown_R
1933
+
1934
+ def fu_get_uid(user) #:nodoc:
1935
+ return nil unless user
1936
+ case user
1937
+ when Integer
1938
+ user
1939
+ when /\A\d+\z/
1940
+ user.to_i
1941
+ else
1942
+ require 'etc'
1943
+ Etc.getpwnam(user) ? Etc.getpwnam(user).uid : nil
1944
+ end
1945
+ end
1946
+ private_module_function :fu_get_uid
1947
+
1948
+ def fu_get_gid(group) #:nodoc:
1949
+ return nil unless group
1950
+ case group
1951
+ when Integer
1952
+ group
1953
+ when /\A\d+\z/
1954
+ group.to_i
1955
+ else
1956
+ require 'etc'
1957
+ Etc.getgrnam(group) ? Etc.getgrnam(group).gid : nil
1958
+ end
1959
+ end
1960
+ private_module_function :fu_get_gid
1961
+
1962
+ # Updates modification times (mtime) and access times (atime)
1963
+ # of the entries given by the paths in +list+
1964
+ # (a single path or an array of paths);
1965
+ # returns +list+ if it is an array, <tt>[list]</tt> otherwise.
1966
+ #
1967
+ # By default, creates an empty file for any path to a non-existent entry;
1968
+ # use keyword argument +nocreate+ to raise an exception instead.
1969
+ #
1970
+ # Argument +list+ or its elements
1971
+ # should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
1972
+ #
1973
+ # Examples:
1974
+ #
1975
+ # # Single path.
1976
+ # f = File.new('src0.txt') # Existing file.
1977
+ # f.atime # => 2022-06-10 11:11:21.200277 -0700
1978
+ # f.mtime # => 2022-06-10 11:11:21.200277 -0700
1979
+ # Bundler::FileUtils.touch('src0.txt')
1980
+ # f = File.new('src0.txt')
1981
+ # f.atime # => 2022-06-11 08:28:09.8185343 -0700
1982
+ # f.mtime # => 2022-06-11 08:28:09.8185343 -0700
1983
+ #
1984
+ # # Array of paths.
1985
+ # Bundler::FileUtils.touch(['src0.txt', 'src0.dat'])
1986
+ #
1987
+ # Keyword arguments:
1988
+ #
1989
+ # - <tt>mtime: <i>time</i></tt> - sets the entry's mtime to the given time,
1990
+ # instead of the current time.
1991
+ # - <tt>nocreate: true</tt> - raises an exception if the entry does not exist.
1992
+ # - <tt>noop: true</tt> - does not touch entries; returns +nil+.
1993
+ # - <tt>verbose: true</tt> - prints an equivalent command:
1994
+ #
1995
+ # Bundler::FileUtils.touch('src0.txt', noop: true, verbose: true)
1996
+ # Bundler::FileUtils.touch(['src0.txt', 'src0.dat'], noop: true, verbose: true)
1997
+ # Bundler::FileUtils.touch(path, noop: true, verbose: true)
1998
+ #
1999
+ # Output:
2000
+ #
2001
+ # touch src0.txt
2002
+ # touch src0.txt src0.dat
2003
+ # touch src0.txt
2004
+ #
2005
+ # Related: Bundler::FileUtils.uptodate?.
2006
+ #
2007
+ def touch(list, noop: nil, verbose: nil, mtime: nil, nocreate: nil)
2008
+ list = fu_list(list)
2009
+ t = mtime
2010
+ if verbose
2011
+ fu_output_message "touch #{nocreate ? '-c ' : ''}#{t ? t.strftime('-t %Y%m%d%H%M.%S ') : ''}#{list.join ' '}"
2012
+ end
2013
+ return if noop
2014
+ list.each do |path|
2015
+ created = nocreate
2016
+ begin
2017
+ File.utime(t, t, path)
2018
+ rescue Errno::ENOENT
2019
+ raise if created
2020
+ File.open(path, 'a') {
2021
+ ;
2022
+ }
2023
+ created = true
2024
+ retry if t
2025
+ end
2026
+ end
2027
+ end
2028
+ module_function :touch
2029
+
2030
+ private
2031
+
2032
+ module StreamUtils_ # :nodoc:
2033
+
2034
+ private
2035
+
2036
+ case (defined?(::RbConfig) ? ::RbConfig::CONFIG['host_os'] : ::RUBY_PLATFORM)
2037
+ when /mswin|mingw/
2038
+ def fu_windows?; true end #:nodoc:
2039
+ else
2040
+ def fu_windows?; false end #:nodoc:
2041
+ end
2042
+
2043
+ def fu_copy_stream0(src, dest, blksize = nil) #:nodoc:
2044
+ IO.copy_stream(src, dest)
2045
+ end
2046
+
2047
+ def fu_stream_blksize(*streams) #:nodoc:
2048
+ streams.each do |s|
2049
+ next unless s.respond_to?(:stat)
2050
+ size = fu_blksize(s.stat)
2051
+ return size if size
2052
+ end
2053
+ fu_default_blksize()
2054
+ end
2055
+
2056
+ def fu_blksize(st) #:nodoc:
2057
+ s = st.blksize
2058
+ return nil unless s
2059
+ return nil if s == 0
2060
+ s
2061
+ end
2062
+
2063
+ def fu_default_blksize #:nodoc:
2064
+ 1024
2065
+ end
2066
+ end
2067
+
2068
+ include StreamUtils_
2069
+ extend StreamUtils_
2070
+
2071
+ class Entry_ #:nodoc: internal use only
2072
+ include StreamUtils_
2073
+
2074
+ def initialize(a, b = nil, deref = false)
2075
+ @prefix = @rel = @path = nil
2076
+ if b
2077
+ @prefix = a
2078
+ @rel = b
2079
+ else
2080
+ @path = a
2081
+ end
2082
+ @deref = deref
2083
+ @stat = nil
2084
+ @lstat = nil
2085
+ end
2086
+
2087
+ def inspect
2088
+ "\#<#{self.class} #{path()}>"
2089
+ end
2090
+
2091
+ def path
2092
+ if @path
2093
+ File.path(@path)
2094
+ else
2095
+ join(@prefix, @rel)
2096
+ end
2097
+ end
2098
+
2099
+ def prefix
2100
+ @prefix || @path
2101
+ end
2102
+
2103
+ def rel
2104
+ @rel
2105
+ end
2106
+
2107
+ def dereference?
2108
+ @deref
2109
+ end
2110
+
2111
+ def exist?
2112
+ begin
2113
+ lstat
2114
+ true
2115
+ rescue Errno::ENOENT
2116
+ false
2117
+ end
2118
+ end
2119
+
2120
+ def file?
2121
+ s = lstat!
2122
+ s and s.file?
2123
+ end
2124
+
2125
+ def directory?
2126
+ s = lstat!
2127
+ s and s.directory?
2128
+ end
2129
+
2130
+ def symlink?
2131
+ s = lstat!
2132
+ s and s.symlink?
2133
+ end
2134
+
2135
+ def chardev?
2136
+ s = lstat!
2137
+ s and s.chardev?
2138
+ end
2139
+
2140
+ def blockdev?
2141
+ s = lstat!
2142
+ s and s.blockdev?
2143
+ end
2144
+
2145
+ def socket?
2146
+ s = lstat!
2147
+ s and s.socket?
2148
+ end
2149
+
2150
+ def pipe?
2151
+ s = lstat!
2152
+ s and s.pipe?
2153
+ end
2154
+
2155
+ S_IF_DOOR = 0xD000
2156
+
2157
+ def door?
2158
+ s = lstat!
2159
+ s and (s.mode & 0xF000 == S_IF_DOOR)
2160
+ end
2161
+
2162
+ def entries
2163
+ opts = {}
2164
+ opts[:encoding] = fu_windows? ? ::Encoding::UTF_8 : path.encoding
2165
+
2166
+ files = Dir.children(path, **opts)
2167
+
2168
+ untaint = RUBY_VERSION < '2.7'
2169
+ files.map {|n| Entry_.new(prefix(), join(rel(), untaint ? n.untaint : n)) }
2170
+ end
2171
+
2172
+ def stat
2173
+ return @stat if @stat
2174
+ if lstat() and lstat().symlink?
2175
+ @stat = File.stat(path())
2176
+ else
2177
+ @stat = lstat()
2178
+ end
2179
+ @stat
2180
+ end
2181
+
2182
+ def stat!
2183
+ return @stat if @stat
2184
+ if lstat! and lstat!.symlink?
2185
+ @stat = File.stat(path())
2186
+ else
2187
+ @stat = lstat!
2188
+ end
2189
+ @stat
2190
+ rescue SystemCallError
2191
+ nil
2192
+ end
2193
+
2194
+ def lstat
2195
+ if dereference?
2196
+ @lstat ||= File.stat(path())
2197
+ else
2198
+ @lstat ||= File.lstat(path())
2199
+ end
2200
+ end
2201
+
2202
+ def lstat!
2203
+ lstat()
2204
+ rescue SystemCallError
2205
+ nil
2206
+ end
2207
+
2208
+ def chmod(mode)
2209
+ if symlink?
2210
+ File.lchmod mode, path() if have_lchmod?
2211
+ else
2212
+ File.chmod mode, path()
2213
+ end
2214
+ rescue Errno::EOPNOTSUPP
2215
+ end
2216
+
2217
+ def chown(uid, gid)
2218
+ if symlink?
2219
+ File.lchown uid, gid, path() if have_lchown?
2220
+ else
2221
+ File.chown uid, gid, path()
2222
+ end
2223
+ end
2224
+
2225
+ def link(dest)
2226
+ case
2227
+ when directory?
2228
+ if !File.exist?(dest) and descendant_directory?(dest, path)
2229
+ raise ArgumentError, "cannot link directory %s to itself %s" % [path, dest]
2230
+ end
2231
+ begin
2232
+ Dir.mkdir dest
2233
+ rescue
2234
+ raise unless File.directory?(dest)
2235
+ end
2236
+ else
2237
+ File.link path(), dest
2238
+ end
2239
+ end
2240
+
2241
+ def copy(dest)
2242
+ lstat
2243
+ case
2244
+ when file?
2245
+ copy_file dest
2246
+ when directory?
2247
+ if !File.exist?(dest) and descendant_directory?(dest, path)
2248
+ raise ArgumentError, "cannot copy directory %s to itself %s" % [path, dest]
2249
+ end
2250
+ begin
2251
+ Dir.mkdir dest
2252
+ rescue
2253
+ raise unless File.directory?(dest)
2254
+ end
2255
+ when symlink?
2256
+ File.symlink File.readlink(path()), dest
2257
+ when chardev?, blockdev?
2258
+ raise "cannot handle device file"
2259
+ when socket?
2260
+ begin
2261
+ require 'socket'
2262
+ rescue LoadError
2263
+ raise "cannot handle socket"
2264
+ else
2265
+ raise "cannot handle socket" unless defined?(UNIXServer)
2266
+ end
2267
+ UNIXServer.new(dest).close
2268
+ File.chmod lstat().mode, dest
2269
+ when pipe?
2270
+ raise "cannot handle FIFO" unless File.respond_to?(:mkfifo)
2271
+ File.mkfifo dest, lstat().mode
2272
+ when door?
2273
+ raise "cannot handle door: #{path()}"
2274
+ else
2275
+ raise "unknown file type: #{path()}"
2276
+ end
2277
+ end
2278
+
2279
+ def copy_file(dest)
2280
+ File.open(path()) do |s|
2281
+ File.open(dest, 'wb', s.stat.mode) do |f|
2282
+ IO.copy_stream(s, f)
2283
+ end
2284
+ end
2285
+ end
2286
+
2287
+ def copy_metadata(path)
2288
+ st = lstat()
2289
+ if !st.symlink?
2290
+ File.utime st.atime, st.mtime, path
2291
+ end
2292
+ mode = st.mode
2293
+ begin
2294
+ if st.symlink?
2295
+ begin
2296
+ File.lchown st.uid, st.gid, path
2297
+ rescue NotImplementedError
2298
+ end
2299
+ else
2300
+ File.chown st.uid, st.gid, path
2301
+ end
2302
+ rescue Errno::EPERM, Errno::EACCES
2303
+ # clear setuid/setgid
2304
+ mode &= 01777
2305
+ end
2306
+ if st.symlink?
2307
+ begin
2308
+ File.lchmod mode, path
2309
+ rescue NotImplementedError, Errno::EOPNOTSUPP
2310
+ end
2311
+ else
2312
+ File.chmod mode, path
2313
+ end
2314
+ end
2315
+
2316
+ def remove
2317
+ if directory?
2318
+ remove_dir1
2319
+ else
2320
+ remove_file
2321
+ end
2322
+ end
2323
+
2324
+ def remove_dir1
2325
+ platform_support {
2326
+ Dir.rmdir path().chomp(?/)
2327
+ }
2328
+ end
2329
+
2330
+ def remove_file
2331
+ platform_support {
2332
+ File.unlink path
2333
+ }
2334
+ end
2335
+
2336
+ def platform_support
2337
+ return yield unless fu_windows?
2338
+ first_time_p = true
2339
+ begin
2340
+ yield
2341
+ rescue Errno::ENOENT
2342
+ raise
2343
+ rescue => err
2344
+ if first_time_p
2345
+ first_time_p = false
2346
+ begin
2347
+ File.chmod 0700, path() # Windows does not have symlink
2348
+ retry
2349
+ rescue SystemCallError
2350
+ end
2351
+ end
2352
+ raise err
2353
+ end
2354
+ end
2355
+
2356
+ def preorder_traverse
2357
+ stack = [self]
2358
+ while ent = stack.pop
2359
+ yield ent
2360
+ stack.concat ent.entries.reverse if ent.directory?
2361
+ end
2362
+ end
2363
+
2364
+ alias traverse preorder_traverse
2365
+
2366
+ def postorder_traverse
2367
+ if directory?
2368
+ begin
2369
+ children = entries()
2370
+ rescue Errno::EACCES
2371
+ # Failed to get the list of children.
2372
+ # Assuming there is no children, try to process the parent directory.
2373
+ yield self
2374
+ return
2375
+ end
2376
+
2377
+ children.each do |ent|
2378
+ ent.postorder_traverse do |e|
2379
+ yield e
2380
+ end
2381
+ end
2382
+ end
2383
+ yield self
2384
+ end
2385
+
2386
+ def wrap_traverse(pre, post)
2387
+ pre.call self
2388
+ if directory?
2389
+ entries.each do |ent|
2390
+ ent.wrap_traverse pre, post
2391
+ end
2392
+ end
2393
+ post.call self
2394
+ end
2395
+
2396
+ private
2397
+
2398
+ @@fileutils_rb_have_lchmod = nil
2399
+
2400
+ def have_lchmod?
2401
+ # This is not MT-safe, but it does not matter.
2402
+ if @@fileutils_rb_have_lchmod == nil
2403
+ @@fileutils_rb_have_lchmod = check_have_lchmod?
2404
+ end
2405
+ @@fileutils_rb_have_lchmod
2406
+ end
2407
+
2408
+ def check_have_lchmod?
2409
+ return false unless File.respond_to?(:lchmod)
2410
+ File.lchmod 0
2411
+ return true
2412
+ rescue NotImplementedError
2413
+ return false
2414
+ end
2415
+
2416
+ @@fileutils_rb_have_lchown = nil
2417
+
2418
+ def have_lchown?
2419
+ # This is not MT-safe, but it does not matter.
2420
+ if @@fileutils_rb_have_lchown == nil
2421
+ @@fileutils_rb_have_lchown = check_have_lchown?
2422
+ end
2423
+ @@fileutils_rb_have_lchown
2424
+ end
2425
+
2426
+ def check_have_lchown?
2427
+ return false unless File.respond_to?(:lchown)
2428
+ File.lchown nil, nil
2429
+ return true
2430
+ rescue NotImplementedError
2431
+ return false
2432
+ end
2433
+
2434
+ def join(dir, base)
2435
+ return File.path(dir) if not base or base == '.'
2436
+ return File.path(base) if not dir or dir == '.'
2437
+ begin
2438
+ File.join(dir, base)
2439
+ rescue EncodingError
2440
+ if fu_windows?
2441
+ File.join(dir.encode(::Encoding::UTF_8), base.encode(::Encoding::UTF_8))
2442
+ else
2443
+ raise
2444
+ end
2445
+ end
2446
+ end
2447
+
2448
+ if File::ALT_SEPARATOR
2449
+ DIRECTORY_TERM = "(?=[/#{Regexp.quote(File::ALT_SEPARATOR)}]|\\z)"
2450
+ else
2451
+ DIRECTORY_TERM = "(?=/|\\z)"
2452
+ end
2453
+
2454
+ def descendant_directory?(descendant, ascendant)
2455
+ if File::FNM_SYSCASE.nonzero?
2456
+ File.expand_path(File.dirname(descendant)).casecmp(File.expand_path(ascendant)) == 0
2457
+ else
2458
+ File.expand_path(File.dirname(descendant)) == File.expand_path(ascendant)
2459
+ end
2460
+ end
2461
+ end # class Entry_
2462
+
2463
+ def fu_list(arg) #:nodoc:
2464
+ [arg].flatten.map {|path| File.path(path) }
2465
+ end
2466
+ private_module_function :fu_list
2467
+
2468
+ def fu_each_src_dest(src, dest) #:nodoc:
2469
+ fu_each_src_dest0(src, dest) do |s, d|
2470
+ raise ArgumentError, "same file: #{s} and #{d}" if fu_same?(s, d)
2471
+ yield s, d
2472
+ end
2473
+ end
2474
+ private_module_function :fu_each_src_dest
2475
+
2476
+ def fu_each_src_dest0(src, dest, target_directory = true) #:nodoc:
2477
+ if tmp = Array.try_convert(src)
2478
+ tmp.each do |s|
2479
+ s = File.path(s)
2480
+ yield s, (target_directory ? File.join(dest, File.basename(s)) : dest)
2481
+ end
2482
+ else
2483
+ src = File.path(src)
2484
+ if target_directory and File.directory?(dest)
2485
+ yield src, File.join(dest, File.basename(src))
2486
+ else
2487
+ yield src, File.path(dest)
2488
+ end
2489
+ end
2490
+ end
2491
+ private_module_function :fu_each_src_dest0
2492
+
2493
+ def fu_same?(a, b) #:nodoc:
2494
+ File.identical?(a, b)
2495
+ end
2496
+ private_module_function :fu_same?
2497
+
2498
+ def fu_output_message(msg) #:nodoc:
2499
+ output = @fileutils_output if defined?(@fileutils_output)
2500
+ output ||= $stdout
2501
+ if defined?(@fileutils_label)
2502
+ msg = @fileutils_label + msg
2503
+ end
2504
+ output.puts msg
2505
+ end
2506
+ private_module_function :fu_output_message
2507
+
2508
+ def fu_split_path(path) #:nodoc:
2509
+ path = File.path(path)
2510
+ list = []
2511
+ until (parent, base = File.split(path); parent == path or parent == ".")
2512
+ list << base
2513
+ path = parent
2514
+ end
2515
+ list << path
2516
+ list.reverse!
2517
+ end
2518
+ private_module_function :fu_split_path
2519
+
2520
+ def fu_relative_components_from(target, base) #:nodoc:
2521
+ i = 0
2522
+ while target[i]&.== base[i]
2523
+ i += 1
2524
+ end
2525
+ Array.new(base.size-i, '..').concat(target[i..-1])
2526
+ end
2527
+ private_module_function :fu_relative_components_from
2528
+
2529
+ def fu_clean_components(*comp) #:nodoc:
2530
+ comp.shift while comp.first == "."
2531
+ return comp if comp.empty?
2532
+ clean = [comp.shift]
2533
+ path = File.join(*clean, "") # ending with File::SEPARATOR
2534
+ while c = comp.shift
2535
+ if c == ".." and clean.last != ".." and !(fu_have_symlink? && File.symlink?(path))
2536
+ clean.pop
2537
+ path.chomp!(%r((?<=\A|/)[^/]+/\z), "")
2538
+ else
2539
+ clean << c
2540
+ path << c << "/"
2541
+ end
2542
+ end
2543
+ clean
2544
+ end
2545
+ private_module_function :fu_clean_components
2546
+
2547
+ if fu_windows?
2548
+ def fu_starting_path?(path) #:nodoc:
2549
+ path&.start_with?(%r(\w:|/))
2550
+ end
2551
+ else
2552
+ def fu_starting_path?(path) #:nodoc:
2553
+ path&.start_with?("/")
2554
+ end
2555
+ end
2556
+ private_module_function :fu_starting_path?
2557
+
2558
+ # This hash table holds command options.
2559
+ OPT_TABLE = {} #:nodoc: internal use only
2560
+ (private_instance_methods & methods(false)).inject(OPT_TABLE) {|tbl, name|
2561
+ (tbl[name.to_s] = instance_method(name).parameters).map! {|t, n| n if t == :key}.compact!
2562
+ tbl
2563
+ }
2564
+
2565
+ public
2566
+
2567
+ # Returns an array of the string names of \Bundler::FileUtils methods
2568
+ # that accept one or more keyword arguments:
2569
+ #
2570
+ # Bundler::FileUtils.commands.sort.take(3) # => ["cd", "chdir", "chmod"]
2571
+ #
2572
+ def self.commands
2573
+ OPT_TABLE.keys
2574
+ end
2575
+
2576
+ # Returns an array of the string keyword names:
2577
+ #
2578
+ # Bundler::FileUtils.options.take(3) # => ["noop", "verbose", "force"]
2579
+ #
2580
+ def self.options
2581
+ OPT_TABLE.values.flatten.uniq.map {|sym| sym.to_s }
2582
+ end
2583
+
2584
+ # Returns +true+ if method +mid+ accepts the given option +opt+, +false+ otherwise;
2585
+ # the arguments may be strings or symbols:
2586
+ #
2587
+ # Bundler::FileUtils.have_option?(:chmod, :noop) # => true
2588
+ # Bundler::FileUtils.have_option?('chmod', 'secure') # => false
2589
+ #
2590
+ def self.have_option?(mid, opt)
2591
+ li = OPT_TABLE[mid.to_s] or raise ArgumentError, "no such method: #{mid}"
2592
+ li.include?(opt)
2593
+ end
2594
+
2595
+ # Returns an array of the string keyword name for method +mid+;
2596
+ # the argument may be a string or a symbol:
2597
+ #
2598
+ # Bundler::FileUtils.options_of(:rm) # => ["force", "noop", "verbose"]
2599
+ # Bundler::FileUtils.options_of('mv') # => ["force", "noop", "verbose", "secure"]
2600
+ #
2601
+ def self.options_of(mid)
2602
+ OPT_TABLE[mid.to_s].map {|sym| sym.to_s }
2603
+ end
2604
+
2605
+ # Returns an array of the string method names of the methods
2606
+ # that accept the given keyword option +opt+;
2607
+ # the argument must be a symbol:
2608
+ #
2609
+ # Bundler::FileUtils.collect_method(:preserve) # => ["cp", "copy", "cp_r", "install"]
2610
+ #
2611
+ def self.collect_method(opt)
2612
+ OPT_TABLE.keys.select {|m| OPT_TABLE[m].include?(opt) }
2613
+ end
2614
+
2615
+ private
2616
+
2617
+ LOW_METHODS = singleton_methods(false) - collect_method(:noop).map(&:intern) # :nodoc:
2618
+ module LowMethods # :nodoc: internal use only
2619
+ private
2620
+ def _do_nothing(*)end
2621
+ ::Bundler::FileUtils::LOW_METHODS.map {|name| alias_method name, :_do_nothing}
2622
+ end
2623
+
2624
+ METHODS = singleton_methods() - [:private_module_function, # :nodoc:
2625
+ :commands, :options, :have_option?, :options_of, :collect_method]
2626
+
2627
+ #
2628
+ # This module has all methods of Bundler::FileUtils module, but it outputs messages
2629
+ # before acting. This equates to passing the <tt>:verbose</tt> flag to
2630
+ # methods in Bundler::FileUtils.
2631
+ #
2632
+ module Verbose
2633
+ include Bundler::FileUtils
2634
+ names = ::Bundler::FileUtils.collect_method(:verbose)
2635
+ names.each do |name|
2636
+ module_eval(<<-EOS, __FILE__, __LINE__ + 1)
2637
+ def #{name}(*args, **options)
2638
+ super(*args, **options, verbose: true)
2639
+ end
2640
+ EOS
2641
+ end
2642
+ private(*names)
2643
+ extend self
2644
+ class << self
2645
+ public(*::Bundler::FileUtils::METHODS)
2646
+ end
2647
+ end
2648
+
2649
+ #
2650
+ # This module has all methods of Bundler::FileUtils module, but never changes
2651
+ # files/directories. This equates to passing the <tt>:noop</tt> flag
2652
+ # to methods in Bundler::FileUtils.
2653
+ #
2654
+ module NoWrite
2655
+ include Bundler::FileUtils
2656
+ include LowMethods
2657
+ names = ::Bundler::FileUtils.collect_method(:noop)
2658
+ names.each do |name|
2659
+ module_eval(<<-EOS, __FILE__, __LINE__ + 1)
2660
+ def #{name}(*args, **options)
2661
+ super(*args, **options, noop: true)
2662
+ end
2663
+ EOS
2664
+ end
2665
+ private(*names)
2666
+ extend self
2667
+ class << self
2668
+ public(*::Bundler::FileUtils::METHODS)
2669
+ end
2670
+ end
2671
+
2672
+ #
2673
+ # This module has all methods of Bundler::FileUtils module, but never changes
2674
+ # files/directories, with printing message before acting.
2675
+ # This equates to passing the <tt>:noop</tt> and <tt>:verbose</tt> flag
2676
+ # to methods in Bundler::FileUtils.
2677
+ #
2678
+ module DryRun
2679
+ include Bundler::FileUtils
2680
+ include LowMethods
2681
+ names = ::Bundler::FileUtils.collect_method(:noop)
2682
+ names.each do |name|
2683
+ module_eval(<<-EOS, __FILE__, __LINE__ + 1)
2684
+ def #{name}(*args, **options)
2685
+ super(*args, **options, noop: true, verbose: true)
2686
+ end
2687
+ EOS
2688
+ end
2689
+ private(*names)
2690
+ extend self
2691
+ class << self
2692
+ public(*::Bundler::FileUtils::METHODS)
2693
+ end
2694
+ end
2695
+
2696
+ end