active_cached_resource 0.0.1.pre → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/LICENSE +21 -0
- data/lib/active_cached_resource/caching.rb +104 -1
- data/lib/active_cached_resource/configuration.rb +22 -1
- data/lib/active_cached_resource/logger.rb +14 -0
- data/lib/active_cached_resource/model.rb +18 -0
- data/lib/active_cached_resource/version.rb +1 -8
- data/lib/activeresource/lib/active_resource/collection.rb +14 -1
- data/lib/activeresource/lib/active_resource/railtie.rb +2 -2
- data/lib/activeresource/lib/active_resource.rb +1 -1
- metadata +5 -401
- data/.rspec +0 -3
- data/.rubocop.yml +0 -22
- data/.standard.yml +0 -2
- data/Rakefile +0 -21
- data/example/consumer/.dockerignore +0 -41
- data/example/consumer/.gitattributes +0 -9
- data/example/consumer/.gitignore +0 -36
- data/example/consumer/.kamal/hooks/docker-setup.sample +0 -3
- data/example/consumer/.kamal/hooks/post-deploy.sample +0 -14
- data/example/consumer/.kamal/hooks/post-proxy-reboot.sample +0 -3
- data/example/consumer/.kamal/hooks/pre-build.sample +0 -51
- data/example/consumer/.kamal/hooks/pre-connect.sample +0 -47
- data/example/consumer/.kamal/hooks/pre-deploy.sample +0 -109
- data/example/consumer/.kamal/hooks/pre-proxy-reboot.sample +0 -3
- data/example/consumer/.kamal/secrets +0 -17
- data/example/consumer/Dockerfile +0 -65
- data/example/consumer/Gemfile +0 -17
- data/example/consumer/Rakefile +0 -6
- data/example/consumer/app/controllers/application_controller.rb +0 -2
- data/example/consumer/app/controllers/concerns/.keep +0 -0
- data/example/consumer/app/jobs/application_job.rb +0 -7
- data/example/consumer/app/mailers/application_mailer.rb +0 -4
- data/example/consumer/app/models/application_record.rb +0 -3
- data/example/consumer/app/models/concerns/.keep +0 -0
- data/example/consumer/app/models/person.rb +0 -9
- data/example/consumer/app/views/layouts/mailer.html.erb +0 -13
- data/example/consumer/app/views/layouts/mailer.text.erb +0 -1
- data/example/consumer/bin/brakeman +0 -7
- data/example/consumer/bin/bundle +0 -109
- data/example/consumer/bin/dev +0 -2
- data/example/consumer/bin/docker-entrypoint +0 -14
- data/example/consumer/bin/jobs +0 -6
- data/example/consumer/bin/kamal +0 -27
- data/example/consumer/bin/rails +0 -4
- data/example/consumer/bin/rake +0 -4
- data/example/consumer/bin/rubocop +0 -8
- data/example/consumer/bin/setup +0 -34
- data/example/consumer/bin/thrust +0 -5
- data/example/consumer/config/application.rb +0 -20
- data/example/consumer/config/boot.rb +0 -3
- data/example/consumer/config/cache.yml +0 -16
- data/example/consumer/config/credentials.yml.enc +0 -1
- data/example/consumer/config/database.yml +0 -14
- data/example/consumer/config/deploy.yml +0 -116
- data/example/consumer/config/environment.rb +0 -5
- data/example/consumer/config/environments/development.rb +0 -64
- data/example/consumer/config/environments/production.rb +0 -85
- data/example/consumer/config/environments/test.rb +0 -50
- data/example/consumer/config/initializers/cors.rb +0 -16
- data/example/consumer/config/initializers/filter_parameter_logging.rb +0 -8
- data/example/consumer/config/initializers/inflections.rb +0 -16
- data/example/consumer/config/locales/en.yml +0 -31
- data/example/consumer/config/puma.rb +0 -41
- data/example/consumer/config/queue.yml +0 -18
- data/example/consumer/config/recurring.yml +0 -10
- data/example/consumer/config/routes.rb +0 -10
- data/example/consumer/config.ru +0 -6
- data/example/consumer/db/cache_schema.rb +0 -14
- data/example/consumer/db/queue_schema.rb +0 -129
- data/example/consumer/db/seeds.rb +0 -0
- data/example/consumer/lib/tasks/.keep +0 -0
- data/example/consumer/log/.keep +0 -0
- data/example/consumer/public/robots.txt +0 -1
- data/example/consumer/script/.keep +0 -0
- data/example/consumer/storage/.keep +0 -0
- data/example/consumer/tmp/.keep +0 -0
- data/example/consumer/tmp/cache/.keep +0 -0
- data/example/consumer/tmp/pids/.keep +0 -0
- data/example/consumer/tmp/storage/.keep +0 -0
- data/example/consumer/vendor/.keep +0 -0
- data/example/provider/.dockerignore +0 -41
- data/example/provider/.gitattributes +0 -9
- data/example/provider/.gitignore +0 -32
- data/example/provider/.kamal/hooks/docker-setup.sample +0 -3
- data/example/provider/.kamal/hooks/post-deploy.sample +0 -14
- data/example/provider/.kamal/hooks/post-proxy-reboot.sample +0 -3
- data/example/provider/.kamal/hooks/pre-build.sample +0 -51
- data/example/provider/.kamal/hooks/pre-connect.sample +0 -47
- data/example/provider/.kamal/hooks/pre-deploy.sample +0 -109
- data/example/provider/.kamal/hooks/pre-proxy-reboot.sample +0 -3
- data/example/provider/.kamal/secrets +0 -17
- data/example/provider/Dockerfile +0 -65
- data/example/provider/Gemfile +0 -14
- data/example/provider/Rakefile +0 -6
- data/example/provider/app/controllers/application_controller.rb +0 -2
- data/example/provider/app/controllers/concerns/.keep +0 -0
- data/example/provider/app/controllers/people_controller.rb +0 -68
- data/example/provider/app/jobs/application_job.rb +0 -7
- data/example/provider/app/mailers/application_mailer.rb +0 -4
- data/example/provider/app/models/address.rb +0 -3
- data/example/provider/app/models/application_record.rb +0 -3
- data/example/provider/app/models/company.rb +0 -3
- data/example/provider/app/models/concerns/.keep +0 -0
- data/example/provider/app/models/person.rb +0 -6
- data/example/provider/app/views/layouts/mailer.html.erb +0 -13
- data/example/provider/app/views/layouts/mailer.text.erb +0 -1
- data/example/provider/bin/brakeman +0 -7
- data/example/provider/bin/bundle +0 -109
- data/example/provider/bin/dev +0 -2
- data/example/provider/bin/docker-entrypoint +0 -14
- data/example/provider/bin/jobs +0 -6
- data/example/provider/bin/kamal +0 -27
- data/example/provider/bin/rails +0 -4
- data/example/provider/bin/rake +0 -4
- data/example/provider/bin/rubocop +0 -8
- data/example/provider/bin/setup +0 -34
- data/example/provider/bin/thrust +0 -5
- data/example/provider/config/application.rb +0 -44
- data/example/provider/config/boot.rb +0 -3
- data/example/provider/config/cache.yml +0 -16
- data/example/provider/config/credentials.yml.enc +0 -1
- data/example/provider/config/database.yml +0 -20
- data/example/provider/config/deploy.yml +0 -116
- data/example/provider/config/environment.rb +0 -5
- data/example/provider/config/environments/development.rb +0 -64
- data/example/provider/config/environments/production.rb +0 -85
- data/example/provider/config/environments/test.rb +0 -50
- data/example/provider/config/initializers/cors.rb +0 -16
- data/example/provider/config/initializers/filter_parameter_logging.rb +0 -8
- data/example/provider/config/initializers/inflections.rb +0 -16
- data/example/provider/config/locales/en.yml +0 -31
- data/example/provider/config/puma.rb +0 -41
- data/example/provider/config/queue.yml +0 -18
- data/example/provider/config/recurring.yml +0 -10
- data/example/provider/config/routes.rb +0 -4
- data/example/provider/config.ru +0 -6
- data/example/provider/db/cache_schema.rb +0 -14
- data/example/provider/db/migrate/20241202183937_create_people.rb +0 -11
- data/example/provider/db/migrate/20241202183955_create_addresses.rb +0 -13
- data/example/provider/db/migrate/20241202184017_create_companies.rb +0 -14
- data/example/provider/db/queue_schema.rb +0 -129
- data/example/provider/db/schema.rb +0 -47
- data/example/provider/db/seeds.rb +0 -18
- data/example/provider/lib/tasks/.keep +0 -0
- data/example/provider/log/.keep +0 -0
- data/example/provider/public/robots.txt +0 -1
- data/example/provider/script/.keep +0 -0
- data/example/provider/storage/.keep +0 -0
- data/example/provider/tmp/.keep +0 -0
- data/example/provider/tmp/pids/.keep +0 -0
- data/example/provider/tmp/storage/.keep +0 -0
- data/example/provider/vendor/.keep +0 -0
- data/lib/activeresource/.gitignore +0 -15
- data/lib/activeresource/examples/performance.rb +0 -72
- data/lib/activeresource/test/abstract_unit.rb +0 -153
- data/lib/activeresource/test/cases/active_job_serializer_test.rb +0 -53
- data/lib/activeresource/test/cases/association_test.rb +0 -104
- data/lib/activeresource/test/cases/associations/builder/belongs_to_test.rb +0 -42
- data/lib/activeresource/test/cases/associations/builder/has_many_test.rb +0 -28
- data/lib/activeresource/test/cases/associations/builder/has_one_test.rb +0 -28
- data/lib/activeresource/test/cases/authorization_test.rb +0 -276
- data/lib/activeresource/test/cases/base/custom_methods_test.rb +0 -155
- data/lib/activeresource/test/cases/base/equality_test.rb +0 -53
- data/lib/activeresource/test/cases/base/load_test.rb +0 -249
- data/lib/activeresource/test/cases/base/schema_test.rb +0 -428
- data/lib/activeresource/test/cases/base_errors_test.rb +0 -129
- data/lib/activeresource/test/cases/base_test.rb +0 -1622
- data/lib/activeresource/test/cases/callbacks_test.rb +0 -155
- data/lib/activeresource/test/cases/collection_test.rb +0 -172
- data/lib/activeresource/test/cases/connection_test.rb +0 -357
- data/lib/activeresource/test/cases/finder_test.rb +0 -217
- data/lib/activeresource/test/cases/format_test.rb +0 -137
- data/lib/activeresource/test/cases/http_mock_test.rb +0 -213
- data/lib/activeresource/test/cases/inheritence_test.rb +0 -19
- data/lib/activeresource/test/cases/inheriting_hash_test.rb +0 -25
- data/lib/activeresource/test/cases/log_subscriber_test.rb +0 -63
- data/lib/activeresource/test/cases/reflection_test.rb +0 -65
- data/lib/activeresource/test/cases/validations_test.rb +0 -78
- data/lib/activeresource/test/fixtures/address.rb +0 -20
- data/lib/activeresource/test/fixtures/beast.rb +0 -16
- data/lib/activeresource/test/fixtures/comment.rb +0 -5
- data/lib/activeresource/test/fixtures/customer.rb +0 -5
- data/lib/activeresource/test/fixtures/inventory.rb +0 -14
- data/lib/activeresource/test/fixtures/person.rb +0 -15
- data/lib/activeresource/test/fixtures/pet.rb +0 -6
- data/lib/activeresource/test/fixtures/post.rb +0 -5
- data/lib/activeresource/test/fixtures/product.rb +0 -11
- data/lib/activeresource/test/fixtures/project.rb +0 -19
- data/lib/activeresource/test/fixtures/proxy.rb +0 -6
- data/lib/activeresource/test/fixtures/sound.rb +0 -11
- data/lib/activeresource/test/fixtures/street_address.rb +0 -6
- data/lib/activeresource/test/fixtures/subscription_plan.rb +0 -7
- data/lib/activeresource/test/fixtures/weather.rb +0 -21
- data/lib/activeresource/test/setter_trap.rb +0 -28
- data/lib/activeresource/test/singleton_test.rb +0 -138
- data/lib/activeresource/test/threadsafe_attributes_test.rb +0 -91
- data/sorbet/config +0 -4
- data/sorbet/rbi/annotations/.gitattributes +0 -1
- data/sorbet/rbi/annotations/activemodel.rbi +0 -89
- data/sorbet/rbi/annotations/activesupport.rbi +0 -457
- data/sorbet/rbi/annotations/minitest.rbi +0 -119
- data/sorbet/rbi/annotations/rainbow.rbi +0 -269
- data/sorbet/rbi/dsl/.gitattributes +0 -1
- data/sorbet/rbi/dsl/active_support/callbacks.rbi +0 -21
- data/sorbet/rbi/gems/.gitattributes +0 -1
- data/sorbet/rbi/gems/actioncable@8.0.0.rbi +0 -252
- data/sorbet/rbi/gems/actionmailbox@8.0.0.rbi +0 -9
- data/sorbet/rbi/gems/actionmailer@8.0.0.rbi +0 -9
- data/sorbet/rbi/gems/actionpack@8.0.0.rbi +0 -20909
- data/sorbet/rbi/gems/actiontext@8.0.0.rbi +0 -9
- data/sorbet/rbi/gems/actionview@8.0.0.rbi +0 -16207
- data/sorbet/rbi/gems/activejob@8.0.0.rbi +0 -9
- data/sorbet/rbi/gems/activemodel-serializers-xml@1.0.3.rbi +0 -166
- data/sorbet/rbi/gems/activemodel@8.0.0.rbi +0 -6857
- data/sorbet/rbi/gems/activerecord@8.0.0.rbi +0 -42896
- data/sorbet/rbi/gems/activeresource@6.1.4.rbi +0 -3944
- data/sorbet/rbi/gems/activestorage@8.0.0.rbi +0 -9
- data/sorbet/rbi/gems/activesupport@8.0.0.rbi +0 -21251
- data/sorbet/rbi/gems/ast@2.4.2.rbi +0 -585
- data/sorbet/rbi/gems/base64@0.2.0.rbi +0 -509
- data/sorbet/rbi/gems/benchmark@0.4.0.rbi +0 -618
- data/sorbet/rbi/gems/bigdecimal@3.1.8.rbi +0 -78
- data/sorbet/rbi/gems/builder@3.3.0.rbi +0 -9
- data/sorbet/rbi/gems/bump@0.10.0.rbi +0 -169
- data/sorbet/rbi/gems/byebug@11.1.3.rbi +0 -3607
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +0 -3427
- data/sorbet/rbi/gems/concurrent-ruby@1.3.4.rbi +0 -11645
- data/sorbet/rbi/gems/connection_pool@2.4.1.rbi +0 -9
- data/sorbet/rbi/gems/crass@1.0.6.rbi +0 -623
- data/sorbet/rbi/gems/date@3.4.0.rbi +0 -75
- data/sorbet/rbi/gems/diff-lcs@1.5.1.rbi +0 -1131
- data/sorbet/rbi/gems/docile@1.4.1.rbi +0 -377
- data/sorbet/rbi/gems/drb@2.2.1.rbi +0 -1347
- data/sorbet/rbi/gems/erubi@1.13.0.rbi +0 -150
- data/sorbet/rbi/gems/globalid@1.2.1.rbi +0 -9
- data/sorbet/rbi/gems/i18n@1.14.6.rbi +0 -2359
- data/sorbet/rbi/gems/io-console@0.7.2.rbi +0 -9
- data/sorbet/rbi/gems/json@2.8.2.rbi +0 -1901
- data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +0 -14238
- data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +0 -240
- data/sorbet/rbi/gems/logger@1.6.1.rbi +0 -920
- data/sorbet/rbi/gems/loofah@2.23.1.rbi +0 -1081
- data/sorbet/rbi/gems/mail@2.8.1.rbi +0 -9
- data/sorbet/rbi/gems/marcel@1.0.4.rbi +0 -9
- data/sorbet/rbi/gems/method_source@1.1.0.rbi +0 -304
- data/sorbet/rbi/gems/mini_mime@1.1.5.rbi +0 -9
- data/sorbet/rbi/gems/minitest@5.25.2.rbi +0 -1547
- data/sorbet/rbi/gems/net-imap@0.5.1.rbi +0 -9
- data/sorbet/rbi/gems/net-pop@0.1.2.rbi +0 -9
- data/sorbet/rbi/gems/net-protocol@0.2.2.rbi +0 -292
- data/sorbet/rbi/gems/net-smtp@0.5.0.rbi +0 -9
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +0 -159
- data/sorbet/rbi/gems/nio4r@2.7.4.rbi +0 -9
- data/sorbet/rbi/gems/nokogiri@1.16.7.rbi +0 -7311
- data/sorbet/rbi/gems/parallel@1.26.3.rbi +0 -291
- data/sorbet/rbi/gems/parser@3.3.6.0.rbi +0 -5519
- data/sorbet/rbi/gems/prism@1.2.0.rbi +0 -39085
- data/sorbet/rbi/gems/pry-byebug@3.10.1.rbi +0 -1151
- data/sorbet/rbi/gems/pry@0.14.2.rbi +0 -10076
- data/sorbet/rbi/gems/psych@5.2.0.rbi +0 -1785
- data/sorbet/rbi/gems/racc@1.8.1.rbi +0 -162
- data/sorbet/rbi/gems/rack-session@2.0.0.rbi +0 -727
- data/sorbet/rbi/gems/rack-test@2.1.0.rbi +0 -747
- data/sorbet/rbi/gems/rack@3.1.8.rbi +0 -4905
- data/sorbet/rbi/gems/rackup@2.2.1.rbi +0 -230
- data/sorbet/rbi/gems/rails-dom-testing@2.2.0.rbi +0 -758
- data/sorbet/rbi/gems/rails-html-sanitizer@1.6.0.rbi +0 -785
- data/sorbet/rbi/gems/rails@8.0.0.rbi +0 -9
- data/sorbet/rbi/gems/railties@8.0.0.rbi +0 -6287
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +0 -403
- data/sorbet/rbi/gems/rake@13.2.1.rbi +0 -3091
- data/sorbet/rbi/gems/rbi@0.2.1.rbi +0 -4535
- data/sorbet/rbi/gems/rdoc@6.8.1.rbi +0 -12572
- data/sorbet/rbi/gems/regexp_parser@2.9.2.rbi +0 -3772
- data/sorbet/rbi/gems/reline@0.5.12.rbi +0 -2416
- data/sorbet/rbi/gems/rexml@3.3.9.rbi +0 -4858
- data/sorbet/rbi/gems/rspec-core@3.13.2.rbi +0 -11287
- data/sorbet/rbi/gems/rspec-expectations@3.13.3.rbi +0 -8183
- data/sorbet/rbi/gems/rspec-mocks@3.13.2.rbi +0 -5341
- data/sorbet/rbi/gems/rspec-support@3.13.1.rbi +0 -1630
- data/sorbet/rbi/gems/rspec@3.13.0.rbi +0 -83
- data/sorbet/rbi/gems/rubocop-ast@1.36.1.rbi +0 -7303
- data/sorbet/rbi/gems/rubocop-performance@1.21.1.rbi +0 -9
- data/sorbet/rbi/gems/rubocop@1.65.1.rbi +0 -58170
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +0 -1318
- data/sorbet/rbi/gems/securerandom@0.3.2.rbi +0 -395
- data/sorbet/rbi/gems/simplecov-html@0.13.1.rbi +0 -225
- data/sorbet/rbi/gems/simplecov@0.22.0.rbi +0 -2149
- data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +0 -9
- data/sorbet/rbi/gems/spoom@1.5.0.rbi +0 -4932
- data/sorbet/rbi/gems/standard-custom@1.0.2.rbi +0 -9
- data/sorbet/rbi/gems/standard-performance@1.4.0.rbi +0 -9
- data/sorbet/rbi/gems/standard@1.40.0.rbi +0 -929
- data/sorbet/rbi/gems/stringio@3.1.2.rbi +0 -9
- data/sorbet/rbi/gems/tapioca@0.16.4.rbi +0 -3597
- data/sorbet/rbi/gems/thor@1.3.2.rbi +0 -4378
- data/sorbet/rbi/gems/timeout@0.4.2.rbi +0 -151
- data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +0 -5918
- data/sorbet/rbi/gems/unicode-display_width@2.6.0.rbi +0 -66
- data/sorbet/rbi/gems/uri@1.0.2.rbi +0 -2377
- data/sorbet/rbi/gems/useragent@0.16.10.rbi +0 -9
- data/sorbet/rbi/gems/websocket-driver@0.7.6.rbi +0 -9
- data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +0 -9
- data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +0 -435
- data/sorbet/rbi/gems/yard@0.9.37.rbi +0 -18504
- data/sorbet/rbi/gems/zeitwerk@2.7.1.rbi +0 -9
- data/sorbet/tapioca/config.yml +0 -13
- data/sorbet/tapioca/require.rb +0 -12
@@ -1,377 +0,0 @@
|
|
1
|
-
# typed: true
|
2
|
-
|
3
|
-
# DO NOT EDIT MANUALLY
|
4
|
-
# This is an autogenerated file for types exported from the `docile` gem.
|
5
|
-
# Please instead update this file by running `bin/tapioca gem docile`.
|
6
|
-
|
7
|
-
|
8
|
-
# Docile keeps your Ruby DSLs tame and well-behaved.
|
9
|
-
#
|
10
|
-
# source://docile//lib/docile/version.rb#3
|
11
|
-
module Docile
|
12
|
-
extend ::Docile::Execution
|
13
|
-
|
14
|
-
private
|
15
|
-
|
16
|
-
# Execute a block in the context of an object whose methods represent the
|
17
|
-
# commands in a DSL.
|
18
|
-
#
|
19
|
-
# Use this method to execute an *imperative* DSL, which means that:
|
20
|
-
#
|
21
|
-
# 1. Each command mutates the state of the DSL context object
|
22
|
-
# 2. The return value of each command is ignored
|
23
|
-
# 3. The final return value is the original context object
|
24
|
-
#
|
25
|
-
# @example Use a String as a DSL
|
26
|
-
# Docile.dsl_eval("Hello, world!") do
|
27
|
-
# reverse!
|
28
|
-
# upcase!
|
29
|
-
# end
|
30
|
-
# #=> "!DLROW ,OLLEH"
|
31
|
-
# @example Use an Array as a DSL
|
32
|
-
# Docile.dsl_eval([]) do
|
33
|
-
# push 1
|
34
|
-
# push 2
|
35
|
-
# pop
|
36
|
-
# push 3
|
37
|
-
# end
|
38
|
-
# #=> [1, 3]
|
39
|
-
# @note Use with an *imperative* DSL (commands modify the context object)
|
40
|
-
# @param dsl [Object] context object whose methods make up the DSL
|
41
|
-
# @param args [Array] arguments to be passed to the block
|
42
|
-
# @param block [Proc] the block of DSL commands to be executed against the
|
43
|
-
# `dsl` context object
|
44
|
-
# @return [Object] the `dsl` context object after executing the block
|
45
|
-
#
|
46
|
-
# source://docile//lib/docile.rb#45
|
47
|
-
def dsl_eval(dsl, *args, **_arg2, &block); end
|
48
|
-
|
49
|
-
# Execute a block in the context of an immutable object whose methods,
|
50
|
-
# and the methods of their return values, represent the commands in a DSL.
|
51
|
-
#
|
52
|
-
# Use this method to execute a *functional* DSL, which means that:
|
53
|
-
#
|
54
|
-
# 1. The original DSL context object is never mutated
|
55
|
-
# 2. Each command returns the next DSL context object
|
56
|
-
# 3. The final return value is the value returned by the last command
|
57
|
-
#
|
58
|
-
# @example Use a frozen String as a DSL
|
59
|
-
# Docile.dsl_eval_immutable("I'm immutable!".freeze) do
|
60
|
-
# reverse
|
61
|
-
# upcase
|
62
|
-
# end
|
63
|
-
# #=> "!ELBATUMMI M'I"
|
64
|
-
# @example Use a Float as a DSL
|
65
|
-
# Docile.dsl_eval_immutable(84.5) do
|
66
|
-
# fdiv(2)
|
67
|
-
# floor
|
68
|
-
# end
|
69
|
-
# #=> 42
|
70
|
-
# @note Use with a *functional* DSL (commands return successor
|
71
|
-
# context objects)
|
72
|
-
# @param dsl [Object] immutable context object whose methods make up the
|
73
|
-
# initial DSL
|
74
|
-
# @param args [Array] arguments to be passed to the block
|
75
|
-
# @param block [Proc] the block of DSL commands to be executed against the
|
76
|
-
# `dsl` context object and successor return values
|
77
|
-
# @return [Object] the return value of the final command in the block
|
78
|
-
#
|
79
|
-
# source://docile//lib/docile.rb#128
|
80
|
-
def dsl_eval_immutable(dsl, *args, **_arg2, &block); end
|
81
|
-
|
82
|
-
# Execute a block in the context of an object whose methods represent the
|
83
|
-
# commands in a DSL, and return *the block's return value*.
|
84
|
-
#
|
85
|
-
# Use this method to execute an *imperative* DSL, which means that:
|
86
|
-
#
|
87
|
-
# 1. Each command mutates the state of the DSL context object
|
88
|
-
# 2. The return value of each command is ignored
|
89
|
-
# 3. The final return value is the original context object
|
90
|
-
#
|
91
|
-
# @example Use a String as a DSL
|
92
|
-
# Docile.dsl_eval_with_block_return("Hello, world!") do
|
93
|
-
# reverse!
|
94
|
-
# upcase!
|
95
|
-
# first
|
96
|
-
# end
|
97
|
-
# #=> "!"
|
98
|
-
# @example Use an Array as a DSL
|
99
|
-
# Docile.dsl_eval_with_block_return([]) do
|
100
|
-
# push "a"
|
101
|
-
# push "b"
|
102
|
-
# pop
|
103
|
-
# push "c"
|
104
|
-
# length
|
105
|
-
# end
|
106
|
-
# #=> 2
|
107
|
-
# @note Use with an *imperative* DSL (commands modify the context object)
|
108
|
-
# @param dsl [Object] context object whose methods make up the DSL
|
109
|
-
# @param args [Array] arguments to be passed to the block
|
110
|
-
# @param block [Proc] the block of DSL commands to be executed against the
|
111
|
-
# `dsl` context object
|
112
|
-
# @return [Object] the return value from executing the block
|
113
|
-
#
|
114
|
-
# source://docile//lib/docile.rb#87
|
115
|
-
def dsl_eval_with_block_return(dsl, *args, **_arg2, &block); end
|
116
|
-
|
117
|
-
class << self
|
118
|
-
# Execute a block in the context of an object whose methods represent the
|
119
|
-
# commands in a DSL.
|
120
|
-
#
|
121
|
-
# Use this method to execute an *imperative* DSL, which means that:
|
122
|
-
#
|
123
|
-
# 1. Each command mutates the state of the DSL context object
|
124
|
-
# 2. The return value of each command is ignored
|
125
|
-
# 3. The final return value is the original context object
|
126
|
-
#
|
127
|
-
# @example Use a String as a DSL
|
128
|
-
# Docile.dsl_eval("Hello, world!") do
|
129
|
-
# reverse!
|
130
|
-
# upcase!
|
131
|
-
# end
|
132
|
-
# #=> "!DLROW ,OLLEH"
|
133
|
-
# @example Use an Array as a DSL
|
134
|
-
# Docile.dsl_eval([]) do
|
135
|
-
# push 1
|
136
|
-
# push 2
|
137
|
-
# pop
|
138
|
-
# push 3
|
139
|
-
# end
|
140
|
-
# #=> [1, 3]
|
141
|
-
# @note Use with an *imperative* DSL (commands modify the context object)
|
142
|
-
# @param dsl [Object] context object whose methods make up the DSL
|
143
|
-
# @param args [Array] arguments to be passed to the block
|
144
|
-
# @param block [Proc] the block of DSL commands to be executed against the
|
145
|
-
# `dsl` context object
|
146
|
-
# @return [Object] the `dsl` context object after executing the block
|
147
|
-
#
|
148
|
-
# source://docile//lib/docile.rb#45
|
149
|
-
def dsl_eval(dsl, *args, **_arg2, &block); end
|
150
|
-
|
151
|
-
# Execute a block in the context of an immutable object whose methods,
|
152
|
-
# and the methods of their return values, represent the commands in a DSL.
|
153
|
-
#
|
154
|
-
# Use this method to execute a *functional* DSL, which means that:
|
155
|
-
#
|
156
|
-
# 1. The original DSL context object is never mutated
|
157
|
-
# 2. Each command returns the next DSL context object
|
158
|
-
# 3. The final return value is the value returned by the last command
|
159
|
-
#
|
160
|
-
# @example Use a frozen String as a DSL
|
161
|
-
# Docile.dsl_eval_immutable("I'm immutable!".freeze) do
|
162
|
-
# reverse
|
163
|
-
# upcase
|
164
|
-
# end
|
165
|
-
# #=> "!ELBATUMMI M'I"
|
166
|
-
# @example Use a Float as a DSL
|
167
|
-
# Docile.dsl_eval_immutable(84.5) do
|
168
|
-
# fdiv(2)
|
169
|
-
# floor
|
170
|
-
# end
|
171
|
-
# #=> 42
|
172
|
-
# @note Use with a *functional* DSL (commands return successor
|
173
|
-
# context objects)
|
174
|
-
# @param dsl [Object] immutable context object whose methods make up the
|
175
|
-
# initial DSL
|
176
|
-
# @param args [Array] arguments to be passed to the block
|
177
|
-
# @param block [Proc] the block of DSL commands to be executed against the
|
178
|
-
# `dsl` context object and successor return values
|
179
|
-
# @return [Object] the return value of the final command in the block
|
180
|
-
#
|
181
|
-
# source://docile//lib/docile.rb#128
|
182
|
-
def dsl_eval_immutable(dsl, *args, **_arg2, &block); end
|
183
|
-
|
184
|
-
# Execute a block in the context of an object whose methods represent the
|
185
|
-
# commands in a DSL, and return *the block's return value*.
|
186
|
-
#
|
187
|
-
# Use this method to execute an *imperative* DSL, which means that:
|
188
|
-
#
|
189
|
-
# 1. Each command mutates the state of the DSL context object
|
190
|
-
# 2. The return value of each command is ignored
|
191
|
-
# 3. The final return value is the original context object
|
192
|
-
#
|
193
|
-
# @example Use a String as a DSL
|
194
|
-
# Docile.dsl_eval_with_block_return("Hello, world!") do
|
195
|
-
# reverse!
|
196
|
-
# upcase!
|
197
|
-
# first
|
198
|
-
# end
|
199
|
-
# #=> "!"
|
200
|
-
# @example Use an Array as a DSL
|
201
|
-
# Docile.dsl_eval_with_block_return([]) do
|
202
|
-
# push "a"
|
203
|
-
# push "b"
|
204
|
-
# pop
|
205
|
-
# push "c"
|
206
|
-
# length
|
207
|
-
# end
|
208
|
-
# #=> 2
|
209
|
-
# @note Use with an *imperative* DSL (commands modify the context object)
|
210
|
-
# @param dsl [Object] context object whose methods make up the DSL
|
211
|
-
# @param args [Array] arguments to be passed to the block
|
212
|
-
# @param block [Proc] the block of DSL commands to be executed against the
|
213
|
-
# `dsl` context object
|
214
|
-
# @return [Object] the return value from executing the block
|
215
|
-
#
|
216
|
-
# source://docile//lib/docile.rb#87
|
217
|
-
def dsl_eval_with_block_return(dsl, *args, **_arg2, &block); end
|
218
|
-
end
|
219
|
-
end
|
220
|
-
|
221
|
-
# This is used to remove entries pointing to Docile's source files
|
222
|
-
# from {Exception#backtrace} and {Exception#backtrace_locations}.
|
223
|
-
#
|
224
|
-
# If {NoMethodError} is caught then the exception object will be extended
|
225
|
-
# by this module to add filter functionalities.
|
226
|
-
#
|
227
|
-
# @api private
|
228
|
-
#
|
229
|
-
# source://docile//lib/docile/backtrace_filter.rb#11
|
230
|
-
module Docile::BacktraceFilter
|
231
|
-
# @api private
|
232
|
-
#
|
233
|
-
# source://docile//lib/docile/backtrace_filter.rb#14
|
234
|
-
def backtrace; end
|
235
|
-
|
236
|
-
# @api private
|
237
|
-
#
|
238
|
-
# source://docile//lib/docile/backtrace_filter.rb#19
|
239
|
-
def backtrace_locations; end
|
240
|
-
end
|
241
|
-
|
242
|
-
# @api private
|
243
|
-
#
|
244
|
-
# source://docile//lib/docile/backtrace_filter.rb#12
|
245
|
-
Docile::BacktraceFilter::FILTER_PATTERN = T.let(T.unsafe(nil), Regexp)
|
246
|
-
|
247
|
-
# Operates in the same manner as {FallbackContextProxy}, but replacing
|
248
|
-
# the primary `receiver` object with the result of each proxied method.
|
249
|
-
#
|
250
|
-
# This is useful for implementing DSL evaluation for immutable context
|
251
|
-
# objects.
|
252
|
-
#
|
253
|
-
#
|
254
|
-
# @api private
|
255
|
-
# @see Docile.dsl_eval_immutable
|
256
|
-
#
|
257
|
-
# source://docile//lib/docile/chaining_fallback_context_proxy.rb#17
|
258
|
-
class Docile::ChainingFallbackContextProxy < ::Docile::FallbackContextProxy
|
259
|
-
# Proxy methods as in {FallbackContextProxy#method_missing}, replacing
|
260
|
-
# `receiver` with the returned value.
|
261
|
-
#
|
262
|
-
# @api private
|
263
|
-
#
|
264
|
-
# source://docile//lib/docile/chaining_fallback_context_proxy.rb#20
|
265
|
-
def method_missing(method, *args, **_arg2, &block); end
|
266
|
-
end
|
267
|
-
|
268
|
-
# A namespace for functions relating to the execution of a block against a
|
269
|
-
# proxy object.
|
270
|
-
#
|
271
|
-
# @api private
|
272
|
-
#
|
273
|
-
# source://docile//lib/docile/execution.rb#8
|
274
|
-
module Docile::Execution
|
275
|
-
private
|
276
|
-
|
277
|
-
# Execute a block in the context of an object whose methods represent the
|
278
|
-
# commands in a DSL, using a specific proxy class.
|
279
|
-
#
|
280
|
-
# @api private
|
281
|
-
# @param dsl [Object] context object whose methods make up the
|
282
|
-
# (initial) DSL
|
283
|
-
# @param proxy_type [FallbackContextProxy, ChainingFallbackContextProxy] which class to instantiate as proxy context
|
284
|
-
# @param args [Array] arguments to be passed to the block
|
285
|
-
# @param block [Proc] the block of DSL commands to be executed
|
286
|
-
# @return [Object] the return value of the block
|
287
|
-
#
|
288
|
-
# source://docile//lib/docile/execution.rb#19
|
289
|
-
def exec_in_proxy_context(dsl, proxy_type, *args, **_arg3, &block); end
|
290
|
-
|
291
|
-
class << self
|
292
|
-
# Execute a block in the context of an object whose methods represent the
|
293
|
-
# commands in a DSL, using a specific proxy class.
|
294
|
-
#
|
295
|
-
# @api private
|
296
|
-
# @param dsl [Object] context object whose methods make up the
|
297
|
-
# (initial) DSL
|
298
|
-
# @param proxy_type [FallbackContextProxy, ChainingFallbackContextProxy] which class to instantiate as proxy context
|
299
|
-
# @param args [Array] arguments to be passed to the block
|
300
|
-
# @param block [Proc] the block of DSL commands to be executed
|
301
|
-
# @return [Object] the return value of the block
|
302
|
-
#
|
303
|
-
# source://docile//lib/docile/execution.rb#19
|
304
|
-
def exec_in_proxy_context(dsl, proxy_type, *args, **_arg3, &block); end
|
305
|
-
end
|
306
|
-
end
|
307
|
-
|
308
|
-
# A proxy object with a primary receiver as well as a secondary
|
309
|
-
# fallback receiver.
|
310
|
-
#
|
311
|
-
# Will attempt to forward all method calls first to the primary receiver,
|
312
|
-
# and then to the fallback receiver if the primary does not handle that
|
313
|
-
# method.
|
314
|
-
#
|
315
|
-
# This is useful for implementing DSL evaluation in the context of an object.
|
316
|
-
#
|
317
|
-
#
|
318
|
-
# @api private
|
319
|
-
# @see Docile.dsl_eval
|
320
|
-
#
|
321
|
-
# source://docile//lib/docile/fallback_context_proxy.rb#20
|
322
|
-
class Docile::FallbackContextProxy
|
323
|
-
# @api private
|
324
|
-
# @param receiver [Object] the primary proxy target to which all methods
|
325
|
-
# initially will be forwarded
|
326
|
-
# @param fallback [Object] the fallback proxy target to which any methods
|
327
|
-
# not handled by `receiver` will be forwarded
|
328
|
-
# @return [FallbackContextProxy] a new instance of FallbackContextProxy
|
329
|
-
#
|
330
|
-
# source://docile//lib/docile/fallback_context_proxy.rb#46
|
331
|
-
def initialize(receiver, fallback); end
|
332
|
-
|
333
|
-
# @api private
|
334
|
-
# @return [Array<Symbol>] Instance variable names, excluding
|
335
|
-
# {NON_PROXIED_INSTANCE_VARIABLES}
|
336
|
-
#
|
337
|
-
# source://docile//lib/docile/fallback_context_proxy.rb#85
|
338
|
-
def instance_variables; end
|
339
|
-
|
340
|
-
# Proxy all methods, excluding {NON_PROXIED_METHODS}, first to `receiver`
|
341
|
-
# and then to `fallback` if not found.
|
342
|
-
#
|
343
|
-
# @api private
|
344
|
-
#
|
345
|
-
# source://docile//lib/docile/fallback_context_proxy.rb#91
|
346
|
-
def method_missing(method, *args, **_arg2, &block); end
|
347
|
-
end
|
348
|
-
|
349
|
-
# The set of methods which will **not** fallback from the block's context
|
350
|
-
# to the dsl object.
|
351
|
-
#
|
352
|
-
# @api private
|
353
|
-
#
|
354
|
-
# source://docile//lib/docile/fallback_context_proxy.rb#30
|
355
|
-
Docile::FallbackContextProxy::NON_FALLBACK_METHODS = T.let(T.unsafe(nil), Set)
|
356
|
-
|
357
|
-
# The set of instance variables which are local to this object and hidden.
|
358
|
-
# All other instance variables will be copied in and out of this object
|
359
|
-
# from the scope in which this proxy was created.
|
360
|
-
#
|
361
|
-
# @api private
|
362
|
-
#
|
363
|
-
# source://docile//lib/docile/fallback_context_proxy.rb#35
|
364
|
-
Docile::FallbackContextProxy::NON_PROXIED_INSTANCE_VARIABLES = T.let(T.unsafe(nil), Set)
|
365
|
-
|
366
|
-
# The set of methods which will **not** be proxied, but instead answered
|
367
|
-
# by this object directly.
|
368
|
-
#
|
369
|
-
# @api private
|
370
|
-
#
|
371
|
-
# source://docile//lib/docile/fallback_context_proxy.rb#23
|
372
|
-
Docile::FallbackContextProxy::NON_PROXIED_METHODS = T.let(T.unsafe(nil), Set)
|
373
|
-
|
374
|
-
# The current version of this library
|
375
|
-
#
|
376
|
-
# source://docile//lib/docile/version.rb#5
|
377
|
-
Docile::VERSION = T.let(T.unsafe(nil), String)
|