nano-pure-sys 0.0.1

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 (347) hide show
  1. checksums.yaml +7 -0
  2. data/bundler-4.0.15/CHANGELOG.md +5670 -0
  3. data/bundler-4.0.15/LICENSE.md +22 -0
  4. data/bundler-4.0.15/README.md +58 -0
  5. data/bundler-4.0.15/bundler.gemspec +46 -0
  6. data/bundler-4.0.15/exe/bundle +29 -0
  7. data/bundler-4.0.15/exe/bundler +4 -0
  8. data/bundler-4.0.15/lib/bundler/build_metadata.rb +44 -0
  9. data/bundler-4.0.15/lib/bundler/capistrano.rb +4 -0
  10. data/bundler-4.0.15/lib/bundler/checksum.rb +270 -0
  11. data/bundler-4.0.15/lib/bundler/ci_detector.rb +75 -0
  12. data/bundler-4.0.15/lib/bundler/cli/add.rb +62 -0
  13. data/bundler-4.0.15/lib/bundler/cli/binstubs.rb +57 -0
  14. data/bundler-4.0.15/lib/bundler/cli/cache.rb +32 -0
  15. data/bundler-4.0.15/lib/bundler/cli/check.rb +40 -0
  16. data/bundler-4.0.15/lib/bundler/cli/clean.rb +25 -0
  17. data/bundler-4.0.15/lib/bundler/cli/common.rb +161 -0
  18. data/bundler-4.0.15/lib/bundler/cli/config.rb +208 -0
  19. data/bundler-4.0.15/lib/bundler/cli/console.rb +47 -0
  20. data/bundler-4.0.15/lib/bundler/cli/doctor/diagnose.rb +167 -0
  21. data/bundler-4.0.15/lib/bundler/cli/doctor/ssl.rb +249 -0
  22. data/bundler-4.0.15/lib/bundler/cli/doctor.rb +33 -0
  23. data/bundler-4.0.15/lib/bundler/cli/exec.rb +114 -0
  24. data/bundler-4.0.15/lib/bundler/cli/fund.rb +36 -0
  25. data/bundler-4.0.15/lib/bundler/cli/gem.rb +493 -0
  26. data/bundler-4.0.15/lib/bundler/cli/info.rb +83 -0
  27. data/bundler-4.0.15/lib/bundler/cli/init.rb +51 -0
  28. data/bundler-4.0.15/lib/bundler/cli/install.rb +127 -0
  29. data/bundler-4.0.15/lib/bundler/cli/issue.rb +41 -0
  30. data/bundler-4.0.15/lib/bundler/cli/list.rb +97 -0
  31. data/bundler-4.0.15/lib/bundler/cli/lock.rb +94 -0
  32. data/bundler-4.0.15/lib/bundler/cli/open.rb +29 -0
  33. data/bundler-4.0.15/lib/bundler/cli/outdated.rb +337 -0
  34. data/bundler-4.0.15/lib/bundler/cli/platform.rb +48 -0
  35. data/bundler-4.0.15/lib/bundler/cli/plugin.rb +39 -0
  36. data/bundler-4.0.15/lib/bundler/cli/pristine.rb +64 -0
  37. data/bundler-4.0.15/lib/bundler/cli/remove.rb +17 -0
  38. data/bundler-4.0.15/lib/bundler/cli/show.rb +71 -0
  39. data/bundler-4.0.15/lib/bundler/cli/update.rb +125 -0
  40. data/bundler-4.0.15/lib/bundler/cli.rb +829 -0
  41. data/bundler-4.0.15/lib/bundler/compact_index_client/cache.rb +96 -0
  42. data/bundler-4.0.15/lib/bundler/compact_index_client/cache_file.rb +148 -0
  43. data/bundler-4.0.15/lib/bundler/compact_index_client/parser.rb +87 -0
  44. data/bundler-4.0.15/lib/bundler/compact_index_client/updater.rb +105 -0
  45. data/bundler-4.0.15/lib/bundler/compact_index_client.rb +92 -0
  46. data/bundler-4.0.15/lib/bundler/constants.rb +14 -0
  47. data/bundler-4.0.15/lib/bundler/current_ruby.rb +94 -0
  48. data/bundler-4.0.15/lib/bundler/definition.rb +1304 -0
  49. data/bundler-4.0.15/lib/bundler/dependency.rb +151 -0
  50. data/bundler-4.0.15/lib/bundler/deployment.rb +6 -0
  51. data/bundler-4.0.15/lib/bundler/deprecate.rb +44 -0
  52. data/bundler-4.0.15/lib/bundler/digest.rb +71 -0
  53. data/bundler-4.0.15/lib/bundler/dsl.rb +642 -0
  54. data/bundler-4.0.15/lib/bundler/endpoint_specification.rb +184 -0
  55. data/bundler-4.0.15/lib/bundler/env.rb +148 -0
  56. data/bundler-4.0.15/lib/bundler/environment_preserver.rb +69 -0
  57. data/bundler-4.0.15/lib/bundler/errors.rb +277 -0
  58. data/bundler-4.0.15/lib/bundler/feature_flag.rb +20 -0
  59. data/bundler-4.0.15/lib/bundler/fetcher/base.rb +55 -0
  60. data/bundler-4.0.15/lib/bundler/fetcher/compact_index.rb +133 -0
  61. data/bundler-4.0.15/lib/bundler/fetcher/dependency.rb +85 -0
  62. data/bundler-4.0.15/lib/bundler/fetcher/downloader.rb +116 -0
  63. data/bundler-4.0.15/lib/bundler/fetcher/gem_remote_fetcher.rb +24 -0
  64. data/bundler-4.0.15/lib/bundler/fetcher/index.rb +25 -0
  65. data/bundler-4.0.15/lib/bundler/fetcher.rb +365 -0
  66. data/bundler-4.0.15/lib/bundler/force_platform.rb +16 -0
  67. data/bundler-4.0.15/lib/bundler/friendly_errors.rb +127 -0
  68. data/bundler-4.0.15/lib/bundler/gem_helper.rb +237 -0
  69. data/bundler-4.0.15/lib/bundler/gem_tasks.rb +7 -0
  70. data/bundler-4.0.15/lib/bundler/gem_version_promoter.rb +147 -0
  71. data/bundler-4.0.15/lib/bundler/index.rb +203 -0
  72. data/bundler-4.0.15/lib/bundler/injector.rb +284 -0
  73. data/bundler-4.0.15/lib/bundler/inline.rb +106 -0
  74. data/bundler-4.0.15/lib/bundler/installer/gem_installer.rb +88 -0
  75. data/bundler-4.0.15/lib/bundler/installer/parallel_installer.rb +280 -0
  76. data/bundler-4.0.15/lib/bundler/installer/standalone.rb +113 -0
  77. data/bundler-4.0.15/lib/bundler/installer.rb +241 -0
  78. data/bundler-4.0.15/lib/bundler/lazy_specification.rb +270 -0
  79. data/bundler-4.0.15/lib/bundler/lockfile_generator.rb +119 -0
  80. data/bundler-4.0.15/lib/bundler/lockfile_parser.rb +328 -0
  81. data/bundler-4.0.15/lib/bundler/man/bundle-add.1 +79 -0
  82. data/bundler-4.0.15/lib/bundler/man/bundle-add.1.ronn +92 -0
  83. data/bundler-4.0.15/lib/bundler/man/bundle-binstubs.1 +30 -0
  84. data/bundler-4.0.15/lib/bundler/man/bundle-binstubs.1.ronn +42 -0
  85. data/bundler-4.0.15/lib/bundler/man/bundle-cache.1 +56 -0
  86. data/bundler-4.0.15/lib/bundler/man/bundle-cache.1.ronn +95 -0
  87. data/bundler-4.0.15/lib/bundler/man/bundle-check.1 +21 -0
  88. data/bundler-4.0.15/lib/bundler/man/bundle-check.1.ronn +26 -0
  89. data/bundler-4.0.15/lib/bundler/man/bundle-clean.1 +17 -0
  90. data/bundler-4.0.15/lib/bundler/man/bundle-clean.1.ronn +18 -0
  91. data/bundler-4.0.15/lib/bundler/man/bundle-config.1 +339 -0
  92. data/bundler-4.0.15/lib/bundler/man/bundle-config.1.ronn +455 -0
  93. data/bundler-4.0.15/lib/bundler/man/bundle-console.1 +33 -0
  94. data/bundler-4.0.15/lib/bundler/man/bundle-console.1.ronn +39 -0
  95. data/bundler-4.0.15/lib/bundler/man/bundle-doctor.1 +69 -0
  96. data/bundler-4.0.15/lib/bundler/man/bundle-doctor.1.ronn +77 -0
  97. data/bundler-4.0.15/lib/bundler/man/bundle-env.1 +9 -0
  98. data/bundler-4.0.15/lib/bundler/man/bundle-env.1.ronn +10 -0
  99. data/bundler-4.0.15/lib/bundler/man/bundle-exec.1 +104 -0
  100. data/bundler-4.0.15/lib/bundler/man/bundle-exec.1.ronn +150 -0
  101. data/bundler-4.0.15/lib/bundler/man/bundle-fund.1 +22 -0
  102. data/bundler-4.0.15/lib/bundler/man/bundle-fund.1.ronn +25 -0
  103. data/bundler-4.0.15/lib/bundler/man/bundle-gem.1 +107 -0
  104. data/bundler-4.0.15/lib/bundler/man/bundle-gem.1.ronn +150 -0
  105. data/bundler-4.0.15/lib/bundler/man/bundle-help.1 +9 -0
  106. data/bundler-4.0.15/lib/bundler/man/bundle-help.1.ronn +12 -0
  107. data/bundler-4.0.15/lib/bundler/man/bundle-info.1 +17 -0
  108. data/bundler-4.0.15/lib/bundler/man/bundle-info.1.ronn +21 -0
  109. data/bundler-4.0.15/lib/bundler/man/bundle-init.1 +20 -0
  110. data/bundler-4.0.15/lib/bundler/man/bundle-init.1.ronn +32 -0
  111. data/bundler-4.0.15/lib/bundler/man/bundle-install.1 +178 -0
  112. data/bundler-4.0.15/lib/bundler/man/bundle-install.1.ronn +314 -0
  113. data/bundler-4.0.15/lib/bundler/man/bundle-issue.1 +45 -0
  114. data/bundler-4.0.15/lib/bundler/man/bundle-issue.1.ronn +37 -0
  115. data/bundler-4.0.15/lib/bundler/man/bundle-licenses.1 +9 -0
  116. data/bundler-4.0.15/lib/bundler/man/bundle-licenses.1.ronn +10 -0
  117. data/bundler-4.0.15/lib/bundler/man/bundle-list.1 +40 -0
  118. data/bundler-4.0.15/lib/bundler/man/bundle-list.1.ronn +41 -0
  119. data/bundler-4.0.15/lib/bundler/man/bundle-lock.1 +75 -0
  120. data/bundler-4.0.15/lib/bundler/man/bundle-lock.1.ronn +115 -0
  121. data/bundler-4.0.15/lib/bundler/man/bundle-open.1 +32 -0
  122. data/bundler-4.0.15/lib/bundler/man/bundle-open.1.ronn +28 -0
  123. data/bundler-4.0.15/lib/bundler/man/bundle-outdated.1 +106 -0
  124. data/bundler-4.0.15/lib/bundler/man/bundle-outdated.1.ronn +117 -0
  125. data/bundler-4.0.15/lib/bundler/man/bundle-platform.1 +49 -0
  126. data/bundler-4.0.15/lib/bundler/man/bundle-platform.1.ronn +49 -0
  127. data/bundler-4.0.15/lib/bundler/man/bundle-plugin.1 +76 -0
  128. data/bundler-4.0.15/lib/bundler/man/bundle-plugin.1.ronn +84 -0
  129. data/bundler-4.0.15/lib/bundler/man/bundle-pristine.1 +23 -0
  130. data/bundler-4.0.15/lib/bundler/man/bundle-pristine.1.ronn +34 -0
  131. data/bundler-4.0.15/lib/bundler/man/bundle-remove.1 +15 -0
  132. data/bundler-4.0.15/lib/bundler/man/bundle-remove.1.ronn +16 -0
  133. data/bundler-4.0.15/lib/bundler/man/bundle-show.1 +16 -0
  134. data/bundler-4.0.15/lib/bundler/man/bundle-show.1.ronn +21 -0
  135. data/bundler-4.0.15/lib/bundler/man/bundle-update.1 +284 -0
  136. data/bundler-4.0.15/lib/bundler/man/bundle-update.1.ronn +367 -0
  137. data/bundler-4.0.15/lib/bundler/man/bundle-version.1 +22 -0
  138. data/bundler-4.0.15/lib/bundler/man/bundle-version.1.ronn +24 -0
  139. data/bundler-4.0.15/lib/bundler/man/bundle.1 +93 -0
  140. data/bundler-4.0.15/lib/bundler/man/bundle.1.ronn +107 -0
  141. data/bundler-4.0.15/lib/bundler/man/gemfile.5 +503 -0
  142. data/bundler-4.0.15/lib/bundler/man/gemfile.5.ronn +586 -0
  143. data/bundler-4.0.15/lib/bundler/man/index.txt +31 -0
  144. data/bundler-4.0.15/lib/bundler/match_metadata.rb +30 -0
  145. data/bundler-4.0.15/lib/bundler/match_platform.rb +42 -0
  146. data/bundler-4.0.15/lib/bundler/match_remote_metadata.rb +29 -0
  147. data/bundler-4.0.15/lib/bundler/materialization.rb +59 -0
  148. data/bundler-4.0.15/lib/bundler/mirror.rb +221 -0
  149. data/bundler-4.0.15/lib/bundler/plugin/api/source.rb +330 -0
  150. data/bundler-4.0.15/lib/bundler/plugin/api.rb +81 -0
  151. data/bundler-4.0.15/lib/bundler/plugin/dsl.rb +53 -0
  152. data/bundler-4.0.15/lib/bundler/plugin/events.rb +85 -0
  153. data/bundler-4.0.15/lib/bundler/plugin/index.rb +203 -0
  154. data/bundler-4.0.15/lib/bundler/plugin/installer/git.rb +34 -0
  155. data/bundler-4.0.15/lib/bundler/plugin/installer/path.rb +26 -0
  156. data/bundler-4.0.15/lib/bundler/plugin/installer/rubygems.rb +19 -0
  157. data/bundler-4.0.15/lib/bundler/plugin/installer.rb +123 -0
  158. data/bundler-4.0.15/lib/bundler/plugin/source_list.rb +31 -0
  159. data/bundler-4.0.15/lib/bundler/plugin/unloaded_source.rb +25 -0
  160. data/bundler-4.0.15/lib/bundler/plugin.rb +387 -0
  161. data/bundler-4.0.15/lib/bundler/process_lock.rb +20 -0
  162. data/bundler-4.0.15/lib/bundler/remote_specification.rb +126 -0
  163. data/bundler-4.0.15/lib/bundler/resolver/base.rb +127 -0
  164. data/bundler-4.0.15/lib/bundler/resolver/candidate.rb +85 -0
  165. data/bundler-4.0.15/lib/bundler/resolver/incompatibility.rb +15 -0
  166. data/bundler-4.0.15/lib/bundler/resolver/package.rb +95 -0
  167. data/bundler-4.0.15/lib/bundler/resolver/root.rb +25 -0
  168. data/bundler-4.0.15/lib/bundler/resolver/spec_group.rb +74 -0
  169. data/bundler-4.0.15/lib/bundler/resolver/strategy.rb +43 -0
  170. data/bundler-4.0.15/lib/bundler/resolver.rb +603 -0
  171. data/bundler-4.0.15/lib/bundler/retry.rb +92 -0
  172. data/bundler-4.0.15/lib/bundler/ruby_dsl.rb +67 -0
  173. data/bundler-4.0.15/lib/bundler/ruby_version.rb +135 -0
  174. data/bundler-4.0.15/lib/bundler/rubygems_ext.rb +503 -0
  175. data/bundler-4.0.15/lib/bundler/rubygems_gem_installer.rb +206 -0
  176. data/bundler-4.0.15/lib/bundler/rubygems_integration.rb +456 -0
  177. data/bundler-4.0.15/lib/bundler/runtime.rb +331 -0
  178. data/bundler-4.0.15/lib/bundler/safe_marshal.rb +31 -0
  179. data/bundler-4.0.15/lib/bundler/self_manager.rb +197 -0
  180. data/bundler-4.0.15/lib/bundler/settings/validator.rb +86 -0
  181. data/bundler-4.0.15/lib/bundler/settings.rb +585 -0
  182. data/bundler-4.0.15/lib/bundler/setup.rb +39 -0
  183. data/bundler-4.0.15/lib/bundler/shared_helpers.rb +392 -0
  184. data/bundler-4.0.15/lib/bundler/source/gemspec.rb +19 -0
  185. data/bundler-4.0.15/lib/bundler/source/git/git_proxy.rb +509 -0
  186. data/bundler-4.0.15/lib/bundler/source/git.rb +451 -0
  187. data/bundler-4.0.15/lib/bundler/source/metadata.rb +67 -0
  188. data/bundler-4.0.15/lib/bundler/source/path/installer.rb +53 -0
  189. data/bundler-4.0.15/lib/bundler/source/path.rb +256 -0
  190. data/bundler-4.0.15/lib/bundler/source/rubygems/remote.rb +86 -0
  191. data/bundler-4.0.15/lib/bundler/source/rubygems.rb +606 -0
  192. data/bundler-4.0.15/lib/bundler/source/rubygems_aggregate.rb +71 -0
  193. data/bundler-4.0.15/lib/bundler/source.rb +120 -0
  194. data/bundler-4.0.15/lib/bundler/source_list.rb +240 -0
  195. data/bundler-4.0.15/lib/bundler/source_map.rb +72 -0
  196. data/bundler-4.0.15/lib/bundler/spec_set.rb +390 -0
  197. data/bundler-4.0.15/lib/bundler/stub_specification.rb +147 -0
  198. data/bundler-4.0.15/lib/bundler/templates/Executable +16 -0
  199. data/bundler-4.0.15/lib/bundler/templates/Executable.standalone +14 -0
  200. data/bundler-4.0.15/lib/bundler/templates/Gemfile +5 -0
  201. data/bundler-4.0.15/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
  202. data/bundler-4.0.15/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +10 -0
  203. data/bundler-4.0.15/lib/bundler/templates/newgem/Cargo.toml.tt +13 -0
  204. data/bundler-4.0.15/lib/bundler/templates/newgem/Gemfile.tt +24 -0
  205. data/bundler-4.0.15/lib/bundler/templates/newgem/LICENSE.txt.tt +21 -0
  206. data/bundler-4.0.15/lib/bundler/templates/newgem/README.md.tt +49 -0
  207. data/bundler-4.0.15/lib/bundler/templates/newgem/Rakefile.tt +72 -0
  208. data/bundler-4.0.15/lib/bundler/templates/newgem/bin/console.tt +11 -0
  209. data/bundler-4.0.15/lib/bundler/templates/newgem/bin/setup.tt +8 -0
  210. data/bundler-4.0.15/lib/bundler/templates/newgem/circleci/config.yml.tt +37 -0
  211. data/bundler-4.0.15/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
  212. data/bundler-4.0.15/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +22 -0
  213. data/bundler-4.0.15/lib/bundler/templates/newgem/ext/newgem/build.rs.tt +5 -0
  214. data/bundler-4.0.15/lib/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt +10 -0
  215. data/bundler-4.0.15/lib/bundler/templates/newgem/ext/newgem/extconf-go.rb.tt +11 -0
  216. data/bundler-4.0.15/lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
  217. data/bundler-4.0.15/lib/bundler/templates/newgem/ext/newgem/go.mod.tt +5 -0
  218. data/bundler-4.0.15/lib/bundler/templates/newgem/ext/newgem/newgem-go.c.tt +2 -0
  219. data/bundler-4.0.15/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +9 -0
  220. data/bundler-4.0.15/lib/bundler/templates/newgem/ext/newgem/newgem.go.tt +31 -0
  221. data/bundler-4.0.15/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +6 -0
  222. data/bundler-4.0.15/lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +23 -0
  223. data/bundler-4.0.15/lib/bundler/templates/newgem/github/workflows/build-gems.yml.tt +69 -0
  224. data/bundler-4.0.15/lib/bundler/templates/newgem/github/workflows/main.yml.tt +48 -0
  225. data/bundler-4.0.15/lib/bundler/templates/newgem/gitignore.tt +23 -0
  226. data/bundler-4.0.15/lib/bundler/templates/newgem/gitlab-ci.yml.tt +27 -0
  227. data/bundler-4.0.15/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +9 -0
  228. data/bundler-4.0.15/lib/bundler/templates/newgem/lib/newgem.rb.tt +15 -0
  229. data/bundler-4.0.15/lib/bundler/templates/newgem/newgem.gemspec.tt +58 -0
  230. data/bundler-4.0.15/lib/bundler/templates/newgem/rspec.tt +3 -0
  231. data/bundler-4.0.15/lib/bundler/templates/newgem/rubocop.yml.tt +8 -0
  232. data/bundler-4.0.15/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
  233. data/bundler-4.0.15/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +19 -0
  234. data/bundler-4.0.15/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +15 -0
  235. data/bundler-4.0.15/lib/bundler/templates/newgem/standard.yml.tt +3 -0
  236. data/bundler-4.0.15/lib/bundler/templates/newgem/test/minitest/test_helper.rb.tt +6 -0
  237. data/bundler-4.0.15/lib/bundler/templates/newgem/test/minitest/test_newgem.rb.tt +19 -0
  238. data/bundler-4.0.15/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
  239. data/bundler-4.0.15/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
  240. data/bundler-4.0.15/lib/bundler/ui/rg_proxy.rb +19 -0
  241. data/bundler-4.0.15/lib/bundler/ui/shell.rb +191 -0
  242. data/bundler-4.0.15/lib/bundler/ui/silent.rb +96 -0
  243. data/bundler-4.0.15/lib/bundler/ui.rb +9 -0
  244. data/bundler-4.0.15/lib/bundler/uri_credentials_filter.rb +43 -0
  245. data/bundler-4.0.15/lib/bundler/uri_normalizer.rb +23 -0
  246. data/bundler-4.0.15/lib/bundler/vendor/connection_pool/LICENSE +20 -0
  247. data/bundler-4.0.15/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +227 -0
  248. data/bundler-4.0.15/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
  249. data/bundler-4.0.15/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +56 -0
  250. data/bundler-4.0.15/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +230 -0
  251. data/bundler-4.0.15/lib/bundler/vendor/fileutils/COPYING +56 -0
  252. data/bundler-4.0.15/lib/bundler/vendor/fileutils/lib/fileutils.rb +2701 -0
  253. data/bundler-4.0.15/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
  254. data/bundler-4.0.15/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +41 -0
  255. data/bundler-4.0.15/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +65 -0
  256. data/bundler-4.0.15/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +80 -0
  257. data/bundler-4.0.15/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1153 -0
  258. data/bundler-4.0.15/lib/bundler/vendor/pub_grub/LICENSE.txt +21 -0
  259. data/bundler-4.0.15/lib/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
  260. data/bundler-4.0.15/lib/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +169 -0
  261. data/bundler-4.0.15/lib/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
  262. data/bundler-4.0.15/lib/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +150 -0
  263. data/bundler-4.0.15/lib/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
  264. data/bundler-4.0.15/lib/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
  265. data/bundler-4.0.15/lib/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
  266. data/bundler-4.0.15/lib/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
  267. data/bundler-4.0.15/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +61 -0
  268. data/bundler-4.0.15/lib/bundler/vendor/pub_grub/lib/pub_grub/strategy.rb +42 -0
  269. data/bundler-4.0.15/lib/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
  270. data/bundler-4.0.15/lib/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
  271. data/bundler-4.0.15/lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +129 -0
  272. data/bundler-4.0.15/lib/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +423 -0
  273. data/bundler-4.0.15/lib/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +236 -0
  274. data/bundler-4.0.15/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +178 -0
  275. data/bundler-4.0.15/lib/bundler/vendor/pub_grub/lib/pub_grub.rb +31 -0
  276. data/bundler-4.0.15/lib/bundler/vendor/securerandom/COPYING +56 -0
  277. data/bundler-4.0.15/lib/bundler/vendor/securerandom/lib/securerandom.rb +102 -0
  278. data/bundler-4.0.15/lib/bundler/vendor/thor/LICENSE.md +20 -0
  279. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +105 -0
  280. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +61 -0
  281. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +108 -0
  282. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +143 -0
  283. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +407 -0
  284. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +130 -0
  285. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/actions.rb +340 -0
  286. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/base.rb +825 -0
  287. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/command.rb +151 -0
  288. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +107 -0
  289. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/error.rb +106 -0
  290. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/group.rb +292 -0
  291. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/invocation.rb +178 -0
  292. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +37 -0
  293. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +88 -0
  294. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/line_editor.rb +17 -0
  295. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
  296. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +86 -0
  297. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +195 -0
  298. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/parser/option.rb +178 -0
  299. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/parser/options.rb +294 -0
  300. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -0
  301. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +72 -0
  302. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/runner.rb +335 -0
  303. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +384 -0
  304. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/shell/color.rb +112 -0
  305. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/shell/column_printer.rb +29 -0
  306. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/shell/html.rb +81 -0
  307. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +118 -0
  308. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/shell/terminal.rb +42 -0
  309. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb +38 -0
  310. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/shell.rb +81 -0
  311. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/util.rb +285 -0
  312. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor/version.rb +3 -0
  313. data/bundler-4.0.15/lib/bundler/vendor/thor/lib/thor.rb +674 -0
  314. data/bundler-4.0.15/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
  315. data/bundler-4.0.15/lib/bundler/vendor/tsort/lib/tsort.rb +455 -0
  316. data/bundler-4.0.15/lib/bundler/vendor/uri/COPYING +56 -0
  317. data/bundler-4.0.15/lib/bundler/vendor/uri/lib/uri/common.rb +922 -0
  318. data/bundler-4.0.15/lib/bundler/vendor/uri/lib/uri/file.rb +100 -0
  319. data/bundler-4.0.15/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
  320. data/bundler-4.0.15/lib/bundler/vendor/uri/lib/uri/generic.rb +1592 -0
  321. data/bundler-4.0.15/lib/bundler/vendor/uri/lib/uri/http.rb +137 -0
  322. data/bundler-4.0.15/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
  323. data/bundler-4.0.15/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
  324. data/bundler-4.0.15/lib/bundler/vendor/uri/lib/uri/ldaps.rb +22 -0
  325. data/bundler-4.0.15/lib/bundler/vendor/uri/lib/uri/mailto.rb +293 -0
  326. data/bundler-4.0.15/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +547 -0
  327. data/bundler-4.0.15/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +206 -0
  328. data/bundler-4.0.15/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
  329. data/bundler-4.0.15/lib/bundler/vendor/uri/lib/uri/ws.rb +83 -0
  330. data/bundler-4.0.15/lib/bundler/vendor/uri/lib/uri/wss.rb +23 -0
  331. data/bundler-4.0.15/lib/bundler/vendor/uri/lib/uri.rb +104 -0
  332. data/bundler-4.0.15/lib/bundler/vendored_fileutils.rb +4 -0
  333. data/bundler-4.0.15/lib/bundler/vendored_net_http.rb +23 -0
  334. data/bundler-4.0.15/lib/bundler/vendored_persistent.rb +11 -0
  335. data/bundler-4.0.15/lib/bundler/vendored_pub_grub.rb +4 -0
  336. data/bundler-4.0.15/lib/bundler/vendored_securerandom.rb +12 -0
  337. data/bundler-4.0.15/lib/bundler/vendored_thor.rb +8 -0
  338. data/bundler-4.0.15/lib/bundler/vendored_timeout.rb +12 -0
  339. data/bundler-4.0.15/lib/bundler/vendored_tsort.rb +4 -0
  340. data/bundler-4.0.15/lib/bundler/vendored_uri.rb +21 -0
  341. data/bundler-4.0.15/lib/bundler/version.rb +21 -0
  342. data/bundler-4.0.15/lib/bundler/vlad.rb +4 -0
  343. data/bundler-4.0.15/lib/bundler/worker.rb +125 -0
  344. data/bundler-4.0.15/lib/bundler/yaml_serializer.rb +98 -0
  345. data/bundler-4.0.15/lib/bundler.rb +691 -0
  346. data/nano-pure-sys.gemspec +11 -0
  347. metadata +385 -0
