acfs 2.2.1 → 3.0.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/acfs.gemspec +4 -4
- data/lib/acfs/errors.rb +6 -6
- data/lib/acfs/global.rb +3 -1
- data/lib/acfs/resource/attributes.rb +5 -6
- data/lib/acfs/resource/locatable.rb +4 -4
- data/lib/acfs/resource/persistence.rb +7 -7
- data/lib/acfs/resource/service.rb +2 -2
- data/lib/acfs/runner.rb +5 -0
- data/lib/acfs/version.rb +3 -3
- data/spec/acfs/adapter/typhoeus_spec.rb +2 -1
- data/spec/acfs/global_spec.rb +21 -2
- data/spec/acfs/runner_spec.rb +16 -2
- data/vendor/bundle/ruby/4.0.0/bundler/gems/{rubocop-config-2b861962124a → rubocop-config-9832479830d9}/README.md +3 -3
- data/vendor/bundle/ruby/4.0.0/bundler/gems/{rubocop-config-2b861962124a → rubocop-config-9832479830d9}/rubocop-config.gemspec +8 -8
- data/vendor/bundle/ruby/4.0.0/gems/{actionpack-8.1.3 → actionpack-8.1.4.1}/CHANGELOG.md +216 -0
- data/vendor/bundle/ruby/4.0.0/gems/{actionview-8.1.3 → actionview-8.1.4.1}/CHANGELOG.md +107 -0
- data/vendor/bundle/ruby/4.0.0/gems/{activemodel-8.1.3 → activemodel-8.1.4.1}/CHANGELOG.md +48 -0
- data/vendor/bundle/ruby/4.0.0/gems/{activesupport-8.1.3 → activesupport-8.1.4.1}/CHANGELOG.md +242 -0
- data/vendor/bundle/ruby/4.0.0/gems/{addressable-2.9.0 → addressable-2.9.2}/CHANGELOG.md +97 -0
- data/vendor/bundle/ruby/4.0.0/gems/{bigdecimal-4.1.2 → bigdecimal-4.1.3}/bigdecimal.gemspec +2 -0
- data/vendor/bundle/ruby/4.0.0/gems/{concurrent-ruby-1.3.7 → concurrent-ruby-1.3.8}/CHANGELOG.md +6 -0
- data/vendor/bundle/ruby/4.0.0/gems/{connection_pool-3.0.2 → connection_pool-3.0.3}/connection_pool.gemspec +1 -0
- data/vendor/bundle/ruby/4.0.0/gems/{crass-1.0.6 → crass-1.0.8}/LICENSE +1 -1
- data/vendor/bundle/ruby/4.0.0/gems/crass-1.0.8/README.md +153 -0
- data/vendor/bundle/ruby/4.0.0/gems/crass-1.0.8/crass.gemspec +32 -0
- data/vendor/bundle/ruby/4.0.0/gems/ethon-0.19.2/CHANGELOG.md +1164 -0
- data/vendor/bundle/ruby/4.0.0/gems/ethon-0.19.2/README.md +308 -0
- data/vendor/bundle/ruby/4.0.0/gems/{hashdiff-1.2.1 → hashdiff-1.2.2}/changelog.md +5 -0
- data/vendor/bundle/ruby/4.0.0/gems/{json-2.19.9 → json-3.1.0}/README.md +9 -91
- data/vendor/bundle/ruby/4.0.0/gems/{loofah-2.25.1 → loofah-2.25.3}/CHANGELOG.md +42 -0
- data/vendor/bundle/ruby/4.0.0/gems/{minitest-6.0.6 → minitest-6.1.0}/README.rdoc +19 -10
- data/vendor/bundle/ruby/4.0.0/gems/{msgpack-1.8.3 → msgpack-1.8.7}/ChangeLog +25 -1
- data/vendor/bundle/ruby/4.0.0/gems/{msgpack-1.8.3 → msgpack-1.8.7}/msgpack.gemspec +0 -9
- data/vendor/bundle/ruby/4.0.0/gems/{multi_json-1.21.1 → multi_json-1.21.2}/README.md +6 -6
- data/vendor/bundle/ruby/4.0.0/gems/{nokogiri-1.19.4-x86_64-linux-gnu → nokogiri-1.19.7-x86_64-linux-gnu}/LICENSE-DEPENDENCIES.md +29 -0
- data/vendor/bundle/ruby/4.0.0/gems/{opentelemetry-api-1.10.0 → opentelemetry-api-1.11.1}/CHANGELOG.md +13 -3
- data/vendor/bundle/ruby/4.0.0/gems/{opentelemetry-common-0.25.0 → opentelemetry-common-0.25.2}/CHANGELOG.md +8 -0
- data/vendor/bundle/ruby/4.0.0/gems/{prism-1.9.0 → prism-2.1.0-x86_64-linux-gnu}/CHANGELOG.md +144 -40
- data/vendor/bundle/ruby/4.0.0/gems/{prism-1.9.0 → prism-2.1.0-x86_64-linux-gnu}/LICENSE.md +1 -1
- data/vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/README.md +83 -0
- data/vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/prism.gemspec +251 -0
- data/vendor/bundle/ruby/4.0.0/gems/{rack-3.2.6 → rack-3.2.9}/CHANGELOG.md +137 -1
- data/vendor/bundle/ruby/4.0.0/gems/{rack-test-2.2.0 → rack-test-2.3.0}/MIT-LICENSE.txt +1 -1
- data/vendor/bundle/ruby/4.0.0/gems/{rack-test-2.2.0 → rack-test-2.3.0}/README.md +16 -0
- data/vendor/bundle/ruby/4.0.0/gems/{rails-html-sanitizer-1.7.0 → rails-html-sanitizer-1.7.2}/CHANGELOG.md +54 -0
- data/vendor/bundle/ruby/4.0.0/gems/{rails-html-sanitizer-1.7.0 → rails-html-sanitizer-1.7.2}/README.md +3 -2
- data/vendor/bundle/ruby/4.0.0/gems/{regexp_parser-2.12.0 → regexp_parser-2.13.4}/LICENSE +1 -1
- data/vendor/bundle/ruby/4.0.0/gems/{regexp_parser-2.12.0 → regexp_parser-2.13.4}/regexp_parser.gemspec +3 -9
- data/vendor/bundle/ruby/4.0.0/gems/{rspec-core-3.13.6 → rspec-core-3.13.7}/Changelog.md +10 -2
- data/vendor/bundle/ruby/4.0.0/gems/{rspec-expectations-3.13.5 → rspec-expectations-3.13.6}/Changelog.md +11 -2
- data/vendor/bundle/ruby/4.0.0/gems/{rspec-mocks-3.13.8 → rspec-mocks-3.13.9}/Changelog.md +17 -3
- data/vendor/bundle/ruby/4.0.0/gems/{rspec-support-3.13.7 → rspec-support-3.13.8}/Changelog.md +12 -2
- data/vendor/bundle/ruby/4.0.0/gems/{rubocop-1.88.0 → rubocop-1.92.3}/README.md +1 -1
- data/vendor/bundle/ruby/4.0.0/gems/rubocop-ast-1.53.0/lib/rubocop/ast/vendor/parser/LICENSE.txt +26 -0
- data/vendor/bundle/ruby/4.0.0/gems/{rubocop-capybara-2.23.0 → rubocop-capybara-3.1.0}/CHANGELOG.md +53 -0
- data/vendor/bundle/ruby/4.0.0/gems/{rubocop-capybara-2.23.0 → rubocop-capybara-3.1.0}/README.md +1 -1
- data/vendor/bundle/ruby/4.0.0/gems/{rubocop-performance-1.26.1 → rubocop-performance-1.27.0}/LICENSE.txt +1 -1
- data/vendor/bundle/ruby/4.0.0/gems/{rubocop-rspec_rails-2.32.0 → rubocop-rspec_rails-2.33.0}/CHANGELOG.md +21 -0
- data/vendor/bundle/ruby/4.0.0/gems/{simplecov-0.22.0 → simplecov-1.3.2}/LICENSE +1 -1
- data/vendor/bundle/ruby/4.0.0/gems/simplecov-1.3.2/README.md +272 -0
- data/vendor/bundle/ruby/4.0.0/gems/{simplecov-cobertura-3.2.0 → simplecov-cobertura-4.0.0}/README.md +2 -3
- data/vendor/bundle/ruby/4.0.0/gems/{simplecov-cobertura-3.2.0 → simplecov-cobertura-4.0.0}/simplecov-cobertura.gemspec +2 -2
- data/vendor/bundle/ruby/4.0.0/gems/{typhoeus-1.6.0 → typhoeus-1.8.0}/CHANGELOG.md +297 -3
- data/vendor/bundle/ruby/4.0.0/gems/typhoeus-1.8.0/README.md +825 -0
- data/vendor/bundle/ruby/4.0.0/gems/{typhoeus-1.6.0 → typhoeus-1.8.0}/typhoeus.gemspec +15 -3
- data/vendor/bundle/ruby/4.0.0/gems/{unicode-display_width-3.2.0 → unicode-display_width-3.3.0}/CHANGELOG.md +6 -0
- data/vendor/bundle/ruby/4.0.0/gems/{unicode-display_width-3.2.0 → unicode-display_width-3.3.0}/MIT-LICENSE.txt +1 -1
- data/vendor/bundle/ruby/4.0.0/gems/{unicode-display_width-3.2.0 → unicode-display_width-3.3.0}/README.md +2 -2
- data/vendor/bundle/ruby/4.0.0/gems/{unicode-emoji-4.2.0 → unicode-emoji-4.3.0}/CHANGELOG.md +4 -0
- data/vendor/bundle/ruby/4.0.0/gems/{unicode-emoji-4.2.0 → unicode-emoji-4.3.0}/MIT-LICENSE.txt +1 -1
- data/vendor/bundle/ruby/4.0.0/gems/{unicode-emoji-4.2.0 → unicode-emoji-4.3.0}/README.md +4 -4
- data/vendor/bundle/ruby/4.0.0/gems/{webmock-3.26.2 → webmock-3.38.0}/CHANGELOG.md +406 -0
- data/vendor/bundle/ruby/4.0.0/gems/{webmock-3.26.2 → webmock-3.38.0}/README.md +271 -5
- data/vendor/bundle/ruby/4.0.0/specifications/{actionpack-8.1.3.gemspec → actionpack-8.1.4.1.gemspec} +8 -8
- data/vendor/bundle/ruby/4.0.0/specifications/{actionview-8.1.3.gemspec → actionview-8.1.4.1.gemspec} +9 -9
- data/vendor/bundle/ruby/4.0.0/specifications/{activemodel-8.1.3.gemspec → activemodel-8.1.4.1.gemspec} +6 -6
- data/vendor/bundle/ruby/4.0.0/specifications/{activesupport-8.1.3.gemspec → activesupport-8.1.4.1.gemspec} +5 -5
- data/vendor/bundle/ruby/4.0.0/specifications/{addressable-2.9.0.gemspec → addressable-2.9.2.gemspec} +5 -5
- data/vendor/bundle/ruby/4.0.0/specifications/appraisal-2.5.0.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/ast-2.4.3.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/base64-0.3.0.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/{bigdecimal-4.1.2.gemspec → bigdecimal-4.1.3.gemspec} +3 -3
- data/vendor/bundle/ruby/4.0.0/specifications/builder-3.3.0.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/{concurrent-ruby-1.3.7.gemspec → concurrent-ruby-1.3.8.gemspec} +4 -4
- data/vendor/bundle/ruby/4.0.0/specifications/{connection_pool-3.0.2.gemspec → connection_pool-3.0.3.gemspec} +5 -4
- data/vendor/bundle/ruby/4.0.0/specifications/crack-1.0.1.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/{crass-1.0.6.gemspec → crass-1.0.8.gemspec} +8 -8
- data/vendor/bundle/ruby/4.0.0/specifications/diff-lcs-1.6.2.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/drb-2.2.3.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/erubi-1.13.1.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/{ethon-0.18.0.gemspec → ethon-0.19.2.gemspec} +6 -6
- data/vendor/bundle/ruby/4.0.0/specifications/ffi-1.17.4-x86_64-linux-gnu.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/{hashdiff-1.2.1.gemspec → hashdiff-1.2.2.gemspec} +4 -4
- data/vendor/bundle/ruby/4.0.0/specifications/i18n-1.15.2.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/{json-2.19.9.gemspec → json-3.1.0.gemspec} +0 -0
- data/vendor/bundle/ruby/4.0.0/specifications/{language_server-protocol-3.17.0.5.gemspec → language_server-protocol-3.17.0.6.gemspec} +4 -4
- data/vendor/bundle/ruby/4.0.0/specifications/lint_roller-1.1.0.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/logger-1.7.0.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/{loofah-2.25.1.gemspec → loofah-2.25.3.gemspec} +6 -6
- data/vendor/bundle/ruby/4.0.0/specifications/{minitest-6.0.6.gemspec → minitest-6.1.0.gemspec} +8 -9
- data/vendor/bundle/ruby/4.0.0/specifications/{msgpack-1.8.3.gemspec → msgpack-1.8.7.gemspec} +4 -15
- data/vendor/bundle/ruby/4.0.0/specifications/{multi_json-1.21.1.gemspec → multi_json-1.21.2.gemspec} +5 -5
- data/vendor/bundle/ruby/4.0.0/specifications/{nokogiri-1.19.4-x86_64-linux-gnu.gemspec → nokogiri-1.19.7-x86_64-linux-gnu.gemspec} +3 -3
- data/vendor/bundle/ruby/4.0.0/specifications/opentelemetry-api-1.11.1.gemspec +27 -0
- data/vendor/bundle/ruby/4.0.0/specifications/opentelemetry-common-0.25.2.gemspec +26 -0
- data/vendor/bundle/ruby/4.0.0/specifications/{parallel-2.1.0.gemspec → parallel-2.3.0.gemspec} +4 -4
- data/vendor/bundle/ruby/4.0.0/specifications/{parser-3.3.11.1.gemspec → parser-3.3.14.0.gemspec} +5 -5
- data/vendor/bundle/ruby/4.0.0/specifications/prism-2.1.0-x86_64-linux-gnu.gemspec +22 -0
- data/vendor/bundle/ruby/4.0.0/specifications/public_suffix-7.0.5.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/racc-1.8.1.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/{rack-3.2.6.gemspec → rack-3.2.9.gemspec} +4 -4
- data/vendor/bundle/ruby/4.0.0/specifications/rack-session-2.1.2.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/{rack-test-2.2.0.gemspec → rack-test-2.3.0.gemspec} +5 -5
- data/vendor/bundle/ruby/4.0.0/specifications/rails-dom-testing-2.3.0.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/{rails-html-sanitizer-1.7.0.gemspec → rails-html-sanitizer-1.7.2.gemspec} +7 -7
- data/vendor/bundle/ruby/4.0.0/specifications/rainbow-3.1.1.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/rake-13.4.2.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/rake-release-1.4.0.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/{regexp_parser-2.12.0.gemspec → regexp_parser-2.13.4.gemspec} +5 -5
- data/vendor/bundle/ruby/4.0.0/specifications/rexml-3.4.4.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/rspec-3.13.2.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/{rspec-core-3.13.6.gemspec → rspec-core-3.13.7.gemspec} +7 -7
- data/vendor/bundle/ruby/4.0.0/specifications/{rspec-expectations-3.13.5.gemspec → rspec-expectations-3.13.6.gemspec} +7 -7
- data/vendor/bundle/ruby/4.0.0/specifications/{rspec-mocks-3.13.8.gemspec → rspec-mocks-3.13.9.gemspec} +6 -6
- data/vendor/bundle/ruby/4.0.0/specifications/{rspec-support-3.13.7.gemspec → rspec-support-3.13.8.gemspec} +7 -7
- data/vendor/bundle/ruby/4.0.0/specifications/{rubocop-1.88.0.gemspec → rubocop-1.92.3.gemspec} +7 -7
- data/vendor/bundle/ruby/4.0.0/specifications/{rubocop-ast-1.49.1.gemspec → rubocop-ast-1.53.0.gemspec} +7 -5
- data/vendor/bundle/ruby/4.0.0/specifications/{rubocop-capybara-2.23.0.gemspec → rubocop-capybara-3.1.0.gemspec} +5 -5
- data/vendor/bundle/ruby/4.0.0/specifications/rubocop-factory_bot-2.28.0.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/{rubocop-performance-1.26.1.gemspec → rubocop-performance-1.27.0.gemspec} +7 -7
- data/vendor/bundle/ruby/4.0.0/specifications/rubocop-rspec-3.10.2.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/{rubocop-rspec_rails-2.32.0.gemspec → rubocop-rspec_rails-2.33.0.gemspec} +5 -5
- data/vendor/bundle/ruby/4.0.0/specifications/ruby-progressbar-1.13.0.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/securerandom-0.4.1.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/simplecov-1.3.2.gemspec +25 -0
- data/vendor/bundle/ruby/4.0.0/specifications/{simplecov-cobertura-3.2.0.gemspec → simplecov-cobertura-4.0.0.gemspec} +5 -5
- data/vendor/bundle/ruby/4.0.0/specifications/thor-1.5.0.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/{typhoeus-1.6.0.gemspec → typhoeus-1.8.0.gemspec} +7 -7
- data/vendor/bundle/ruby/4.0.0/specifications/tzinfo-2.0.6.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/{unicode-display_width-3.2.0.gemspec → unicode-display_width-3.3.0.gemspec} +8 -8
- data/vendor/bundle/ruby/4.0.0/specifications/{unicode-emoji-4.2.0.gemspec → unicode-emoji-4.3.0.gemspec} +6 -6
- data/vendor/bundle/ruby/4.0.0/specifications/{uri-1.1.1.gemspec → uri-1.1.2.gemspec} +3 -3
- data/vendor/bundle/ruby/4.0.0/specifications/useragent-0.16.11.gemspec +1 -1
- data/vendor/bundle/ruby/4.0.0/specifications/{webmock-3.26.2.gemspec → webmock-3.38.0.gemspec} +5 -5
- metadata +174 -185
- data/vendor/bundle/ruby/4.0.0/gems/crass-1.0.6/README.md +0 -192
- data/vendor/bundle/ruby/4.0.0/gems/crass-1.0.6/crass.gemspec +0 -31
- data/vendor/bundle/ruby/4.0.0/gems/docile-1.4.1/LICENSE +0 -21
- data/vendor/bundle/ruby/4.0.0/gems/docile-1.4.1/README.md +0 -409
- data/vendor/bundle/ruby/4.0.0/gems/docile-1.4.1/docile.gemspec +0 -36
- data/vendor/bundle/ruby/4.0.0/gems/ethon-0.18.0/CHANGELOG.md +0 -417
- data/vendor/bundle/ruby/4.0.0/gems/ethon-0.18.0/README.md +0 -118
- data/vendor/bundle/ruby/4.0.0/gems/prism-1.9.0/README.md +0 -143
- data/vendor/bundle/ruby/4.0.0/gems/prism-1.9.0/prism.gemspec +0 -172
- data/vendor/bundle/ruby/4.0.0/gems/simplecov-0.22.0/CHANGELOG.md +0 -191
- data/vendor/bundle/ruby/4.0.0/gems/simplecov-0.22.0/README.md +0 -974
- data/vendor/bundle/ruby/4.0.0/gems/simplecov-html-0.13.2/CHANGELOG.md +0 -114
- data/vendor/bundle/ruby/4.0.0/gems/simplecov-html-0.13.2/LICENSE +0 -20
- data/vendor/bundle/ruby/4.0.0/gems/simplecov-html-0.13.2/README.md +0 -30
- data/vendor/bundle/ruby/4.0.0/gems/simplecov_json_formatter-0.1.4/CHANGELOG.md +0 -13
- data/vendor/bundle/ruby/4.0.0/gems/simplecov_json_formatter-0.1.4/README.md +0 -29
- data/vendor/bundle/ruby/4.0.0/gems/typhoeus-1.6.0/README.md +0 -588
- data/vendor/bundle/ruby/4.0.0/specifications/docile-1.4.1.gemspec +0 -22
- data/vendor/bundle/ruby/4.0.0/specifications/opentelemetry-api-1.10.0.gemspec +0 -35
- data/vendor/bundle/ruby/4.0.0/specifications/opentelemetry-common-0.25.0.gemspec +0 -33
- data/vendor/bundle/ruby/4.0.0/specifications/prism-1.9.0.gemspec +0 -24
- data/vendor/bundle/ruby/4.0.0/specifications/simplecov-0.22.0.gemspec +0 -28
- data/vendor/bundle/ruby/4.0.0/specifications/simplecov-html-0.13.2.gemspec +0 -22
- data/vendor/bundle/ruby/4.0.0/specifications/simplecov_json_formatter-0.1.4.gemspec +0 -21
- /data/vendor/bundle/ruby/4.0.0/bundler/gems/{rubocop-config-2b861962124a → rubocop-config-9832479830d9}/LICENSE +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{actionpack-8.1.3 → actionpack-8.1.4.1}/MIT-LICENSE +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{actionpack-8.1.3 → actionpack-8.1.4.1}/README.rdoc +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{actionview-8.1.3 → actionview-8.1.4.1}/MIT-LICENSE +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{actionview-8.1.3 → actionview-8.1.4.1}/README.rdoc +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{activemodel-8.1.3 → activemodel-8.1.4.1}/MIT-LICENSE +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{activemodel-8.1.3 → activemodel-8.1.4.1}/README.rdoc +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{activesupport-8.1.3 → activesupport-8.1.4.1}/MIT-LICENSE +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{activesupport-8.1.3 → activesupport-8.1.4.1}/README.rdoc +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{addressable-2.9.0 → addressable-2.9.2}/LICENSE.txt +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{addressable-2.9.0 → addressable-2.9.2}/README.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{bigdecimal-4.1.2 → bigdecimal-4.1.3}/LICENSE +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{concurrent-ruby-1.3.7 → concurrent-ruby-1.3.8}/LICENSE.txt +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{concurrent-ruby-1.3.7 → concurrent-ruby-1.3.8}/README.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{connection_pool-3.0.2 → connection_pool-3.0.3}/LICENSE +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{connection_pool-3.0.2 → connection_pool-3.0.3}/README.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{ethon-0.18.0 → ethon-0.19.2}/LICENSE +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{ethon-0.18.0 → ethon-0.19.2}/ethon.gemspec +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{hashdiff-1.2.1 → hashdiff-1.2.2}/LICENSE +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{hashdiff-1.2.1 → hashdiff-1.2.2}/README.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{hashdiff-1.2.1 → hashdiff-1.2.2}/hashdiff.gemspec +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{json-2.19.9 → json-3.1.0}/json.gemspec +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{language_server-protocol-3.17.0.5 → language_server-protocol-3.17.0.6}/LICENSE.txt +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{language_server-protocol-3.17.0.5 → language_server-protocol-3.17.0.6}/README.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{loofah-2.25.1 → loofah-2.25.3}/MIT-LICENSE.txt +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{loofah-2.25.1 → loofah-2.25.3}/README.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{msgpack-1.8.3 → msgpack-1.8.7}/LICENSE +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{msgpack-1.8.3 → msgpack-1.8.7}/README.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{multi_json-1.21.1 → multi_json-1.21.2}/LICENSE.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{nokogiri-1.19.4-x86_64-linux-gnu → nokogiri-1.19.7-x86_64-linux-gnu}/LICENSE.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{nokogiri-1.19.4-x86_64-linux-gnu → nokogiri-1.19.7-x86_64-linux-gnu}/README.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{opentelemetry-api-1.10.0 → opentelemetry-api-1.11.1}/LICENSE +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{opentelemetry-api-1.10.0 → opentelemetry-api-1.11.1}/README.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{opentelemetry-common-0.25.0 → opentelemetry-common-0.25.2}/LICENSE +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{opentelemetry-common-0.25.0 → opentelemetry-common-0.25.2}/README.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{parallel-2.1.0 → parallel-2.3.0}/MIT-LICENSE.txt +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{parser-3.3.11.1 → parser-3.3.14.0}/LICENSE.txt +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{parser-3.3.11.1 → parser-3.3.14.0}/parser.gemspec +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{rack-3.2.6 → rack-3.2.9}/MIT-LICENSE +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{rack-3.2.6 → rack-3.2.9}/README.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{rails-html-sanitizer-1.7.0 → rails-html-sanitizer-1.7.2}/MIT-LICENSE +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{rspec-core-3.13.6 → rspec-core-3.13.7}/LICENSE.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{rspec-core-3.13.6 → rspec-core-3.13.7}/README.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{rspec-expectations-3.13.5 → rspec-expectations-3.13.6}/LICENSE.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{rspec-expectations-3.13.5 → rspec-expectations-3.13.6}/README.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{rspec-mocks-3.13.8 → rspec-mocks-3.13.9}/LICENSE.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{rspec-mocks-3.13.8 → rspec-mocks-3.13.9}/README.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{rspec-support-3.13.7 → rspec-support-3.13.8}/LICENSE.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{rspec-support-3.13.7 → rspec-support-3.13.8}/README.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{rubocop-1.88.0 → rubocop-1.92.3}/LICENSE.txt +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{rubocop-ast-1.49.1 → rubocop-ast-1.53.0}/LICENSE.txt +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{rubocop-ast-1.49.1 → rubocop-ast-1.53.0}/README.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{rubocop-capybara-2.23.0 → rubocop-capybara-3.1.0}/MIT-LICENSE.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{rubocop-performance-1.26.1 → rubocop-performance-1.27.0}/README.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{rubocop-rspec_rails-2.32.0 → rubocop-rspec_rails-2.33.0}/MIT-LICENSE.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{rubocop-rspec_rails-2.32.0 → rubocop-rspec_rails-2.33.0}/README.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{simplecov-cobertura-3.2.0 → simplecov-cobertura-4.0.0}/LICENSE +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{typhoeus-1.6.0 → typhoeus-1.8.0}/LICENSE +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{unicode-emoji-4.2.0 → unicode-emoji-4.3.0}/unicode-emoji.gemspec +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{uri-1.1.1 → uri-1.1.2}/README.md +0 -0
- /data/vendor/bundle/ruby/4.0.0/gems/{webmock-3.26.2 → webmock-3.38.0}/LICENSE +0 -0
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
Crass
|
|
2
|
-
=====
|
|
3
|
-
|
|
4
|
-
Crass is a Ruby CSS parser that's fully compliant with the
|
|
5
|
-
[CSS Syntax Level 3][css] specification.
|
|
6
|
-
|
|
7
|
-
* [Home](https://github.com/rgrove/crass/)
|
|
8
|
-
* [API Docs](http://rubydoc.info/github/rgrove/crass/master)
|
|
9
|
-
|
|
10
|
-
[](https://travis-ci.org/rgrove/crass)
|
|
11
|
-
[](http://badge.fury.io/rb/crass)
|
|
12
|
-
|
|
13
|
-
Features
|
|
14
|
-
--------
|
|
15
|
-
|
|
16
|
-
* Pure Ruby, with no runtime dependencies other than Ruby 1.9.x or higher.
|
|
17
|
-
|
|
18
|
-
* Tokenizes and parses CSS according to the rules defined in the 14 November
|
|
19
|
-
2014 editor's draft of the [CSS Syntax Level 3][css] specification.
|
|
20
|
-
|
|
21
|
-
* Extremely tolerant of broken or invalid CSS. If a browser can handle it, Crass
|
|
22
|
-
should be able to handle it too.
|
|
23
|
-
|
|
24
|
-
* Optionally includes comments in the token stream.
|
|
25
|
-
|
|
26
|
-
* Optionally preserves certain CSS hacks, such as the IE "*" hack, which would
|
|
27
|
-
otherwise be discarded according to CSS3 tokenizing rules.
|
|
28
|
-
|
|
29
|
-
* Capable of serializing the parse tree back to CSS while maintaining all
|
|
30
|
-
original whitespace, comments, and indentation.
|
|
31
|
-
|
|
32
|
-
[css]: http://dev.w3.org/csswg/css-syntax/
|
|
33
|
-
|
|
34
|
-
Problems
|
|
35
|
-
--------
|
|
36
|
-
|
|
37
|
-
* Crass isn't terribly fast. I mean, it's Ruby, and it's not really slow by Ruby
|
|
38
|
-
standards. But compared to the CSS parser in your average browser? Yeah, it's
|
|
39
|
-
slow.
|
|
40
|
-
|
|
41
|
-
* Crass only parses the CSS syntax; it doesn't understand what any of it means,
|
|
42
|
-
doesn't coalesce selectors, etc. You can do this yourself by consuming the
|
|
43
|
-
parse tree, though.
|
|
44
|
-
|
|
45
|
-
* While any node in the parse tree (or the parse tree as a whole) can be
|
|
46
|
-
serialized back to CSS with perfect fidelity, changes made to those nodes
|
|
47
|
-
(except for wholesale removal of nodes) are not reflected in the serialized
|
|
48
|
-
output.
|
|
49
|
-
|
|
50
|
-
* Crass only supports UTF-8 input and doesn't respect `@charset` rules. Input in
|
|
51
|
-
any other encoding will be converted to UTF-8.
|
|
52
|
-
|
|
53
|
-
Installing
|
|
54
|
-
----------
|
|
55
|
-
|
|
56
|
-
```
|
|
57
|
-
gem install crass
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Examples
|
|
61
|
-
--------
|
|
62
|
-
|
|
63
|
-
Say you have a string containing some CSS:
|
|
64
|
-
|
|
65
|
-
```css
|
|
66
|
-
/* Comment! */
|
|
67
|
-
a:hover {
|
|
68
|
-
color: #0d8bfa;
|
|
69
|
-
text-decoration: underline;
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
Parsing it is simple:
|
|
74
|
-
|
|
75
|
-
```ruby
|
|
76
|
-
tree = Crass.parse(css, :preserve_comments => true)
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
This returns a big fat beautiful parse tree, which looks like this:
|
|
80
|
-
|
|
81
|
-
```ruby
|
|
82
|
-
[{:node=>:comment, :pos=>0, :raw=>"/* Comment! */", :value=>" Comment! "},
|
|
83
|
-
{:node=>:whitespace, :pos=>14, :raw=>"\n"},
|
|
84
|
-
{:node=>:style_rule,
|
|
85
|
-
:selector=>
|
|
86
|
-
{:node=>:selector,
|
|
87
|
-
:value=>"a:hover",
|
|
88
|
-
:tokens=>
|
|
89
|
-
[{:node=>:ident, :pos=>15, :raw=>"a", :value=>"a"},
|
|
90
|
-
{:node=>:colon, :pos=>16, :raw=>":"},
|
|
91
|
-
{:node=>:ident, :pos=>17, :raw=>"hover", :value=>"hover"},
|
|
92
|
-
{:node=>:whitespace, :pos=>22, :raw=>" "}]},
|
|
93
|
-
:children=>
|
|
94
|
-
[{:node=>:whitespace, :pos=>24, :raw=>"\n "},
|
|
95
|
-
{:node=>:property,
|
|
96
|
-
:name=>"color",
|
|
97
|
-
:value=>"#0d8bfa",
|
|
98
|
-
:children=>
|
|
99
|
-
[{:node=>:whitespace, :pos=>33, :raw=>" "},
|
|
100
|
-
{:node=>:hash,
|
|
101
|
-
:pos=>34,
|
|
102
|
-
:raw=>"#0d8bfa",
|
|
103
|
-
:type=>:unrestricted,
|
|
104
|
-
:value=>"0d8bfa"}],
|
|
105
|
-
:important=>false,
|
|
106
|
-
:tokens=>
|
|
107
|
-
[{:node=>:ident, :pos=>27, :raw=>"color", :value=>"color"},
|
|
108
|
-
{:node=>:colon, :pos=>32, :raw=>":"},
|
|
109
|
-
{:node=>:whitespace, :pos=>33, :raw=>" "},
|
|
110
|
-
{:node=>:hash,
|
|
111
|
-
:pos=>34,
|
|
112
|
-
:raw=>"#0d8bfa",
|
|
113
|
-
:type=>:unrestricted,
|
|
114
|
-
:value=>"0d8bfa"}]},
|
|
115
|
-
{:node=>:semicolon, :pos=>41, :raw=>";"},
|
|
116
|
-
{:node=>:whitespace, :pos=>42, :raw=>"\n "},
|
|
117
|
-
{:node=>:property,
|
|
118
|
-
:name=>"text-decoration",
|
|
119
|
-
:value=>"underline",
|
|
120
|
-
:children=>
|
|
121
|
-
[{:node=>:whitespace, :pos=>61, :raw=>" "},
|
|
122
|
-
{:node=>:ident, :pos=>62, :raw=>"underline", :value=>"underline"}],
|
|
123
|
-
:important=>false,
|
|
124
|
-
:tokens=>
|
|
125
|
-
[{:node=>:ident,
|
|
126
|
-
:pos=>45,
|
|
127
|
-
:raw=>"text-decoration",
|
|
128
|
-
:value=>"text-decoration"},
|
|
129
|
-
{:node=>:colon, :pos=>60, :raw=>":"},
|
|
130
|
-
{:node=>:whitespace, :pos=>61, :raw=>" "},
|
|
131
|
-
{:node=>:ident, :pos=>62, :raw=>"underline", :value=>"underline"}]},
|
|
132
|
-
{:node=>:semicolon, :pos=>71, :raw=>";"},
|
|
133
|
-
{:node=>:whitespace, :pos=>72, :raw=>"\n"}]}]
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
If you want, you can stringify the parse tree:
|
|
137
|
-
|
|
138
|
-
```ruby
|
|
139
|
-
css = Crass::Parser.stringify(tree)
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
...which gives you back exactly what you put in!
|
|
143
|
-
|
|
144
|
-
```css
|
|
145
|
-
/* Comment! */
|
|
146
|
-
a:hover {
|
|
147
|
-
color: #0d8bfa;
|
|
148
|
-
text-decoration: underline;
|
|
149
|
-
}
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
Wasn't that exciting?
|
|
153
|
-
|
|
154
|
-
A Note on Versioning
|
|
155
|
-
--------------------
|
|
156
|
-
|
|
157
|
-
As of version 1.0.0, Crass adheres strictly to [SemVer 2.0][semver].
|
|
158
|
-
|
|
159
|
-
[semver]:http://semver.org/spec/v2.0.0.html
|
|
160
|
-
|
|
161
|
-
Contributing
|
|
162
|
-
------------
|
|
163
|
-
|
|
164
|
-
The best way to contribute is to use Crass and [create issues][issue] when you
|
|
165
|
-
run into problems.
|
|
166
|
-
|
|
167
|
-
Pull requests that fix bugs are more than welcome as long as they include tests.
|
|
168
|
-
Please adhere to the style and format of the surrounding code, or I might ask
|
|
169
|
-
you to change things.
|
|
170
|
-
|
|
171
|
-
If you want to add a feature or refactor something, please get in touch first to
|
|
172
|
-
make sure I'm on board with your idea and approach; I'm pretty picky, and I'd
|
|
173
|
-
hate to have to turn down a pull request you spent a lot of time on.
|
|
174
|
-
|
|
175
|
-
[issue]: https://github.com/rgrove/crass/issues/new
|
|
176
|
-
|
|
177
|
-
Acknowledgments
|
|
178
|
-
---------------
|
|
179
|
-
|
|
180
|
-
I'm deeply, deeply grateful to [Simon Sapin][simon] for his wonderfully
|
|
181
|
-
comprehensive [CSS parsing tests][css-tests], which I adapted to create many of
|
|
182
|
-
Crass's tests. They've been invaluable in helping me fix bugs and handle weird
|
|
183
|
-
edge cases, and Crass would be much crappier without them.
|
|
184
|
-
|
|
185
|
-
I'm also grateful to [Tab Atkins Jr.][tab] and Simon Sapin (again!) for their
|
|
186
|
-
work on the [CSS Syntax Level 3][spec] specification, which defines the
|
|
187
|
-
tokenizing and parsing rules that Crass implements.
|
|
188
|
-
|
|
189
|
-
[css-tests]:https://github.com/SimonSapin/css-parsing-tests/
|
|
190
|
-
[simon]:http://exyr.org/about/
|
|
191
|
-
[spec]:http://www.w3.org/TR/css-syntax-3/
|
|
192
|
-
[tab]:http://www.xanthir.com/contact/
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
require './lib/crass/version'
|
|
3
|
-
|
|
4
|
-
Gem::Specification.new do |s|
|
|
5
|
-
s.name = 'crass'
|
|
6
|
-
s.summary = 'CSS parser based on the CSS Syntax Level 3 spec.'
|
|
7
|
-
s.description = 'Crass is a pure Ruby CSS parser based on the CSS Syntax Level 3 spec.'
|
|
8
|
-
s.version = Crass::VERSION
|
|
9
|
-
s.authors = ['Ryan Grove']
|
|
10
|
-
s.email = ['ryan@wonko.com']
|
|
11
|
-
s.homepage = 'https://github.com/rgrove/crass/'
|
|
12
|
-
s.license = 'MIT'
|
|
13
|
-
|
|
14
|
-
s.metadata = {
|
|
15
|
-
'bug_tracker_uri' => 'https://github.com/rgrove/crass/issues',
|
|
16
|
-
'changelog_uri' => "https://github.com/rgrove/crass/blob/v#{s.version}/HISTORY.md",
|
|
17
|
-
'documentation_uri' => "https://www.rubydoc.info/gems/crass/#{s.version}",
|
|
18
|
-
'source_code_uri' => "https://github.com/rgrove/crass/tree/v#{s.version}",
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
s.platform = Gem::Platform::RUBY
|
|
22
|
-
s.required_ruby_version = Gem::Requirement.new('>= 1.9.2')
|
|
23
|
-
|
|
24
|
-
s.require_paths = ['lib']
|
|
25
|
-
|
|
26
|
-
s.files = `git ls-files -z`.split("\x0").grep_v(%r{^test/})
|
|
27
|
-
|
|
28
|
-
# Development dependencies.
|
|
29
|
-
s.add_development_dependency 'minitest', '~> 5.0.8'
|
|
30
|
-
s.add_development_dependency 'rake', '~> 10.1.0'
|
|
31
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2012-2024 Marc Siegel
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|
|
@@ -1,409 +0,0 @@
|
|
|
1
|
-
# Docile
|
|
2
|
-
|
|
3
|
-
[](https://rubygems.org/gems/docile)
|
|
4
|
-
[](https://rubygems.org/gems/docile)
|
|
5
|
-
|
|
6
|
-
[](https://gitter.im/ms-ati/docile?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
7
|
-
[](http://rubydoc.info/github/ms-ati/docile)
|
|
8
|
-
|
|
9
|
-
[](https://github.com/ms-ati/docile/actions/workflows/main.yml)
|
|
10
|
-
[](https://codecov.io/github/ms-ati/docile)
|
|
11
|
-
[](https://codeclimate.com/github/ms-ati/docile/maintainability)
|
|
12
|
-
|
|
13
|
-
Ruby makes it possible to create very expressive **Domain Specific
|
|
14
|
-
Languages**, or **DSL**'s for short. However, it requires some deep knowledge and
|
|
15
|
-
somewhat hairy meta-programming to get the interface just right.
|
|
16
|
-
|
|
17
|
-
"Docile" means *Ready to accept control or instruction; submissive* [[1]]
|
|
18
|
-
|
|
19
|
-
Instead of each Ruby project reinventing this wheel, let's make our Ruby DSL
|
|
20
|
-
coding a bit more docile...
|
|
21
|
-
|
|
22
|
-
[1]: http://www.google.com/search?q=docile+definition "Google"
|
|
23
|
-
|
|
24
|
-
## Usage
|
|
25
|
-
|
|
26
|
-
### Basic: Ruby [Array](http://ruby-doc.org/core-3.0.0/Array.html) as DSL
|
|
27
|
-
|
|
28
|
-
Let's say that we want to make a DSL for modifying Array objects.
|
|
29
|
-
Wouldn't it be great if we could just treat the methods of Array as a DSL?
|
|
30
|
-
|
|
31
|
-
```ruby
|
|
32
|
-
with_array([]) do
|
|
33
|
-
push 1
|
|
34
|
-
push 2
|
|
35
|
-
pop
|
|
36
|
-
push 3
|
|
37
|
-
end
|
|
38
|
-
#=> [1, 3]
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
No problem, just define the method `with_array` like this:
|
|
42
|
-
|
|
43
|
-
```ruby
|
|
44
|
-
def with_array(arr=[], &block)
|
|
45
|
-
Docile.dsl_eval(arr, &block)
|
|
46
|
-
end
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Easy!
|
|
50
|
-
|
|
51
|
-
### Next step: Allow helper methods to call DSL methods
|
|
52
|
-
|
|
53
|
-
What if, in our use of the methods of Array as a DSL, we want to extract
|
|
54
|
-
helper methods which in turn call DSL methods?
|
|
55
|
-
|
|
56
|
-
```ruby
|
|
57
|
-
def pop_sum_and_push(n)
|
|
58
|
-
sum = 0
|
|
59
|
-
n.times { sum += pop }
|
|
60
|
-
push sum
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
Docile.dsl_eval([]) do
|
|
64
|
-
push 5
|
|
65
|
-
push 6
|
|
66
|
-
pop_sum_and_push(2)
|
|
67
|
-
end
|
|
68
|
-
#=> [11]
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
Without Docile, you may find this sort of code extraction to be more
|
|
72
|
-
challenging.
|
|
73
|
-
|
|
74
|
-
### Wait! Can't I do that with just `instance_eval` or `instance_exec`?
|
|
75
|
-
|
|
76
|
-
Good question!
|
|
77
|
-
|
|
78
|
-
In short: **No**.
|
|
79
|
-
|
|
80
|
-
Not if you want the code in the block to be able to refer to anything
|
|
81
|
-
the block would normally have access to from the surrounding context.
|
|
82
|
-
|
|
83
|
-
Let's be very specific. Docile internally uses `instance_exec` (see [execution.rb#26](lib/docile/execution.rb#L26)), adding a small layer to support referencing *local variables*, *instance variables*, and *methods* from the _block's context_ **or** the target _object's context_, interchangeably. This is "**the hard part**", where most folks making a DSL in Ruby throw up their hands.
|
|
84
|
-
|
|
85
|
-
For example:
|
|
86
|
-
|
|
87
|
-
```ruby
|
|
88
|
-
class ContextOfBlock
|
|
89
|
-
def example_of_contexts
|
|
90
|
-
@block_instance_var = 1
|
|
91
|
-
block_local_var = 2
|
|
92
|
-
|
|
93
|
-
with_array do
|
|
94
|
-
push @block_instance_var
|
|
95
|
-
push block_local_var
|
|
96
|
-
pop
|
|
97
|
-
push block_sees_this_method
|
|
98
|
-
end
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
def block_sees_this_method
|
|
102
|
-
3
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
def with_array(&block)
|
|
106
|
-
{
|
|
107
|
-
docile: Docile.dsl_eval([], &block),
|
|
108
|
-
instance_eval: ([].instance_eval(&block) rescue $!),
|
|
109
|
-
instance_exec: ([].instance_exec(&block) rescue $!)
|
|
110
|
-
}
|
|
111
|
-
end
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
ContextOfBlock.new.example_of_contexts
|
|
115
|
-
#=> {
|
|
116
|
-
:docile=>[1, 3],
|
|
117
|
-
:instance_eval=>#<NameError: undefined local variable or method `block_sees_this_method' for [nil]:Array>,
|
|
118
|
-
:instance_exec=>#<NameError: undefined local variable or method `block_sees_this_method' for [nil]:Array>
|
|
119
|
-
}
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
As you can see, it won't be possible to call methods or access instance variables defined in the block's context using just the raw `instance_eval` or `instance_exec` methods. And in fact, Docile goes further, making it easy to maintain this support even in multi-layered DSLs.
|
|
123
|
-
|
|
124
|
-
### Build a Pizza
|
|
125
|
-
|
|
126
|
-
Mutating (changing) an Array instance is fine, but what usually makes a good DSL is a [Builder Pattern][2].
|
|
127
|
-
|
|
128
|
-
For example, let's say you want a DSL to specify how you want to build a Pizza:
|
|
129
|
-
|
|
130
|
-
```ruby
|
|
131
|
-
@sauce_level = :extra
|
|
132
|
-
|
|
133
|
-
pizza do
|
|
134
|
-
cheese
|
|
135
|
-
pepperoni
|
|
136
|
-
sauce @sauce_level
|
|
137
|
-
end
|
|
138
|
-
#=> #<Pizza:0x00001009dc398 @cheese=true, @pepperoni=true, @bacon=false, @sauce=:extra>
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
And let's say we have a PizzaBuilder, which builds a Pizza like this:
|
|
142
|
-
|
|
143
|
-
```ruby
|
|
144
|
-
Pizza = Struct.new(:cheese, :pepperoni, :bacon, :sauce)
|
|
145
|
-
|
|
146
|
-
class PizzaBuilder
|
|
147
|
-
def cheese(v=true); @cheese = v; self; end
|
|
148
|
-
def pepperoni(v=true); @pepperoni = v; self; end
|
|
149
|
-
def bacon(v=true); @bacon = v; self; end
|
|
150
|
-
def sauce(v=nil); @sauce = v; self; end
|
|
151
|
-
def build
|
|
152
|
-
Pizza.new(!!@cheese, !!@pepperoni, !!@bacon, @sauce)
|
|
153
|
-
end
|
|
154
|
-
end
|
|
155
|
-
|
|
156
|
-
PizzaBuilder.new.cheese.pepperoni.sauce(:extra).build
|
|
157
|
-
#=> #<Pizza:0x00001009dc398 @cheese=true, @pepperoni=true, @bacon=false, @sauce=:extra>
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
Then implement your DSL like this:
|
|
161
|
-
|
|
162
|
-
```ruby
|
|
163
|
-
def pizza(&block)
|
|
164
|
-
Docile.dsl_eval(PizzaBuilder.new, &block).build
|
|
165
|
-
end
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
It's just that easy!
|
|
169
|
-
|
|
170
|
-
[2]: http://stackoverflow.com/questions/328496/when-would-you-use-the-builder-pattern "Builder Pattern"
|
|
171
|
-
|
|
172
|
-
### Multi-level and Recursive DSLs
|
|
173
|
-
|
|
174
|
-
Docile is a very easy way to write a multi-level DSL in Ruby, even for
|
|
175
|
-
a [recursive data structure such as a tree][4]:
|
|
176
|
-
|
|
177
|
-
```ruby
|
|
178
|
-
Person = Struct.new(:name, :mother, :father)
|
|
179
|
-
|
|
180
|
-
person {
|
|
181
|
-
name 'John Smith'
|
|
182
|
-
mother {
|
|
183
|
-
name 'Mary Smith'
|
|
184
|
-
}
|
|
185
|
-
father {
|
|
186
|
-
name 'Tom Smith'
|
|
187
|
-
mother {
|
|
188
|
-
name 'Jane Smith'
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
#=> #<struct Person name="John Smith",
|
|
194
|
-
# mother=#<struct Person name="Mary Smith", mother=nil, father=nil>,
|
|
195
|
-
# father=#<struct Person name="Tom Smith",
|
|
196
|
-
# mother=#<struct Person name="Jane Smith", mother=nil, father=nil>,
|
|
197
|
-
# father=nil>>
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
See the full [person tree example][4] for details.
|
|
201
|
-
|
|
202
|
-
[4]: https://gist.github.com/ms-ati/2bb17bdf10a430faba98
|
|
203
|
-
|
|
204
|
-
### Block parameters
|
|
205
|
-
|
|
206
|
-
Parameters can be passed to the DSL block.
|
|
207
|
-
|
|
208
|
-
Supposing you want to make some sort of cheap [Sinatra][3] knockoff:
|
|
209
|
-
|
|
210
|
-
```ruby
|
|
211
|
-
@last_request = nil
|
|
212
|
-
respond '/path' do |request|
|
|
213
|
-
puts "Request received: #{request}"
|
|
214
|
-
@last_request = request
|
|
215
|
-
end
|
|
216
|
-
|
|
217
|
-
def ride bike
|
|
218
|
-
# Play with your new bike
|
|
219
|
-
end
|
|
220
|
-
|
|
221
|
-
respond '/new_bike' do |bike|
|
|
222
|
-
ride(bike)
|
|
223
|
-
end
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
You'd put together a dispatcher something like this:
|
|
227
|
-
|
|
228
|
-
```ruby
|
|
229
|
-
require 'singleton'
|
|
230
|
-
|
|
231
|
-
class DispatchScope
|
|
232
|
-
def a_method_you_can_call_from_inside_the_block
|
|
233
|
-
:useful_huh?
|
|
234
|
-
end
|
|
235
|
-
end
|
|
236
|
-
|
|
237
|
-
class MessageDispatch
|
|
238
|
-
include Singleton
|
|
239
|
-
|
|
240
|
-
def initialize
|
|
241
|
-
@responders = {}
|
|
242
|
-
end
|
|
243
|
-
|
|
244
|
-
def add_responder path, &block
|
|
245
|
-
@responders[path] = block
|
|
246
|
-
end
|
|
247
|
-
|
|
248
|
-
def dispatch path, request
|
|
249
|
-
Docile.dsl_eval(DispatchScope.new, request, &@responders[path])
|
|
250
|
-
end
|
|
251
|
-
end
|
|
252
|
-
|
|
253
|
-
def respond path, &handler
|
|
254
|
-
MessageDispatch.instance.add_responder path, handler
|
|
255
|
-
end
|
|
256
|
-
|
|
257
|
-
def send_request path, request
|
|
258
|
-
MessageDispatch.instance.dispatch path, request
|
|
259
|
-
end
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
[3]: http://www.sinatrarb.com "Sinatra"
|
|
263
|
-
|
|
264
|
-
### Functional-Style Immutable DSL Objects
|
|
265
|
-
|
|
266
|
-
Sometimes, you want to use an object as a DSL, but it doesn't quite fit the
|
|
267
|
-
[imperative](http://en.wikipedia.org/wiki/Imperative_programming) pattern shown
|
|
268
|
-
above.
|
|
269
|
-
|
|
270
|
-
Instead of methods like
|
|
271
|
-
[Array#push](http://www.ruby-doc.org/core-3.0.0/Array.html#method-i-push), which
|
|
272
|
-
modifies the object at hand, it has methods like
|
|
273
|
-
[String#reverse](http://www.ruby-doc.org/core-3.0.0/String.html#method-i-reverse),
|
|
274
|
-
which returns a new object without touching the original. Perhaps it's even
|
|
275
|
-
[frozen](http://www.ruby-doc.org/core-3.0.0/Object.html#method-i-freeze) in
|
|
276
|
-
order to enforce [immutability](http://en.wikipedia.org/wiki/Immutable_object).
|
|
277
|
-
|
|
278
|
-
Wouldn't it be great if we could just treat these methods as a DSL as well?
|
|
279
|
-
|
|
280
|
-
```ruby
|
|
281
|
-
s = "I'm immutable!".freeze
|
|
282
|
-
|
|
283
|
-
with_immutable_string(s) do
|
|
284
|
-
reverse
|
|
285
|
-
upcase
|
|
286
|
-
end
|
|
287
|
-
#=> "!ELBATUMMI M'I"
|
|
288
|
-
|
|
289
|
-
s
|
|
290
|
-
#=> "I'm immutable!"
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
No problem, just define the method `with_immutable_string` like this:
|
|
294
|
-
|
|
295
|
-
```ruby
|
|
296
|
-
def with_immutable_string(str="", &block)
|
|
297
|
-
Docile.dsl_eval_immutable(str, &block)
|
|
298
|
-
end
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
All set!
|
|
302
|
-
|
|
303
|
-
### Accessing the block's return value
|
|
304
|
-
|
|
305
|
-
Sometimes you might want to access the return value of your provided block,
|
|
306
|
-
as opposed to the DSL object itself. In these cases, use
|
|
307
|
-
`dsl_eval_with_block_return`. It behaves exactly like `dsl_eval`, but returns
|
|
308
|
-
the output from executing the block, rather than the DSL object.
|
|
309
|
-
|
|
310
|
-
```ruby
|
|
311
|
-
arr = []
|
|
312
|
-
with_array(arr) do
|
|
313
|
-
push "a"
|
|
314
|
-
push "b"
|
|
315
|
-
push "c"
|
|
316
|
-
length
|
|
317
|
-
end
|
|
318
|
-
#=> 3
|
|
319
|
-
|
|
320
|
-
arr
|
|
321
|
-
#=> ["a", "b", "c"]
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
```ruby
|
|
325
|
-
def with_array(arr=[], &block)
|
|
326
|
-
Docile.dsl_eval_with_block_return(arr, &block)
|
|
327
|
-
end
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
## Features
|
|
331
|
-
|
|
332
|
-
1. Method lookup falls back from the DSL object to the block's context
|
|
333
|
-
2. Local variable lookup falls back from the DSL object to the block's
|
|
334
|
-
context
|
|
335
|
-
3. Instance variables are from the block's context only
|
|
336
|
-
4. Nested DSL evaluation, correctly chaining method and variable handling
|
|
337
|
-
from the inner to the outer DSL scopes
|
|
338
|
-
5. Alternatives for both imperative and functional styles of DSL objects
|
|
339
|
-
|
|
340
|
-
## Installation
|
|
341
|
-
|
|
342
|
-
``` bash
|
|
343
|
-
$ gem install docile
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
## Links
|
|
347
|
-
* [Source](https://github.com/ms-ati/docile)
|
|
348
|
-
* [Documentation](http://rubydoc.info/gems/docile)
|
|
349
|
-
* [Bug Tracker](https://github.com/ms-ati/docile/issues)
|
|
350
|
-
|
|
351
|
-
## Status
|
|
352
|
-
|
|
353
|
-
Works on [all currently supported ruby versions](https://github.com/ms-ati/docile/blob/master/.github/workflows/main.yml),
|
|
354
|
-
or so [Github Actions](https://github.com/ms-ati/docile/actions)
|
|
355
|
-
tells us.
|
|
356
|
-
|
|
357
|
-
Used by some pretty cool gems to implement their DSLs, notably including
|
|
358
|
-
[SimpleCov](https://github.com/colszowka/simplecov). Keep an eye out for new
|
|
359
|
-
gems using Docile at the
|
|
360
|
-
[Ruby Toolbox](https://www.ruby-toolbox.com/projects/docile).
|
|
361
|
-
|
|
362
|
-
## Release Policy
|
|
363
|
-
|
|
364
|
-
Docile releases follow
|
|
365
|
-
[Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html).
|
|
366
|
-
|
|
367
|
-
## Note on Patches/Pull Requests
|
|
368
|
-
|
|
369
|
-
* Fork the project.
|
|
370
|
-
* Setup your development environment with:
|
|
371
|
-
`gem install bundler; bundle install`
|
|
372
|
-
* Make your feature addition or bug fix.
|
|
373
|
-
* Add tests for it. This is important so I don't break it in a future version
|
|
374
|
-
unintentionally.
|
|
375
|
-
* Commit, do not mess with rakefile, version, or history.
|
|
376
|
-
(if you want to have your own version, that is fine but bump version in a
|
|
377
|
-
commit by itself I can ignore when I pull)
|
|
378
|
-
* Send me a pull request. Bonus points for topic branches.
|
|
379
|
-
|
|
380
|
-
## Releasing
|
|
381
|
-
|
|
382
|
-
To make a new release of `Docile` to
|
|
383
|
-
[RubyGems](https://rubygems.org/gems/docile), first install the release
|
|
384
|
-
dependencies (e.g. `rake`) as follows:
|
|
385
|
-
|
|
386
|
-
```shell
|
|
387
|
-
bundle config set --local with 'release'
|
|
388
|
-
bundle install
|
|
389
|
-
```
|
|
390
|
-
|
|
391
|
-
Then carry out these steps:
|
|
392
|
-
|
|
393
|
-
1. Update `HISTORY.md`:
|
|
394
|
-
- Add an entry for the upcoming version _x.y.z_
|
|
395
|
-
- Move content from _Unreleased_ to the upcoming version _x.y.z_
|
|
396
|
-
- Commit with title `Update HISTORY.md for x.y.z`
|
|
397
|
-
|
|
398
|
-
2. Update `lib/docile/version.rb`
|
|
399
|
-
- Replace with upcoming version _x.y.z_
|
|
400
|
-
- Commit with title `Bump version to x.y.z`
|
|
401
|
-
|
|
402
|
-
3. `bundle exec rake release`
|
|
403
|
-
|
|
404
|
-
## Copyright & License
|
|
405
|
-
|
|
406
|
-
Copyright (c) 2012-2024 Marc Siegel.
|
|
407
|
-
|
|
408
|
-
Licensed under the [MIT License](http://choosealicense.com/licenses/mit/),
|
|
409
|
-
see [LICENSE](LICENSE) for details.
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative "lib/docile/version"
|
|
4
|
-
|
|
5
|
-
Gem::Specification.new do |s|
|
|
6
|
-
s.name = "docile"
|
|
7
|
-
s.version = Docile::VERSION
|
|
8
|
-
s.author = "Marc Siegel"
|
|
9
|
-
s.email = "marc@usainnov.com"
|
|
10
|
-
s.homepage = "https://ms-ati.github.io/docile/"
|
|
11
|
-
s.summary = "Docile keeps your Ruby DSLs tame and well-behaved."
|
|
12
|
-
s.description = "Docile treats the methods of a given ruby object as a DSL "\
|
|
13
|
-
"(domain specific language) within a given block. \n\n"\
|
|
14
|
-
"Killer feature: you can also reference methods, instance "\
|
|
15
|
-
"variables, and local variables from the original (non-DSL) "\
|
|
16
|
-
"context within the block. \n\n"\
|
|
17
|
-
"Docile releases follow Semantic Versioning as defined at "\
|
|
18
|
-
"semver.org."
|
|
19
|
-
s.license = "MIT"
|
|
20
|
-
|
|
21
|
-
# Specify oldest supported Ruby version (2.5 to support JRuby 9.2.17.0)
|
|
22
|
-
s.required_ruby_version = ">= 2.5.0"
|
|
23
|
-
|
|
24
|
-
# Files included in the gem
|
|
25
|
-
s.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
26
|
-
f.match(%r{^(test|spec|features)/})
|
|
27
|
-
end
|
|
28
|
-
s.require_paths = ["lib"]
|
|
29
|
-
|
|
30
|
-
s.metadata = {
|
|
31
|
-
"homepage_uri" => "https://ms-ati.github.io/docile/",
|
|
32
|
-
"changelog_uri" => "https://github.com/ms-ati/docile/blob/main/HISTORY.md",
|
|
33
|
-
"source_code_uri" => "https://github.com/ms-ati/docile",
|
|
34
|
-
"rubygems_mfa_required" => "true",
|
|
35
|
-
}
|
|
36
|
-
end
|