active_cached_resource 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (317) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/LICENSE +21 -0
  4. data/lib/active_cached_resource/caching.rb +104 -1
  5. data/lib/active_cached_resource/configuration.rb +22 -1
  6. data/lib/active_cached_resource/logger.rb +14 -0
  7. data/lib/active_cached_resource/model.rb +18 -0
  8. data/lib/active_cached_resource/version.rb +1 -8
  9. data/lib/activeresource/lib/active_resource/collection.rb +2 -0
  10. metadata +4 -310
  11. data/.rspec +0 -3
  12. data/.rubocop.yml +0 -23
  13. data/.standard.yml +0 -2
  14. data/Rakefile +0 -29
  15. data/example/consumer/.dockerignore +0 -41
  16. data/example/consumer/.gitattributes +0 -9
  17. data/example/consumer/.gitignore +0 -36
  18. data/example/consumer/.kamal/hooks/docker-setup.sample +0 -3
  19. data/example/consumer/.kamal/hooks/post-deploy.sample +0 -14
  20. data/example/consumer/.kamal/hooks/post-proxy-reboot.sample +0 -3
  21. data/example/consumer/.kamal/hooks/pre-build.sample +0 -51
  22. data/example/consumer/.kamal/hooks/pre-connect.sample +0 -47
  23. data/example/consumer/.kamal/hooks/pre-deploy.sample +0 -109
  24. data/example/consumer/.kamal/hooks/pre-proxy-reboot.sample +0 -3
  25. data/example/consumer/.kamal/secrets +0 -17
  26. data/example/consumer/Dockerfile +0 -65
  27. data/example/consumer/Gemfile +0 -17
  28. data/example/consumer/Rakefile +0 -6
  29. data/example/consumer/app/controllers/application_controller.rb +0 -2
  30. data/example/consumer/app/controllers/concerns/.keep +0 -0
  31. data/example/consumer/app/jobs/application_job.rb +0 -7
  32. data/example/consumer/app/mailers/application_mailer.rb +0 -4
  33. data/example/consumer/app/models/application_record.rb +0 -3
  34. data/example/consumer/app/models/concerns/.keep +0 -0
  35. data/example/consumer/app/models/person.rb +0 -9
  36. data/example/consumer/app/views/layouts/mailer.html.erb +0 -13
  37. data/example/consumer/app/views/layouts/mailer.text.erb +0 -1
  38. data/example/consumer/bin/brakeman +0 -7
  39. data/example/consumer/bin/bundle +0 -109
  40. data/example/consumer/bin/dev +0 -2
  41. data/example/consumer/bin/docker-entrypoint +0 -14
  42. data/example/consumer/bin/jobs +0 -6
  43. data/example/consumer/bin/kamal +0 -27
  44. data/example/consumer/bin/rails +0 -4
  45. data/example/consumer/bin/rake +0 -4
  46. data/example/consumer/bin/rubocop +0 -8
  47. data/example/consumer/bin/setup +0 -34
  48. data/example/consumer/bin/thrust +0 -5
  49. data/example/consumer/config/application.rb +0 -20
  50. data/example/consumer/config/boot.rb +0 -3
  51. data/example/consumer/config/cache.yml +0 -16
  52. data/example/consumer/config/credentials.yml.enc +0 -1
  53. data/example/consumer/config/database.yml +0 -14
  54. data/example/consumer/config/deploy.yml +0 -116
  55. data/example/consumer/config/environment.rb +0 -5
  56. data/example/consumer/config/environments/development.rb +0 -64
  57. data/example/consumer/config/environments/production.rb +0 -85
  58. data/example/consumer/config/environments/test.rb +0 -50
  59. data/example/consumer/config/initializers/cors.rb +0 -16
  60. data/example/consumer/config/initializers/filter_parameter_logging.rb +0 -8
  61. data/example/consumer/config/initializers/inflections.rb +0 -16
  62. data/example/consumer/config/locales/en.yml +0 -31
  63. data/example/consumer/config/puma.rb +0 -41
  64. data/example/consumer/config/queue.yml +0 -18
  65. data/example/consumer/config/recurring.yml +0 -10
  66. data/example/consumer/config/routes.rb +0 -10
  67. data/example/consumer/config.ru +0 -6
  68. data/example/consumer/db/cache_schema.rb +0 -14
  69. data/example/consumer/db/queue_schema.rb +0 -129
  70. data/example/consumer/db/seeds.rb +0 -0
  71. data/example/consumer/lib/tasks/.keep +0 -0
  72. data/example/consumer/log/.keep +0 -0
  73. data/example/consumer/public/robots.txt +0 -1
  74. data/example/consumer/script/.keep +0 -0
  75. data/example/consumer/storage/.keep +0 -0
  76. data/example/consumer/tmp/.keep +0 -0
  77. data/example/consumer/tmp/cache/.keep +0 -0
  78. data/example/consumer/tmp/pids/.keep +0 -0
  79. data/example/consumer/tmp/storage/.keep +0 -0
  80. data/example/consumer/vendor/.keep +0 -0
  81. data/example/provider/.dockerignore +0 -41
  82. data/example/provider/.gitattributes +0 -9
  83. data/example/provider/.gitignore +0 -32
  84. data/example/provider/.kamal/hooks/docker-setup.sample +0 -3
  85. data/example/provider/.kamal/hooks/post-deploy.sample +0 -14
  86. data/example/provider/.kamal/hooks/post-proxy-reboot.sample +0 -3
  87. data/example/provider/.kamal/hooks/pre-build.sample +0 -51
  88. data/example/provider/.kamal/hooks/pre-connect.sample +0 -47
  89. data/example/provider/.kamal/hooks/pre-deploy.sample +0 -109
  90. data/example/provider/.kamal/hooks/pre-proxy-reboot.sample +0 -3
  91. data/example/provider/.kamal/secrets +0 -17
  92. data/example/provider/Dockerfile +0 -65
  93. data/example/provider/Gemfile +0 -14
  94. data/example/provider/Rakefile +0 -6
  95. data/example/provider/app/controllers/application_controller.rb +0 -2
  96. data/example/provider/app/controllers/concerns/.keep +0 -0
  97. data/example/provider/app/controllers/people_controller.rb +0 -68
  98. data/example/provider/app/jobs/application_job.rb +0 -7
  99. data/example/provider/app/mailers/application_mailer.rb +0 -4
  100. data/example/provider/app/models/address.rb +0 -3
  101. data/example/provider/app/models/application_record.rb +0 -3
  102. data/example/provider/app/models/company.rb +0 -3
  103. data/example/provider/app/models/concerns/.keep +0 -0
  104. data/example/provider/app/models/person.rb +0 -6
  105. data/example/provider/app/views/layouts/mailer.html.erb +0 -13
  106. data/example/provider/app/views/layouts/mailer.text.erb +0 -1
  107. data/example/provider/bin/brakeman +0 -7
  108. data/example/provider/bin/bundle +0 -109
  109. data/example/provider/bin/dev +0 -2
  110. data/example/provider/bin/docker-entrypoint +0 -14
  111. data/example/provider/bin/jobs +0 -6
  112. data/example/provider/bin/kamal +0 -27
  113. data/example/provider/bin/rails +0 -4
  114. data/example/provider/bin/rake +0 -4
  115. data/example/provider/bin/rubocop +0 -8
  116. data/example/provider/bin/setup +0 -34
  117. data/example/provider/bin/thrust +0 -5
  118. data/example/provider/config/application.rb +0 -44
  119. data/example/provider/config/boot.rb +0 -3
  120. data/example/provider/config/cache.yml +0 -16
  121. data/example/provider/config/credentials.yml.enc +0 -1
  122. data/example/provider/config/database.yml +0 -20
  123. data/example/provider/config/deploy.yml +0 -116
  124. data/example/provider/config/environment.rb +0 -5
  125. data/example/provider/config/environments/development.rb +0 -64
  126. data/example/provider/config/environments/production.rb +0 -85
  127. data/example/provider/config/environments/test.rb +0 -50
  128. data/example/provider/config/initializers/cors.rb +0 -16
  129. data/example/provider/config/initializers/filter_parameter_logging.rb +0 -8
  130. data/example/provider/config/initializers/inflections.rb +0 -16
  131. data/example/provider/config/locales/en.yml +0 -31
  132. data/example/provider/config/puma.rb +0 -41
  133. data/example/provider/config/queue.yml +0 -18
  134. data/example/provider/config/recurring.yml +0 -10
  135. data/example/provider/config/routes.rb +0 -4
  136. data/example/provider/config.ru +0 -6
  137. data/example/provider/db/cache_schema.rb +0 -14
  138. data/example/provider/db/migrate/20241202183937_create_people.rb +0 -11
  139. data/example/provider/db/migrate/20241202183955_create_addresses.rb +0 -13
  140. data/example/provider/db/migrate/20241202184017_create_companies.rb +0 -14
  141. data/example/provider/db/queue_schema.rb +0 -129
  142. data/example/provider/db/schema.rb +0 -47
  143. data/example/provider/db/seeds.rb +0 -18
  144. data/example/provider/lib/tasks/.keep +0 -0
  145. data/example/provider/log/.keep +0 -0
  146. data/example/provider/public/robots.txt +0 -1
  147. data/example/provider/script/.keep +0 -0
  148. data/example/provider/storage/.keep +0 -0
  149. data/example/provider/tmp/.keep +0 -0
  150. data/example/provider/tmp/pids/.keep +0 -0
  151. data/example/provider/tmp/storage/.keep +0 -0
  152. data/example/provider/vendor/.keep +0 -0
  153. data/lib/activeresource/.gitignore +0 -15
  154. data/lib/activeresource/examples/performance.rb +0 -72
  155. data/lib/activeresource/test/abstract_unit.rb +0 -154
  156. data/lib/activeresource/test/cases/active_job_serializer_test.rb +0 -53
  157. data/lib/activeresource/test/cases/association_test.rb +0 -104
  158. data/lib/activeresource/test/cases/associations/builder/belongs_to_test.rb +0 -42
  159. data/lib/activeresource/test/cases/associations/builder/has_many_test.rb +0 -28
  160. data/lib/activeresource/test/cases/associations/builder/has_one_test.rb +0 -28
  161. data/lib/activeresource/test/cases/authorization_test.rb +0 -276
  162. data/lib/activeresource/test/cases/base/custom_methods_test.rb +0 -155
  163. data/lib/activeresource/test/cases/base/equality_test.rb +0 -53
  164. data/lib/activeresource/test/cases/base/load_test.rb +0 -249
  165. data/lib/activeresource/test/cases/base/schema_test.rb +0 -428
  166. data/lib/activeresource/test/cases/base_errors_test.rb +0 -129
  167. data/lib/activeresource/test/cases/base_test.rb +0 -1622
  168. data/lib/activeresource/test/cases/callbacks_test.rb +0 -155
  169. data/lib/activeresource/test/cases/collection_test.rb +0 -196
  170. data/lib/activeresource/test/cases/connection_test.rb +0 -357
  171. data/lib/activeresource/test/cases/finder_test.rb +0 -217
  172. data/lib/activeresource/test/cases/format_test.rb +0 -137
  173. data/lib/activeresource/test/cases/http_mock_test.rb +0 -213
  174. data/lib/activeresource/test/cases/inheritence_test.rb +0 -19
  175. data/lib/activeresource/test/cases/inheriting_hash_test.rb +0 -25
  176. data/lib/activeresource/test/cases/log_subscriber_test.rb +0 -64
  177. data/lib/activeresource/test/cases/reflection_test.rb +0 -65
  178. data/lib/activeresource/test/cases/validations_test.rb +0 -78
  179. data/lib/activeresource/test/fixtures/address.rb +0 -20
  180. data/lib/activeresource/test/fixtures/beast.rb +0 -16
  181. data/lib/activeresource/test/fixtures/comment.rb +0 -5
  182. data/lib/activeresource/test/fixtures/customer.rb +0 -5
  183. data/lib/activeresource/test/fixtures/fixtures.rbi +0 -46
  184. data/lib/activeresource/test/fixtures/inventory.rb +0 -14
  185. data/lib/activeresource/test/fixtures/person.rb +0 -15
  186. data/lib/activeresource/test/fixtures/pet.rb +0 -6
  187. data/lib/activeresource/test/fixtures/post.rb +0 -5
  188. data/lib/activeresource/test/fixtures/product.rb +0 -11
  189. data/lib/activeresource/test/fixtures/project.rb +0 -19
  190. data/lib/activeresource/test/fixtures/proxy.rb +0 -6
  191. data/lib/activeresource/test/fixtures/sound.rb +0 -11
  192. data/lib/activeresource/test/fixtures/street_address.rb +0 -6
  193. data/lib/activeresource/test/fixtures/subscription_plan.rb +0 -7
  194. data/lib/activeresource/test/fixtures/weather.rb +0 -21
  195. data/lib/activeresource/test/setter_trap.rb +0 -28
  196. data/lib/activeresource/test/singleton_test.rb +0 -138
  197. data/lib/activeresource/test/threadsafe_attributes_test.rb +0 -91
  198. data/sorbet/config +0 -6
  199. data/sorbet/rbi/annotations/.gitattributes +0 -1
  200. data/sorbet/rbi/annotations/activemodel.rbi +0 -89
  201. data/sorbet/rbi/annotations/activesupport.rbi +0 -457
  202. data/sorbet/rbi/annotations/minitest.rbi +0 -119
  203. data/sorbet/rbi/annotations/rainbow.rbi +0 -269
  204. data/sorbet/rbi/dsl/.gitattributes +0 -1
  205. data/sorbet/rbi/dsl/active_support/callbacks.rbi +0 -21
  206. data/sorbet/rbi/gems/.gitattributes +0 -1
  207. data/sorbet/rbi/gems/actioncable@8.0.1.rbi +0 -252
  208. data/sorbet/rbi/gems/actionmailbox@8.0.1.rbi +0 -9
  209. data/sorbet/rbi/gems/actionmailer@8.0.1.rbi +0 -9
  210. data/sorbet/rbi/gems/actionpack@8.0.1.rbi +0 -21111
  211. data/sorbet/rbi/gems/actiontext@8.0.1.rbi +0 -9
  212. data/sorbet/rbi/gems/actionview@8.0.1.rbi +0 -16409
  213. data/sorbet/rbi/gems/activejob@8.0.1.rbi +0 -90
  214. data/sorbet/rbi/gems/activemodel-serializers-xml@1.0.3.rbi +0 -166
  215. data/sorbet/rbi/gems/activemodel@8.0.1.rbi +0 -6865
  216. data/sorbet/rbi/gems/activerecord@8.0.1.rbi +0 -43277
  217. data/sorbet/rbi/gems/activestorage@8.0.1.rbi +0 -9
  218. data/sorbet/rbi/gems/activesupport@8.0.1.rbi +0 -21426
  219. data/sorbet/rbi/gems/ast@2.4.2.rbi +0 -585
  220. data/sorbet/rbi/gems/base64@0.2.0.rbi +0 -509
  221. data/sorbet/rbi/gems/benchmark@0.4.0.rbi +0 -618
  222. data/sorbet/rbi/gems/bigdecimal@3.1.8.rbi +0 -78
  223. data/sorbet/rbi/gems/builder@3.3.0.rbi +0 -9
  224. data/sorbet/rbi/gems/bump@0.10.0.rbi +0 -169
  225. data/sorbet/rbi/gems/byebug@11.1.3.rbi +0 -3607
  226. data/sorbet/rbi/gems/coderay@1.1.3.rbi +0 -3427
  227. data/sorbet/rbi/gems/concurrent-ruby@1.3.4.rbi +0 -11645
  228. data/sorbet/rbi/gems/connection_pool@2.4.1.rbi +0 -9
  229. data/sorbet/rbi/gems/crass@1.0.6.rbi +0 -623
  230. data/sorbet/rbi/gems/date@3.4.1.rbi +0 -75
  231. data/sorbet/rbi/gems/diff-lcs@1.5.1.rbi +0 -1131
  232. data/sorbet/rbi/gems/docile@1.4.1.rbi +0 -377
  233. data/sorbet/rbi/gems/drb@2.2.1.rbi +0 -1347
  234. data/sorbet/rbi/gems/erubi@1.13.0.rbi +0 -150
  235. data/sorbet/rbi/gems/globalid@1.2.1.rbi +0 -9
  236. data/sorbet/rbi/gems/i18n@1.14.6.rbi +0 -2359
  237. data/sorbet/rbi/gems/io-console@0.8.0.rbi +0 -9
  238. data/sorbet/rbi/gems/json@2.9.0.rbi +0 -1944
  239. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +0 -14238
  240. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +0 -240
  241. data/sorbet/rbi/gems/logger@1.6.3.rbi +0 -940
  242. data/sorbet/rbi/gems/loofah@2.23.1.rbi +0 -1081
  243. data/sorbet/rbi/gems/mail@2.8.1.rbi +0 -9
  244. data/sorbet/rbi/gems/marcel@1.0.4.rbi +0 -9
  245. data/sorbet/rbi/gems/method_source@1.1.0.rbi +0 -304
  246. data/sorbet/rbi/gems/mini_mime@1.1.5.rbi +0 -9
  247. data/sorbet/rbi/gems/minitest@5.25.4.rbi +0 -1547
  248. data/sorbet/rbi/gems/mocha@2.7.1.rbi +0 -12
  249. data/sorbet/rbi/gems/msgpack@1.7.5.rbi +0 -320
  250. data/sorbet/rbi/gems/net-imap@0.5.2.rbi +0 -9
  251. data/sorbet/rbi/gems/net-pop@0.1.2.rbi +0 -9
  252. data/sorbet/rbi/gems/net-protocol@0.2.2.rbi +0 -292
  253. data/sorbet/rbi/gems/net-smtp@0.5.0.rbi +0 -9
  254. data/sorbet/rbi/gems/netrc@0.11.0.rbi +0 -159
  255. data/sorbet/rbi/gems/nio4r@2.7.4.rbi +0 -9
  256. data/sorbet/rbi/gems/nokogiri@1.17.2.rbi +0 -8201
  257. data/sorbet/rbi/gems/parallel@1.26.3.rbi +0 -291
  258. data/sorbet/rbi/gems/parser@3.3.6.0.rbi +0 -5519
  259. data/sorbet/rbi/gems/prism@1.2.0.rbi +0 -39085
  260. data/sorbet/rbi/gems/pry-byebug@3.10.1.rbi +0 -1151
  261. data/sorbet/rbi/gems/pry@0.14.2.rbi +0 -10076
  262. data/sorbet/rbi/gems/psych@5.2.1.rbi +0 -1785
  263. data/sorbet/rbi/gems/racc@1.8.1.rbi +0 -162
  264. data/sorbet/rbi/gems/rack-session@2.0.0.rbi +0 -727
  265. data/sorbet/rbi/gems/rack-test@2.1.0.rbi +0 -747
  266. data/sorbet/rbi/gems/rack@3.1.8.rbi +0 -4905
  267. data/sorbet/rbi/gems/rackup@2.2.1.rbi +0 -230
  268. data/sorbet/rbi/gems/rails-dom-testing@2.2.0.rbi +0 -758
  269. data/sorbet/rbi/gems/rails-html-sanitizer@1.6.2.rbi +0 -785
  270. data/sorbet/rbi/gems/rails@8.0.1.rbi +0 -9
  271. data/sorbet/rbi/gems/railties@8.0.1.rbi +0 -6347
  272. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +0 -403
  273. data/sorbet/rbi/gems/rake@13.2.1.rbi +0 -3028
  274. data/sorbet/rbi/gems/rbi@0.2.1.rbi +0 -4535
  275. data/sorbet/rbi/gems/rdoc@6.9.1.rbi +0 -12593
  276. data/sorbet/rbi/gems/regexp_parser@2.9.3.rbi +0 -3772
  277. data/sorbet/rbi/gems/reline@0.6.0.rbi +0 -2454
  278. data/sorbet/rbi/gems/rexml@3.4.0.rbi +0 -4871
  279. data/sorbet/rbi/gems/rspec-core@3.13.2.rbi +0 -11284
  280. data/sorbet/rbi/gems/rspec-expectations@3.13.3.rbi +0 -8183
  281. data/sorbet/rbi/gems/rspec-mocks@3.13.2.rbi +0 -5341
  282. data/sorbet/rbi/gems/rspec-support@3.13.2.rbi +0 -1630
  283. data/sorbet/rbi/gems/rspec@3.13.0.rbi +0 -83
  284. data/sorbet/rbi/gems/rubocop-ast@1.37.0.rbi +0 -7713
  285. data/sorbet/rbi/gems/rubocop-md@1.2.4.rbi +0 -123
  286. data/sorbet/rbi/gems/rubocop-minitest@0.36.0.rbi +0 -2613
  287. data/sorbet/rbi/gems/rubocop-packaging@0.5.2.rbi +0 -388
  288. data/sorbet/rbi/gems/rubocop-performance@1.23.0.rbi +0 -9
  289. data/sorbet/rbi/gems/rubocop-rails@2.27.0.rbi +0 -9535
  290. data/sorbet/rbi/gems/rubocop@1.69.2.rbi +0 -59600
  291. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +0 -1318
  292. data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +0 -9
  293. data/sorbet/rbi/gems/securerandom@0.4.1.rbi +0 -78
  294. data/sorbet/rbi/gems/simplecov-html@0.13.1.rbi +0 -225
  295. data/sorbet/rbi/gems/simplecov@0.22.0.rbi +0 -2149
  296. data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +0 -9
  297. data/sorbet/rbi/gems/spoom@1.5.0.rbi +0 -4932
  298. data/sorbet/rbi/gems/sqlite3@2.3.1.rbi +0 -1824
  299. data/sorbet/rbi/gems/standard-custom@1.0.2.rbi +0 -9
  300. data/sorbet/rbi/gems/standard-performance@1.6.0.rbi +0 -9
  301. data/sorbet/rbi/gems/standard@1.43.0.rbi +0 -926
  302. data/sorbet/rbi/gems/stringio@3.1.2.rbi +0 -9
  303. data/sorbet/rbi/gems/tapioca@0.16.4.rbi +0 -3597
  304. data/sorbet/rbi/gems/thor@1.3.2.rbi +0 -4378
  305. data/sorbet/rbi/gems/timeout@0.4.2.rbi +0 -151
  306. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +0 -5918
  307. data/sorbet/rbi/gems/unicode-display_width@3.1.2.rbi +0 -130
  308. data/sorbet/rbi/gems/unicode-emoji@4.0.4.rbi +0 -251
  309. data/sorbet/rbi/gems/uri@1.0.2.rbi +0 -2377
  310. data/sorbet/rbi/gems/useragent@0.16.11.rbi +0 -9
  311. data/sorbet/rbi/gems/websocket-driver@0.7.6.rbi +0 -9
  312. data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +0 -9
  313. data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +0 -435
  314. data/sorbet/rbi/gems/yard@0.9.37.rbi +0 -18504
  315. data/sorbet/rbi/gems/zeitwerk@2.7.1.rbi +0 -9
  316. data/sorbet/tapioca/config.yml +0 -13
  317. data/sorbet/tapioca/require.rb +0 -13