@@ -0,0 +1,547 @@
1
+ # frozen_string_literal: false
2
+ #--
3
+ # = uri/common.rb
4
+ #
5
+ # Author:: Akira Yamada <akira@ruby-lang.org>
6
+ # License::
7
+ # You can redistribute it and/or modify it under the same term as Ruby.
8
+ #
9
+ # See Bundler::URI for general documentation
10
+ #
11
+
12
+ module Bundler::URI
13
+ #
14
+ # Includes Bundler::URI::REGEXP::PATTERN
15
+ #
16
+ module RFC2396_REGEXP
17
+ #
18
+ # Patterns used to parse Bundler::URI's
19
+ #
20
+ module PATTERN
21
+ # :stopdoc:
22
+
23
+ # RFC 2396 (Bundler::URI Generic Syntax)
24
+ # RFC 2732 (IPv6 Literal Addresses in URL's)
25
+ # RFC 2373 (IPv6 Addressing Architecture)
26
+
27
+ # alpha = lowalpha | upalpha
28
+ ALPHA = "a-zA-Z"
29
+ # alphanum = alpha | digit
30
+ ALNUM = "#{ALPHA}\\d"
31
+
32
+ # hex = digit | "A" | "B" | "C" | "D" | "E" | "F" |
33
+ # "a" | "b" | "c" | "d" | "e" | "f"
34
+ HEX = "a-fA-F\\d"
35
+ # escaped = "%" hex hex
36
+ ESCAPED = "%[#{HEX}]{2}"
37
+ # mark = "-" | "_" | "." | "!" | "~" | "*" | "'" |
38
+ # "(" | ")"
39
+ # unreserved = alphanum | mark
40
+ UNRESERVED = "\\-_.!~*'()#{ALNUM}"
41
+ # reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
42
+ # "$" | ","
43
+ # reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
44
+ # "$" | "," | "[" | "]" (RFC 2732)
45
+ RESERVED = ";/?:@&=+$,\\[\\]"
46
+
47
+ # domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum
48
+ DOMLABEL = "(?:[#{ALNUM}](?:[-#{ALNUM}]*[#{ALNUM}])?)"
49
+ # toplabel = alpha | alpha *( alphanum | "-" ) alphanum
50
+ TOPLABEL = "(?:[#{ALPHA}](?:[-#{ALNUM}]*[#{ALNUM}])?)"
51
+ # hostname = *( domainlabel "." ) toplabel [ "." ]
52
+ HOSTNAME = "(?:#{DOMLABEL}\\.)*#{TOPLABEL}\\.?"
53
+
54
+ # :startdoc:
55
+ end # PATTERN
56
+
57
+ # :startdoc:
58
+ end # REGEXP
59
+
60
+ # Class that parses String's into Bundler::URI's.
61
+ #
62
+ # It contains a Hash set of patterns and Regexp's that match and validate.
63
+ #
64
+ class RFC2396_Parser
65
+ include RFC2396_REGEXP
66
+
67
+ #
68
+ # == Synopsis
69
+ #
70
+ # Bundler::URI::RFC2396_Parser.new([opts])
71
+ #
72
+ # == Args
73
+ #
74
+ # The constructor accepts a hash as options for parser.
75
+ # Keys of options are pattern names of Bundler::URI components
76
+ # and values of options are pattern strings.
77
+ # The constructor generates set of regexps for parsing URIs.
78
+ #
79
+ # You can use the following keys:
80
+ #
81
+ # * :ESCAPED (Bundler::URI::PATTERN::ESCAPED in default)
82
+ # * :UNRESERVED (Bundler::URI::PATTERN::UNRESERVED in default)
83
+ # * :DOMLABEL (Bundler::URI::PATTERN::DOMLABEL in default)
84
+ # * :TOPLABEL (Bundler::URI::PATTERN::TOPLABEL in default)
85
+ # * :HOSTNAME (Bundler::URI::PATTERN::HOSTNAME in default)
86
+ #
87
+ # == Examples
88
+ #
89
+ # p = Bundler::URI::RFC2396_Parser.new(:ESCAPED => "(?:%[a-fA-F0-9]{2}|%u[a-fA-F0-9]{4})")
90
+ # u = p.parse("http://example.jp/%uABCD") #=> #<Bundler::URI::HTTP http://example.jp/%uABCD>
91
+ # Bundler::URI.parse(u.to_s) #=> raises Bundler::URI::InvalidURIError
92
+ #
93
+ # s = "http://example.com/ABCD"
94
+ # u1 = p.parse(s) #=> #<Bundler::URI::HTTP http://example.com/ABCD>
95
+ # u2 = Bundler::URI.parse(s) #=> #<Bundler::URI::HTTP http://example.com/ABCD>
96
+ # u1 == u2 #=> true
97
+ # u1.eql?(u2) #=> false
98
+ #
99
+ def initialize(opts = {})
100
+ @pattern = initialize_pattern(opts)
101
+ @pattern.each_value(&:freeze)
102
+ @pattern.freeze
103
+
104
+ @regexp = initialize_regexp(@pattern)
105
+ @regexp.each_value(&:freeze)
106
+ @regexp.freeze
107
+ end
108
+
109
+ # The Hash of patterns.
110
+ #
111
+ # See also #initialize_pattern.
112
+ attr_reader :pattern
113
+
114
+ # The Hash of Regexp.
115
+ #
116
+ # See also #initialize_regexp.
117
+ attr_reader :regexp
118
+
119
+ # Returns a split Bundler::URI against +regexp[:ABS_URI]+.
120
+ def split(uri)
121
+ case uri
122
+ when ''
123
+ # null uri
124
+
125
+ when @regexp[:ABS_URI]
126
+ scheme, opaque, userinfo, host, port,
127
+ registry, path, query, fragment = $~[1..-1]
128
+
129
+ # Bundler::URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
130
+
131
+ # absoluteURI = scheme ":" ( hier_part | opaque_part )
132
+ # hier_part = ( net_path | abs_path ) [ "?" query ]
133
+ # opaque_part = uric_no_slash *uric
134
+
135
+ # abs_path = "/" path_segments
136
+ # net_path = "//" authority [ abs_path ]
137
+
138
+ # authority = server | reg_name
139
+ # server = [ [ userinfo "@" ] hostport ]
140
+
141
+ if !scheme
142
+ raise InvalidURIError,
143
+ "bad Bundler::URI (absolute but no scheme): #{uri}"
144
+ end
145
+ if !opaque && (!path && (!host && !registry))
146
+ raise InvalidURIError,
147
+ "bad Bundler::URI (absolute but no path): #{uri}"
148
+ end
149
+
150
+ when @regexp[:REL_URI]
151
+ scheme = nil
152
+ opaque = nil
153
+
154
+ userinfo, host, port, registry,
155
+ rel_segment, abs_path, query, fragment = $~[1..-1]
156
+ if rel_segment && abs_path
157
+ path = rel_segment + abs_path
158
+ elsif rel_segment
159
+ path = rel_segment
160
+ elsif abs_path
161
+ path = abs_path
162
+ end
163
+
164
+ # Bundler::URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
165
+
166
+ # relativeURI = ( net_path | abs_path | rel_path ) [ "?" query ]
167
+
168
+ # net_path = "//" authority [ abs_path ]
169
+ # abs_path = "/" path_segments
170
+ # rel_path = rel_segment [ abs_path ]
171
+
172
+ # authority = server | reg_name
173
+ # server = [ [ userinfo "@" ] hostport ]
174
+
175
+ else
176
+ raise InvalidURIError, "bad Bundler::URI (is not Bundler::URI?): #{uri}"
177
+ end
178
+
179
+ path = '' if !path && !opaque # (see RFC2396 Section 5.2)
180
+ ret = [
181
+ scheme,
182
+ userinfo, host, port, # X
183
+ registry, # X
184
+ path, # Y
185
+ opaque, # Y
186
+ query,
187
+ fragment
188
+ ]
189
+ return ret
190
+ end
191
+
192
+ #
193
+ # == Args
194
+ #
195
+ # +uri+::
196
+ # String
197
+ #
198
+ # == Description
199
+ #
200
+ # Parses +uri+ and constructs either matching Bundler::URI scheme object
201
+ # (File, FTP, HTTP, HTTPS, LDAP, LDAPS, or MailTo) or Bundler::URI::Generic.
202
+ #
203
+ # == Usage
204
+ #
205
+ # Bundler::URI::RFC2396_PARSER.parse("ldap://ldap.example.com/dc=example?user=john")
206
+ # #=> #<Bundler::URI::LDAP ldap://ldap.example.com/dc=example?user=john>
207
+ #
208
+ def parse(uri)
209
+ Bundler::URI.for(*self.split(uri), self)
210
+ end
211
+
212
+ #
213
+ # == Args
214
+ #
215
+ # +uris+::
216
+ # an Array of Strings
217
+ #
218
+ # == Description
219
+ #
220
+ # Attempts to parse and merge a set of URIs.
221
+ #
222
+ def join(*uris)
223
+ uris[0] = convert_to_uri(uris[0])
224
+ uris.inject :merge
225
+ end
226
+
227
+ #
228
+ # :call-seq:
229
+ # extract( str )
230
+ # extract( str, schemes )
231
+ # extract( str, schemes ) {|item| block }
232
+ #
233
+ # == Args
234
+ #
235
+ # +str+::
236
+ # String to search
237
+ # +schemes+::
238
+ # Patterns to apply to +str+
239
+ #
240
+ # == Description
241
+ #
242
+ # Attempts to parse and merge a set of URIs.
243
+ # If no +block+ given, then returns the result,
244
+ # else it calls +block+ for each element in result.
245
+ #
246
+ # See also #make_regexp.
247
+ #
248
+ def extract(str, schemes = nil)
249
+ if block_given?
250
+ str.scan(make_regexp(schemes)) { yield $& }
251
+ nil
252
+ else
253
+ result = []
254
+ str.scan(make_regexp(schemes)) { result.push $& }
255
+ result
256
+ end
257
+ end
258
+
259
+ # Returns Regexp that is default +self.regexp[:ABS_URI_REF]+,
260
+ # unless +schemes+ is provided. Then it is a Regexp.union with +self.pattern[:X_ABS_URI]+.
261
+ def make_regexp(schemes = nil)
262
+ unless schemes
263
+ @regexp[:ABS_URI_REF]
264
+ else
265
+ /(?=(?i:#{Regexp.union(*schemes).source}):)#{@pattern[:X_ABS_URI]}/x
266
+ end
267
+ end
268
+
269
+ #
270
+ # :call-seq:
271
+ # escape( str )
272
+ # escape( str, unsafe )
273
+ #
274
+ # == Args
275
+ #
276
+ # +str+::
277
+ # String to make safe
278
+ # +unsafe+::
279
+ # Regexp to apply. Defaults to +self.regexp[:UNSAFE]+
280
+ #
281
+ # == Description
282
+ #
283
+ # Constructs a safe String from +str+, removing unsafe characters,
284
+ # replacing them with codes.
285
+ #
286
+ def escape(str, unsafe = @regexp[:UNSAFE])
287
+ unless unsafe.kind_of?(Regexp)
288
+ # perhaps unsafe is String object
289
+ unsafe = Regexp.new("[#{Regexp.quote(unsafe)}]", false)
290
+ end
291
+ str.gsub(unsafe) do
292
+ us = $&
293
+ tmp = ''
294
+ us.each_byte do |uc|
295
+ tmp << sprintf('%%%02X', uc)
296
+ end
297
+ tmp
298
+ end.force_encoding(Encoding::US_ASCII)
299
+ end
300
+
301
+ #
302
+ # :call-seq:
303
+ # unescape( str )
304
+ # unescape( str, escaped )
305
+ #
306
+ # == Args
307
+ #
308
+ # +str+::
309
+ # String to remove escapes from
310
+ # +escaped+::
311
+ # Regexp to apply. Defaults to +self.regexp[:ESCAPED]+
312
+ #
313
+ # == Description
314
+ #
315
+ # Removes escapes from +str+.
316
+ #
317
+ def unescape(str, escaped = @regexp[:ESCAPED])
318
+ enc = str.encoding
319
+ enc = Encoding::UTF_8 if enc == Encoding::US_ASCII
320
+ str.gsub(escaped) { [$&[1, 2]].pack('H2').force_encoding(enc) }
321
+ end
322
+
323
+ TO_S = Kernel.instance_method(:to_s) # :nodoc:
324
+ if TO_S.respond_to?(:bind_call)
325
+ def inspect # :nodoc:
326
+ TO_S.bind_call(self)
327
+ end
328
+ else
329
+ def inspect # :nodoc:
330
+ TO_S.bind(self).call
331
+ end
332
+ end
333
+
334
+ private
335
+
336
+ # Constructs the default Hash of patterns.
337
+ def initialize_pattern(opts = {})
338
+ ret = {}
339
+ ret[:ESCAPED] = escaped = (opts.delete(:ESCAPED) || PATTERN::ESCAPED)
340
+ ret[:UNRESERVED] = unreserved = opts.delete(:UNRESERVED) || PATTERN::UNRESERVED
341
+ ret[:RESERVED] = reserved = opts.delete(:RESERVED) || PATTERN::RESERVED
342
+ ret[:DOMLABEL] = opts.delete(:DOMLABEL) || PATTERN::DOMLABEL
343
+ ret[:TOPLABEL] = opts.delete(:TOPLABEL) || PATTERN::TOPLABEL
344
+ ret[:HOSTNAME] = hostname = opts.delete(:HOSTNAME)
345
+
346
+ # RFC 2396 (Bundler::URI Generic Syntax)
347
+ # RFC 2732 (IPv6 Literal Addresses in URL's)
348
+ # RFC 2373 (IPv6 Addressing Architecture)
349
+
350
+ # uric = reserved | unreserved | escaped
351
+ ret[:URIC] = uric = "(?:[#{unreserved}#{reserved}]|#{escaped})"
352
+ # uric_no_slash = unreserved | escaped | ";" | "?" | ":" | "@" |
353
+ # "&" | "=" | "+" | "$" | ","
354
+ ret[:URIC_NO_SLASH] = uric_no_slash = "(?:[#{unreserved};?:@&=+$,]|#{escaped})"
355
+ # query = *uric
356
+ ret[:QUERY] = query = "#{uric}*"
357
+ # fragment = *uric
358
+ ret[:FRAGMENT] = fragment = "#{uric}*"
359
+
360
+ # hostname = *( domainlabel "." ) toplabel [ "." ]
361
+ # reg-name = *( unreserved / pct-encoded / sub-delims ) # RFC3986
362
+ unless hostname
363
+ ret[:HOSTNAME] = hostname = "(?:[a-zA-Z0-9\\-.]|%\\h\\h)+"
364
+ end
365
+
366
+ # RFC 2373, APPENDIX B:
367
+ # IPv6address = hexpart [ ":" IPv4address ]
368
+ # IPv4address = 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT
369
+ # hexpart = hexseq | hexseq "::" [ hexseq ] | "::" [ hexseq ]
370
+ # hexseq = hex4 *( ":" hex4)
371
+ # hex4 = 1*4HEXDIG
372
+ #
373
+ # XXX: This definition has a flaw. "::" + IPv4address must be
374
+ # allowed too. Here is a replacement.
375
+ #
376
+ # IPv4address = 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT "." 1*3DIGIT
377
+ ret[:IPV4ADDR] = ipv4addr = "\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}"
378
+ # hex4 = 1*4HEXDIG
379
+ hex4 = "[#{PATTERN::HEX}]{1,4}"
380
+ # lastpart = hex4 | IPv4address
381
+ lastpart = "(?:#{hex4}|#{ipv4addr})"
382
+ # hexseq1 = *( hex4 ":" ) hex4
383
+ hexseq1 = "(?:#{hex4}:)*#{hex4}"
384
+ # hexseq2 = *( hex4 ":" ) lastpart
385
+ hexseq2 = "(?:#{hex4}:)*#{lastpart}"
386
+ # IPv6address = hexseq2 | [ hexseq1 ] "::" [ hexseq2 ]
387
+ ret[:IPV6ADDR] = ipv6addr = "(?:#{hexseq2}|(?:#{hexseq1})?::(?:#{hexseq2})?)"
388
+
389
+ # IPv6prefix = ( hexseq1 | [ hexseq1 ] "::" [ hexseq1 ] ) "/" 1*2DIGIT
390
+ # unused
391
+
392
+ # ipv6reference = "[" IPv6address "]" (RFC 2732)
393
+ ret[:IPV6REF] = ipv6ref = "\\[#{ipv6addr}\\]"
394
+
395
+ # host = hostname | IPv4address
396
+ # host = hostname | IPv4address | IPv6reference (RFC 2732)
397
+ ret[:HOST] = host = "(?:#{hostname}|#{ipv4addr}|#{ipv6ref})"
398
+ # port = *digit
399
+ ret[:PORT] = port = '\d*'
400
+ # hostport = host [ ":" port ]
401
+ ret[:HOSTPORT] = hostport = "#{host}(?::#{port})?"
402
+
403
+ # userinfo = *( unreserved | escaped |
404
+ # ";" | ":" | "&" | "=" | "+" | "$" | "," )
405
+ ret[:USERINFO] = userinfo = "(?:[#{unreserved};:&=+$,]|#{escaped})*"
406
+
407
+ # pchar = unreserved | escaped |
408
+ # ":" | "@" | "&" | "=" | "+" | "$" | ","
409
+ pchar = "(?:[#{unreserved}:@&=+$,]|#{escaped})"
410
+ # param = *pchar
411
+ param = "#{pchar}*"
412
+ # segment = *pchar *( ";" param )
413
+ segment = "#{pchar}*(?:;#{param})*"
414
+ # path_segments = segment *( "/" segment )
415
+ ret[:PATH_SEGMENTS] = path_segments = "#{segment}(?:/#{segment})*"
416
+
417
+ # server = [ [ userinfo "@" ] hostport ]
418
+ server = "(?:#{userinfo}@)?#{hostport}"
419
+ # reg_name = 1*( unreserved | escaped | "$" | "," |
420
+ # ";" | ":" | "@" | "&" | "=" | "+" )
421
+ ret[:REG_NAME] = reg_name = "(?:[#{unreserved}$,;:@&=+]|#{escaped})+"
422
+ # authority = server | reg_name
423
+ authority = "(?:#{server}|#{reg_name})"
424
+
425
+ # rel_segment = 1*( unreserved | escaped |
426
+ # ";" | "@" | "&" | "=" | "+" | "$" | "," )
427
+ ret[:REL_SEGMENT] = rel_segment = "(?:[#{unreserved};@&=+$,]|#{escaped})+"
428
+
429
+ # scheme = alpha *( alpha | digit | "+" | "-" | "." )
430
+ ret[:SCHEME] = scheme = "[#{PATTERN::ALPHA}][\\-+.#{PATTERN::ALPHA}\\d]*"
431
+
432
+ # abs_path = "/" path_segments
433
+ ret[:ABS_PATH] = abs_path = "/#{path_segments}"
434
+ # rel_path = rel_segment [ abs_path ]
435
+ ret[:REL_PATH] = rel_path = "#{rel_segment}(?:#{abs_path})?"
436
+ # net_path = "//" authority [ abs_path ]
437
+ ret[:NET_PATH] = net_path = "//#{authority}(?:#{abs_path})?"
438
+
439
+ # hier_part = ( net_path | abs_path ) [ "?" query ]
440
+ ret[:HIER_PART] = hier_part = "(?:#{net_path}|#{abs_path})(?:\\?(?:#{query}))?"
441
+ # opaque_part = uric_no_slash *uric
442
+ ret[:OPAQUE_PART] = opaque_part = "#{uric_no_slash}#{uric}*"
443
+
444
+ # absoluteURI = scheme ":" ( hier_part | opaque_part )
445
+ ret[:ABS_URI] = abs_uri = "#{scheme}:(?:#{hier_part}|#{opaque_part})"
446
+ # relativeURI = ( net_path | abs_path | rel_path ) [ "?" query ]
447
+ ret[:REL_URI] = rel_uri = "(?:#{net_path}|#{abs_path}|#{rel_path})(?:\\?#{query})?"
448
+
449
+ # Bundler::URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
450
+ ret[:URI_REF] = "(?:#{abs_uri}|#{rel_uri})?(?:##{fragment})?"
451
+
452
+ ret[:X_ABS_URI] = "
453
+ (#{scheme}): (?# 1: scheme)
454
+ (?:
455
+ (#{opaque_part}) (?# 2: opaque)
456
+ |
457
+ (?:(?:
458
+ //(?:
459
+ (?:(?:(#{userinfo})@)? (?# 3: userinfo)
460
+ (?:(#{host})(?::(\\d*))?))? (?# 4: host, 5: port)
461
+ |
462
+ (#{reg_name}) (?# 6: registry)
463
+ )
464
+ |
465
+ (?!//)) (?# XXX: '//' is the mark for hostport)
466
+ (#{abs_path})? (?# 7: path)
467
+ )(?:\\?(#{query}))? (?# 8: query)
468
+ )
469
+ (?:\\#(#{fragment}))? (?# 9: fragment)
470
+ "
471
+
472
+ ret[:X_REL_URI] = "
473
+ (?:
474
+ (?:
475
+ //
476
+ (?:
477
+ (?:(#{userinfo})@)? (?# 1: userinfo)
478
+ (#{host})?(?::(\\d*))? (?# 2: host, 3: port)
479
+ |
480
+ (#{reg_name}) (?# 4: registry)
481
+ )
482
+ )
483
+ |
484
+ (#{rel_segment}) (?# 5: rel_segment)
485
+ )?
486
+ (#{abs_path})? (?# 6: abs_path)
487
+ (?:\\?(#{query}))? (?# 7: query)
488
+ (?:\\#(#{fragment}))? (?# 8: fragment)
489
+ "
490
+
491
+ ret
492
+ end
493
+
494
+ # Constructs the default Hash of Regexp's.
495
+ def initialize_regexp(pattern)
496
+ ret = {}
497
+
498
+ # for Bundler::URI::split
499
+ ret[:ABS_URI] = Regexp.new('\A\s*+' + pattern[:X_ABS_URI] + '\s*\z', Regexp::EXTENDED)
500
+ ret[:REL_URI] = Regexp.new('\A\s*+' + pattern[:X_REL_URI] + '\s*\z', Regexp::EXTENDED)
501
+
502
+ # for Bundler::URI::extract
503
+ ret[:URI_REF] = Regexp.new(pattern[:URI_REF])
504
+ ret[:ABS_URI_REF] = Regexp.new(pattern[:X_ABS_URI], Regexp::EXTENDED)
505
+ ret[:REL_URI_REF] = Regexp.new(pattern[:X_REL_URI], Regexp::EXTENDED)
506
+
507
+ # for Bundler::URI::escape/unescape
508
+ ret[:ESCAPED] = Regexp.new(pattern[:ESCAPED])
509
+ ret[:UNSAFE] = Regexp.new("[^#{pattern[:UNRESERVED]}#{pattern[:RESERVED]}]")
510
+
511
+ # for Generic#initialize
512
+ ret[:SCHEME] = Regexp.new("\\A#{pattern[:SCHEME]}\\z")
513
+ ret[:USERINFO] = Regexp.new("\\A#{pattern[:USERINFO]}\\z")
514
+ ret[:HOST] = Regexp.new("\\A#{pattern[:HOST]}\\z")
515
+ ret[:PORT] = Regexp.new("\\A#{pattern[:PORT]}\\z")
516
+ ret[:OPAQUE] = Regexp.new("\\A#{pattern[:OPAQUE_PART]}\\z")
517
+ ret[:REGISTRY] = Regexp.new("\\A#{pattern[:REG_NAME]}\\z")
518
+ ret[:ABS_PATH] = Regexp.new("\\A#{pattern[:ABS_PATH]}\\z")
519
+ ret[:REL_PATH] = Regexp.new("\\A#{pattern[:REL_PATH]}\\z")
520
+ ret[:QUERY] = Regexp.new("\\A#{pattern[:QUERY]}\\z")
521
+ ret[:FRAGMENT] = Regexp.new("\\A#{pattern[:FRAGMENT]}\\z")
522
+
523
+ ret
524
+ end
525
+
526
+ # Returns +uri+ as-is if it is Bundler::URI, or convert it to Bundler::URI if it is
527
+ # a String.
528
+ def convert_to_uri(uri)
529
+ if uri.is_a?(Bundler::URI::Generic)
530
+ uri
531
+ elsif uri = String.try_convert(uri)
532
+ parse(uri)
533
+ else
534
+ raise ArgumentError,
535
+ "bad argument (expected Bundler::URI object or Bundler::URI string)"
536
+ end
537
+ end
538
+
539
+ end # class Parser
540
+
541
+ # Backward compatibility for Bundler::URI::REGEXP::PATTERN::*
542
+ RFC2396_Parser.new.pattern.each_pair do |sym, str|
543
+ unless RFC2396_REGEXP::PATTERN.const_defined?(sym, false)
544
+ RFC2396_REGEXP::PATTERN.const_set(sym, str)
545
+ end
546
+ end
547
+ end # module Bundler::URI