@@ -1,9 +0,0 @@
1
- # typed: true
2
-
3
- # DO NOT EDIT MANUALLY
4
- # This is an autogenerated file for types exported from the `mail` gem.
5
- # Please instead update this file by running `bin/tapioca gem mail`.
6
-
7
-
8
- # THIS IS AN EMPTY RBI FILE.
9
- # see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
@@ -1,9 +0,0 @@
1
- # typed: true
2
-
3
- # DO NOT EDIT MANUALLY
4
- # This is an autogenerated file for types exported from the `marcel` gem.
5
- # Please instead update this file by running `bin/tapioca gem marcel`.
6
-
7
-
8
- # THIS IS AN EMPTY RBI FILE.
9
- # see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
@@ -1,304 +0,0 @@
1
- # typed: true
2
-
3
- # DO NOT EDIT MANUALLY
4
- # This is an autogenerated file for types exported from the `method_source` gem.
5
- # Please instead update this file by running `bin/tapioca gem method_source`.
6
-
7
-
8
- # source://method_source//lib/method_source.rb#163
9
- class Method
10
- include ::MethodSource::SourceLocation::MethodExtensions
11
- include ::MethodSource::MethodExtensions
12
- end
13
-
14
- # source://method_source//lib/method_source/version.rb#1
15
- module MethodSource
16
- extend ::MethodSource::CodeHelpers
17
-
18
- class << self
19
- # Clear cache.
20
- #
21
- # source://method_source//lib/method_source.rb#59
22
- def clear_cache; end
23
-
24
- # Helper method responsible for opening source file and buffering up
25
- # the comments for a specified method. Defined here to avoid polluting
26
- # `Method` class.
27
- #
28
- # @param source_location [Array] The array returned by Method#source_location
29
- # @param method_name [String]
30
- # @raise [SourceNotFoundError]
31
- # @return [String] The comments up to the point of the method.
32
- #
33
- # source://method_source//lib/method_source.rb#38
34
- def comment_helper(source_location, name = T.unsafe(nil)); end
35
-
36
- # @deprecated — use MethodSource::CodeHelpers#expression_at
37
- #
38
- # source://method_source//lib/method_source.rb#71
39
- def extract_code(source_location); end
40
-
41
- # Load a memoized copy of the lines in a file.
42
- #
43
- # @param file_name [String]
44
- # @param method_name [String]
45
- # @raise [SourceNotFoundError]
46
- # @return [Array<String>] the contents of the file
47
- #
48
- # source://method_source//lib/method_source.rb#51
49
- def lines_for(file_name, name = T.unsafe(nil)); end
50
-
51
- # Helper method responsible for extracting method body.
52
- # Defined here to avoid polluting `Method` class.
53
- #
54
- # @param source_location [Array] The array returned by Method#source_location
55
- # @param method_name [String]
56
- # @return [String] The method body
57
- #
58
- # source://method_source//lib/method_source.rb#23
59
- def source_helper(source_location, name = T.unsafe(nil)); end
60
-
61
- # @deprecated — use MethodSource::CodeHelpers#complete_expression?
62
- # @return [Boolean]
63
- #
64
- # source://method_source//lib/method_source.rb#64
65
- def valid_expression?(str); end
66
- end
67
- end
68
-
69
- # source://method_source//lib/method_source/code_helpers.rb#3
70
- module MethodSource::CodeHelpers
71
- # Retrieve the comment describing the expression on the given line of the given file.
72
- #
73
- # This is useful to get module or method documentation.
74
- #
75
- # @param file [Array<String>, File, String] The file to parse, either as a File or as
76
- # a String or an Array of lines.
77
- # @param line_number [Integer] The line number at which to look.
78
- # NOTE: The first line in a file is line 1!
79
- # @return [String] The comment
80
- #
81
- # source://method_source//lib/method_source/code_helpers.rb#52
82
- def comment_describing(file, line_number); end
83
-
84
- # Determine if a string of code is a complete Ruby expression.
85
- #
86
- # @example
87
- # complete_expression?("class Hello") #=> false
88
- # complete_expression?("class Hello; end") #=> true
89
- # complete_expression?("class 123") #=> SyntaxError: unexpected tINTEGER
90
- # @param code [String] The code to validate.
91
- # @raise [SyntaxError] Any SyntaxError that does not represent incompleteness.
92
- # @return [Boolean] Whether or not the code is a complete Ruby expression.
93
- #
94
- # source://method_source//lib/method_source/code_helpers.rb#66
95
- def complete_expression?(str); end
96
-
97
- # Retrieve the first expression starting on the given line of the given file.
98
- #
99
- # This is useful to get module or method source code.
100
- #
101
- # line 1!
102
- #
103
- # @option options
104
- # @option options
105
- # @param file [Array<String>, File, String] The file to parse, either as a File or as
106
- # @param line_number [Integer] The line number at which to look.
107
- # NOTE: The first line in a file is
108
- # @param options [Hash] The optional configuration parameters.
109
- # @raise [SyntaxError] If the first complete expression can't be identified
110
- # @return [String] The first complete expression
111
- #
112
- # source://method_source//lib/method_source/code_helpers.rb#20
113
- def expression_at(file, line_number, options = T.unsafe(nil)); end
114
-
115
- private
116
-
117
- # Get the first expression from the input.
118
- #
119
- # @param lines [Array<String>]
120
- # @param consume [Integer] A number of lines to automatically
121
- # consume (add to the expression buffer) without checking for validity.
122
- # @raise [SyntaxError]
123
- # @return [String] a valid ruby expression
124
- # @yield a clean-up function to run before checking for complete_expression
125
- #
126
- # source://method_source//lib/method_source/code_helpers.rb#92
127
- def extract_first_expression(lines, consume = T.unsafe(nil), &block); end
128
-
129
- # Get the last comment from the input.
130
- #
131
- # @param lines [Array<String>]
132
- # @return [String]
133
- #
134
- # source://method_source//lib/method_source/code_helpers.rb#106
135
- def extract_last_comment(lines); end
136
- end
137
-
138
- # An exception matcher that matches only subsets of SyntaxErrors that can be
139
- # fixed by adding more input to the buffer.
140
- #
141
- # source://method_source//lib/method_source/code_helpers.rb#124
142
- module MethodSource::CodeHelpers::IncompleteExpression
143
- class << self
144
- # source://method_source//lib/method_source/code_helpers.rb#137
145
- def ===(ex); end
146
-
147
- # @return [Boolean]
148
- #
149
- # source://method_source//lib/method_source/code_helpers.rb#149
150
- def rbx?; end
151
- end
152
- end
153
-
154
- # source://method_source//lib/method_source/code_helpers.rb#125
155
- MethodSource::CodeHelpers::IncompleteExpression::GENERIC_REGEXPS = T.let(T.unsafe(nil), Array)
156
-
157
- # source://method_source//lib/method_source/code_helpers.rb#133
158
- MethodSource::CodeHelpers::IncompleteExpression::RBX_ONLY_REGEXPS = T.let(T.unsafe(nil), Array)
159
-
160
- # This module is to be included by `Method` and `UnboundMethod` and
161
- # provides the `#source` functionality
162
- #
163
- # source://method_source//lib/method_source.rb#77
164
- module MethodSource::MethodExtensions
165
- # Return the comments associated with the method class/module.
166
- #
167
- # @example
168
- # MethodSource::MethodExtensions.method(:included).module_comment
169
- # =>
170
- # # This module is to be included by `Method` and `UnboundMethod` and
171
- # # provides the `#source` functionality
172
- # @raise SourceNotFoundException
173
- # @return [String] The method's comments as a string
174
- #
175
- # source://method_source//lib/method_source.rb#139
176
- def class_comment; end
177
-
178
- # Return the comments associated with the method as a string.
179
- #
180
- # @example
181
- # Set.instance_method(:clear).comment.display
182
- # =>
183
- # # Removes all elements and returns self.
184
- # @raise SourceNotFoundException
185
- # @return [String] The method's comments as a string
186
- #
187
- # source://method_source//lib/method_source.rb#126
188
- def comment; end
189
-
190
- # Return the comments associated with the method class/module.
191
- #
192
- # @example
193
- # MethodSource::MethodExtensions.method(:included).module_comment
194
- # =>
195
- # # This module is to be included by `Method` and `UnboundMethod` and
196
- # # provides the `#source` functionality
197
- # @raise SourceNotFoundException
198
- # @return [String] The method's comments as a string
199
- #
200
- # source://method_source//lib/method_source.rb#139
201
- def module_comment; end
202
-
203
- # Return the sourcecode for the method as a string
204
- #
205
- # @example
206
- # Set.instance_method(:clear).source.display
207
- # =>
208
- # def clear
209
- # @hash.clear
210
- # self
211
- # end
212
- # @raise SourceNotFoundException
213
- # @return [String] The method sourcecode as a string
214
- #
215
- # source://method_source//lib/method_source.rb#114
216
- def source; end
217
-
218
- class << self
219
- # We use the included hook to patch Method#source on rubinius.
220
- # We need to use the included hook as Rubinius defines a `source`
221
- # on Method so including a module will have no effect (as it's
222
- # higher up the MRO).
223
- #
224
- # @param klass [Class] The class that includes the module.
225
- #
226
- # source://method_source//lib/method_source.rb#84
227
- def included(klass); end
228
- end
229
- end
230
-
231
- # source://method_source//lib/method_source/source_location.rb#2
232
- module MethodSource::ReeSourceLocation
233
- # Ruby enterprise edition provides all the information that's
234
- # needed, in a slightly different way.
235
- #
236
- # source://method_source//lib/method_source/source_location.rb#5
237
- def source_location; end
238
- end
239
-
240
- # source://method_source//lib/method_source/source_location.rb#10
241
- module MethodSource::SourceLocation; end
242
-
243
- # source://method_source//lib/method_source/source_location.rb#11
244
- module MethodSource::SourceLocation::MethodExtensions
245
- # Return the source location of a method for Ruby 1.8.
246
- #
247
- # @return [Array] A two element array. First element is the
248
- # file, second element is the line in the file where the
249
- # method definition is found.
250
- #
251
- # source://method_source//lib/method_source/source_location.rb#40
252
- def source_location; end
253
-
254
- private
255
-
256
- # source://method_source//lib/method_source/source_location.rb#26
257
- def trace_func(event, file, line, id, binding, classname); end
258
- end
259
-
260
- # source://method_source//lib/method_source/source_location.rb#54
261
- module MethodSource::SourceLocation::ProcExtensions
262
- # Return the source location for a Proc (in implementations
263
- # without Proc#source_location)
264
- #
265
- # @return [Array] A two element array. First element is the
266
- # file, second element is the line in the file where the
267
- # proc definition is found.
268
- #
269
- # source://method_source//lib/method_source/source_location.rb#74
270
- def source_location; end
271
- end
272
-
273
- # source://method_source//lib/method_source/source_location.rb#81
274
- module MethodSource::SourceLocation::UnboundMethodExtensions
275
- # Return the source location of an instance method for Ruby 1.8.
276
- #
277
- # @return [Array] A two element array. First element is the
278
- # file, second element is the line in the file where the
279
- # method definition is found.
280
- #
281
- # source://method_source//lib/method_source/source_location.rb#101
282
- def source_location; end
283
- end
284
-
285
- # An Exception to mark errors that were raised trying to find the source from
286
- # a given source_location.
287
- #
288
- # source://method_source//lib/method_source.rb#16
289
- class MethodSource::SourceNotFoundError < ::StandardError; end
290
-
291
- # source://method_source//lib/method_source/version.rb#2
292
- MethodSource::VERSION = T.let(T.unsafe(nil), String)
293
-
294
- # source://method_source//lib/method_source.rb#173
295
- class Proc
296
- include ::MethodSource::SourceLocation::ProcExtensions
297
- include ::MethodSource::MethodExtensions
298
- end
299
-
300
- # source://method_source//lib/method_source.rb#168
301
- class UnboundMethod
302
- include ::MethodSource::SourceLocation::UnboundMethodExtensions
303
- include ::MethodSource::MethodExtensions
304
- end
@@ -1,9 +0,0 @@
1
- # typed: true
2
-
3
- # DO NOT EDIT MANUALLY
4
- # This is an autogenerated file for types exported from the `mini_mime` gem.
5
- # Please instead update this file by running `bin/tapioca gem mini_mime`.
6
-
7
-
8
- # THIS IS AN EMPTY RBI FILE.
9
- # see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem