diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c92e80dc6e..91b321dd88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - ruby: ["3.2", "3.3", "3.4"] + ruby: ["3.3", "3.4", "4.0"] runs-on: ${{ matrix.os }} timeout-minutes: 40 name: Ruby ${{ matrix.ruby }} on ${{ matrix.os }} diff --git a/.ruby-version b/.ruby-version index 4f5e69734c..fcdb2e109f 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.4.5 +4.0.0 diff --git a/Gemfile.lock b/Gemfile.lock index 32c0062da7..94e36dd68f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,23 +10,23 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - benchmark (0.4.1) - date (3.4.1) - debug (1.11.0) + benchmark (0.5.0) + date (3.5.1) + debug (1.11.1) irb (~> 1.10) reline (>= 0.3.8) - erb (5.0.2) + erb (6.0.1) erubi (1.13.1) - io-console (0.8.1) - irb (1.15.2) + io-console (0.8.2) + irb (1.16.0) pp (>= 0.6.0) rdoc (>= 4.0.0) reline (>= 0.4.2) - json (2.13.0) + json (2.18.0) language_server-protocol (3.17.0.5) lint_roller (1.1.0) logger (1.7.0) - minitest (5.25.5) + minitest (5.27.0) mocha (2.7.1) ruby2_keywords (>= 0.0.5) netrc (0.11.0) @@ -35,31 +35,32 @@ GEM ast (~> 2.4.1) racc power_assert (2.0.5) - pp (0.6.2) + pp (0.6.3) prettyprint prettier_print (1.2.1) prettyprint (0.2.0) prism (1.7.0) - psych (5.2.6) + psych (5.3.1) date stringio racc (1.8.1) rainbow (3.1.1) - rake (13.3.0) + rake (13.3.1) rbi (0.3.6) prism (~> 1.0) rbs (>= 3.4.4) rbs (4.0.0.dev.4) logger prism (>= 1.3.0) - rdoc (6.14.2) + rdoc (7.0.3) erb psych (>= 4.0.0) + tsort regexp_parser (2.10.0) - reline (0.6.1) + reline (0.6.3) io-console (~> 0.5) require-hooks (0.2.2) - rexml (3.4.1) + rexml (3.4.4) rubocop (1.78.0) json (~> 2.3) language_server-protocol (~> 3.17.0.2) @@ -103,7 +104,7 @@ GEM rexml (>= 3.2.6) sorbet-static-and-runtime (>= 0.5.10187) thor (>= 0.19.2) - stringio (3.1.7) + stringio (3.2.0) syntax_tree (6.3.0) prettier_print (>= 1.2.0) tapioca (0.17.7) @@ -120,9 +121,10 @@ GEM test-unit (3.7.0) power_assert thor (1.3.2) + tsort (0.2.0) unicode-display_width (3.1.4) unicode-emoji (~> 4.0, >= 4.0.4) - unicode-emoji (4.0.4) + unicode-emoji (4.2.0) yard (0.9.37) yard-sorbet (0.9.0) sorbet-runtime @@ -154,38 +156,38 @@ DEPENDENCIES CHECKSUMS ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383 - benchmark (0.4.1) sha256=d4ef40037bba27f03b28013e219b950b82bace296549ec15a78016552f8d2cce - date (3.4.1) sha256=bf268e14ef7158009bfeaec40b5fa3c7271906e88b196d958a89d4b408abe64f - debug (1.11.0) sha256=1425db64cfa0130c952684e3dc974985be201dd62899bf4bbe3f8b5d6cf1aef2 - erb (5.0.2) sha256=d30f258143d4300fb4ecf430042ac12970c9bb4b33c974a545b8f58c1ec26c0f + benchmark (0.5.0) sha256=465df122341aedcb81a2a24b4d3bd19b6c67c1530713fd533f3ff034e419236c + date (3.5.1) sha256=750d06384d7b9c15d562c76291407d89e368dda4d4fff957eb94962d325a0dc0 + debug (1.11.1) sha256=2e0b0ac6119f2207a6f8ac7d4a73ca8eb4e440f64da0a3136c30343146e952b6 + erb (6.0.1) sha256=28ecdd99c5472aebd5674d6061e3c6b0a45c049578b071e5a52c2a7f13c197e5 erubi (1.13.1) sha256=a082103b0885dbc5ecf1172fede897f9ebdb745a4b97a5e8dc63953db1ee4ad9 - io-console (0.8.1) sha256=1e15440a6b2f67b6ea496df7c474ed62c860ad11237f29b3bd187f054b925fcb - irb (1.15.2) sha256=222f32952e278da34b58ffe45e8634bf4afc2dc7aa9da23fed67e581aa50fdba - json (2.13.0) sha256=a4bdf1ce8db5617ec6c59e021db4a398e54b57b335e1fa417ac7badc3fb7c1a0 + io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc + irb (1.16.0) sha256=2abe56c9ac947cdcb2f150572904ba798c1e93c890c256f8429981a7675b0806 + json (2.18.0) sha256=b10506aee4183f5cf49e0efc48073d7b75843ce3782c68dbeb763351c08fd505 language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87 logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203 - minitest (5.25.5) sha256=391b6c6cb43a4802bfb7c93af1ebe2ac66a210293f4a3fb7db36f2fc7dc2c756 + minitest (5.27.0) sha256=2d3b17f8a36fe7801c1adcffdbc38233b938eb0b4966e97a6739055a45fa77d5 mocha (2.7.1) sha256=8f7d538d5d3ebc75fc788b3d92fbab913a93a78462d2a3ce99d1bdde7af7f851 netrc (0.11.0) sha256=de1ce33da8c99ab1d97871726cba75151113f117146becbe45aa85cb3dabee3f parallel (1.27.0) sha256=4ac151e1806b755fb4e2dc2332cbf0e54f2e24ba821ff2d3dcf86bf6dc4ae130 parser (3.3.8.0) sha256=2476364142b307fa5a1b1ece44f260728be23858a9c71078e956131a75453c45 power_assert (2.0.5) sha256=63b511b85bb8ea57336d25156864498644f5bbf028699ceda27949e0125bc323 - pp (0.6.2) sha256=947ec3120c6f92195f8ee8aa25a7b2c5297bb106d83b41baa02983686577b6ff + pp (0.6.3) sha256=2951d514450b93ccfeb1df7d021cae0da16e0a7f95ee1e2273719669d0ab9df6 prettier_print (1.2.1) sha256=a72838b5f23facff21f90a5423cdcdda19e4271092b41f4ea7f50b83929e6ff9 prettyprint (0.2.0) sha256=2bc9e15581a94742064a3cc8b0fb9d45aae3d03a1baa6ef80922627a0766f193 prism (1.7.0) sha256=10062f734bf7985c8424c44fac382ac04a58124ea3d220ec3ba9fe4f2da65103 - psych (5.2.6) sha256=814328aa5dcb6d604d32126a20bc1cbcf05521a5b49dbb1a8b30a07e580f316e + psych (5.3.1) sha256=eb7a57cef10c9d70173ff74e739d843ac3b2c019a003de48447b2963d81b1974 racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a - rake (13.3.0) sha256=96f5092d786ff412c62fde76f793cc0541bd84d2eb579caa529aa8a059934493 + rake (13.3.1) sha256=8c9e89d09f66a26a01264e7e3480ec0607f0c497a861ef16063604b1b08eb19c rbi (0.3.6) sha256=577e94ddd123d7c83794dd62c06c5f9bf32a22e9a3a0d2f9baf32f7c81b2b5fa rbs (4.0.0.dev.4) sha256=a4a22ba03d2450e2a18c312b0b05cdc7b8b5d5c9fe255fc32cfea12ff1dd058b - rdoc (6.14.2) sha256=9fdd44df130f856ae70cc9a264dfd659b9b40de369b16581f4ab746e42439226 + rdoc (7.0.3) sha256=dfe3d0981d19b7bba71d9dbaeb57c9f4e3a7a4103162148a559c4fc687ea81f9 regexp_parser (2.10.0) sha256=cb6f0ddde88772cd64bff1dbbf68df66d376043fe2e66a9ef77fcb1b0c548c61 - reline (0.6.1) sha256=1afcc9d7cb1029cdbe780d72f2f09251ce46d3780050f3ec39c3ccc6b60675fb + reline (0.6.3) sha256=1198b04973565b36ec0f11542ab3f5cfeeec34823f4e54cebde90968092b1835 require-hooks (0.2.2) sha256=effa81b61a669ca00cb1e8910411e0d6a8bb16b49a53d9e69b5e6372d6c90f31 - rexml (3.4.1) sha256=c74527a9a0a04b4ec31dbe0dc4ed6004b960af943d8db42e539edde3a871abca + rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142 rubocop (1.78.0) sha256=8b74a6f912eb4fd3e6878851f7f7f45dcad8c7185c34250d4f952b0ee80d6bc0 rubocop-ast (1.46.0) sha256=0da7f6ad5b98614f89b74f11873c191059c823eae07d6ffd40a42a3338f2232b rubocop-minitest (0.38.1) sha256=f997aa8043d45b1556b818f5dec872ad03c1ab97cd3fb721b0c2aef02dbf7a81 @@ -201,15 +203,16 @@ CHECKSUMS sorbet-static (0.5.12230-x86_64-linux) sha256=5525a2e9e870020ddb668c3ed2dbff1839817015b2482d934aa456182e287266 sorbet-static-and-runtime (0.5.12230) sha256=afea11eddbe145806354f6b4060d7883bf4dcc7015fdd463eb401bdbc9b7be7f spoom (1.7.4) sha256=9755877653a9be409dacf1663e97617734bc1607e3237866bcd7d4a9f23f68fb - stringio (3.1.7) sha256=5b78b7cb242a315fb4fca61a8255d62ec438f58da2b90be66048546ade4507fa + stringio (3.2.0) sha256=c37cb2e58b4ffbd33fe5cd948c05934af997b36e0b6ca6fdf43afa234cf222e1 syntax_tree (6.3.0) sha256=56e25a9692c798ec94c5442fe94c5e94af76bef91edc8bb02052cbdecf35f13d tapioca (0.17.7) sha256=1efb7be004f269a9cf23c97ed419338598bddfd653e3a5ac0760694e0ebfba9b test-unit (3.7.0) sha256=2b5745498c848768e1774acb63e3806d3bb47e2943bd91cc9bf559b4c6d4faa1 thor (1.3.2) sha256=eef0293b9e24158ccad7ab383ae83534b7ad4ed99c09f96f1a6b036550abbeda + tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f unicode-display_width (3.1.4) sha256=8caf2af1c0f2f07ec89ef9e18c7d88c2790e217c482bfc78aaa65eadd5415ac1 - unicode-emoji (4.0.4) sha256=2c2c4ef7f353e5809497126285a50b23056cc6e61b64433764a35eff6c36532a + unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f yard (0.9.37) sha256=a6e910399e78e613f80ba9add9ba7c394b1a935f083cccbef82903a3d2a26992 yard-sorbet (0.9.0) sha256=03d1aa461b9e9c82b886919a13aa3e09fcf4d1852239d2967ed97e92723ffe21 BUNDLED WITH - 4.0.2 + 4.0.3 diff --git a/exe/ruby-lsp-launcher b/exe/ruby-lsp-launcher index 4987697126..f694c64a30 100755 --- a/exe/ruby-lsp-launcher +++ b/exe/ruby-lsp-launcher @@ -108,7 +108,10 @@ rescue Bundler::GemNotFound, Bundler::GitError unless install_error || ARGV.include?("--retry") $stderr.puts("Initial bundle compose succeeded, but Bundler.setup failed. Trying to restart from scratch...") File.write(raw_initialize_path, raw_initialize) - exec(Gem.ruby, __FILE__, *ARGV, "--retry") + + Bundler.with_unbundled_env do + exec(Gem.ruby, __FILE__, *ARGV, "--retry") + end end rescue StandardError => e setup_error = e diff --git a/jekyll/Gemfile b/jekyll/Gemfile index 8749651eb1..99a0ef0f38 100644 --- a/jekyll/Gemfile +++ b/jekyll/Gemfile @@ -4,6 +4,7 @@ source "https://rubygems.org" # We only need to use Jekyll with CRuby +gem "logger" gem "jekyll", "~> 4.4.1" gem "jekyll-feed", "~> 0.12" gem "jekyll-redirect-from" diff --git a/jekyll/Gemfile.lock b/jekyll/Gemfile.lock index 9e71e5bec1..c0f473a3d8 100644 --- a/jekyll/Gemfile.lock +++ b/jekyll/Gemfile.lock @@ -28,21 +28,6 @@ GEM google-protobuf (4.33.2) bigdecimal rake (>= 13) - google-protobuf (4.33.2-aarch64-linux-gnu) - bigdecimal - rake (>= 13) - google-protobuf (4.33.2-aarch64-linux-musl) - bigdecimal - rake (>= 13) - google-protobuf (4.33.2-arm64-darwin) - bigdecimal - rake (>= 13) - google-protobuf (4.33.2-x86-linux-gnu) - bigdecimal - rake (>= 13) - google-protobuf (4.33.2-x86-linux-musl) - bigdecimal - rake (>= 13) google-protobuf (4.33.2-x86_64-darwin) bigdecimal rake (>= 13) @@ -100,6 +85,7 @@ GEM listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) + logger (1.7.0) mercenary (0.4.0) pathutil (0.16.2) forwardable-extended (~> 2.6) @@ -185,6 +171,7 @@ DEPENDENCIES jekyll-feed (~> 0.12) jekyll-redirect-from just-the-docs (~> 0.11.1) + logger BUNDLED WITH - 2.5.11 + 4.0.3 diff --git a/lib/ruby_indexer/test/configuration_test.rb b/lib/ruby_indexer/test/configuration_test.rb index e57ab28683..2576b57469 100644 --- a/lib/ruby_indexer/test/configuration_test.rb +++ b/lib/ruby_indexer/test/configuration_test.rb @@ -233,18 +233,16 @@ def test_does_not_fail_if_there_are_missing_specs_due_to_platform_constraints RUBY Bundler.with_unbundled_env do - capture_subprocess_io { system("bundle install") } + capture_subprocess_io do + system("bundle install") - _stdout, stderr = capture_subprocess_io do script = [ "require \"ruby_lsp/internal\"", "RubyIndexer::Configuration.new.indexable_uris", ].join(";") - system("bundle exec ruby -e '#{script}'") + assert(system("bundle exec ruby -e '#{script}'")) end - - assert_empty(stderr) end end end diff --git a/sorbet/rbi/gems/benchmark@0.4.1.rbi b/sorbet/rbi/gems/benchmark@0.5.0.rbi similarity index 90% rename from sorbet/rbi/gems/benchmark@0.4.1.rbi rename to sorbet/rbi/gems/benchmark@0.5.0.rbi index e29780e7ed..8531eefe03 100644 --- a/sorbet/rbi/gems/benchmark@0.4.1.rbi +++ b/sorbet/rbi/gems/benchmark@0.5.0.rbi @@ -239,6 +239,15 @@ module Benchmark # source://benchmark//lib/benchmark.rb#303 def measure(label = T.unsafe(nil)); end + # Returns the elapsed real time used to execute the given block. + # The unit of time is milliseconds. + # + # Benchmark.ms { "a" * 1_000_000_000 } + # #=> 509.8029999935534 + # + # source://benchmark//lib/benchmark.rb#335 + def ms; end + # Returns the elapsed real time used to execute the given block. # The unit of time is seconds. # @@ -290,7 +299,7 @@ module Benchmark # >total: 2.930000 0.000000 2.930000 ( 2.932889) # >avg: 0.976667 0.000000 0.976667 ( 0.977630) # - # source://benchmark//lib/benchmark.rb#328 + # source://benchmark//lib/benchmark.rb#341 def benchmark(caption = T.unsafe(nil), label_width = T.unsafe(nil), format = T.unsafe(nil), *labels); end # A simple interface to the #benchmark method, #bm generates sequential @@ -313,7 +322,7 @@ module Benchmark # times: 0.960000 0.000000 0.960000 ( 0.960423) # upto: 0.950000 0.000000 0.950000 ( 0.954864) # - # source://benchmark//lib/benchmark.rb#328 + # source://benchmark//lib/benchmark.rb#341 def bm(label_width = T.unsafe(nil), *labels, &blk); end # Sometimes benchmark results are skewed because code executed @@ -353,7 +362,7 @@ module Benchmark # #bmbm yields a Benchmark::Job object and returns an array of # Benchmark::Tms objects. # - # source://benchmark//lib/benchmark.rb#328 + # source://benchmark//lib/benchmark.rb#341 def bmbm(width = T.unsafe(nil)); end # Returns the time used to execute the given block as a @@ -372,16 +381,25 @@ module Benchmark # # 0.220000 0.000000 0.220000 ( 0.227313) # - # source://benchmark//lib/benchmark.rb#328 + # source://benchmark//lib/benchmark.rb#341 def measure(label = T.unsafe(nil)); end + # Returns the elapsed real time used to execute the given block. + # The unit of time is milliseconds. + # + # Benchmark.ms { "a" * 1_000_000_000 } + # #=> 509.8029999935534 + # + # source://benchmark//lib/benchmark.rb#341 + def ms; end + # Returns the elapsed real time used to execute the given block. # The unit of time is seconds. # # Benchmark.realtime { "a" * 1_000_000_000 } # #=> 0.5098029999935534 # - # source://benchmark//lib/benchmark.rb#328 + # source://benchmark//lib/benchmark.rb#341 def realtime; end end end @@ -389,7 +407,7 @@ end # A Job is a sequence of labelled blocks to be processed by the # Benchmark.bmbm method. It is of little direct interest to the user. # -# source://benchmark//lib/benchmark.rb#334 +# source://benchmark//lib/benchmark.rb#347 class Benchmark::Job # Returns an initialized Job instance. # Usually, one doesn't call this method directly, as new @@ -399,38 +417,38 @@ class Benchmark::Job # # @return [Job] a new instance of Job # - # source://benchmark//lib/benchmark.rb#342 + # source://benchmark//lib/benchmark.rb#355 def initialize(width); end # Registers the given label and block pair in the job list. # # @raise [ArgumentError] # - # source://benchmark//lib/benchmark.rb#350 + # source://benchmark//lib/benchmark.rb#363 def item(label = T.unsafe(nil), &blk); end # An array of 2-element arrays, consisting of label and block pairs. # - # source://benchmark//lib/benchmark.rb#362 + # source://benchmark//lib/benchmark.rb#375 def list; end # Registers the given label and block pair in the job list. # # @raise [ArgumentError] # - # source://benchmark//lib/benchmark.rb#359 + # source://benchmark//lib/benchmark.rb#372 def report(label = T.unsafe(nil), &blk); end # Length of the widest label in the #list. # - # source://benchmark//lib/benchmark.rb#365 + # source://benchmark//lib/benchmark.rb#378 def width; end end # This class is used by the Benchmark.benchmark and Benchmark.bm methods. # It is of little direct interest to the user. # -# source://benchmark//lib/benchmark.rb#372 +# source://benchmark//lib/benchmark.rb#385 class Benchmark::Report # Returns an initialized Report instance. # Usually, one doesn't call this method directly, as new @@ -440,43 +458,43 @@ class Benchmark::Report # # @return [Report] a new instance of Report # - # source://benchmark//lib/benchmark.rb#380 + # source://benchmark//lib/benchmark.rb#393 def initialize(width = T.unsafe(nil), format = T.unsafe(nil)); end # An array of Benchmark::Tms objects representing each item. # - # source://benchmark//lib/benchmark.rb#399 + # source://benchmark//lib/benchmark.rb#412 def format; end # Prints the +label+ and measured time for the block, # formatted by +format+. See Tms#format for the # formatting rules. # - # source://benchmark//lib/benchmark.rb#389 + # source://benchmark//lib/benchmark.rb#402 def item(label = T.unsafe(nil), *format, &blk); end # An array of Benchmark::Tms objects representing each item. # - # source://benchmark//lib/benchmark.rb#399 + # source://benchmark//lib/benchmark.rb#412 def list; end # Prints the +label+ and measured time for the block, # formatted by +format+. See Tms#format for the # formatting rules. # - # source://benchmark//lib/benchmark.rb#396 + # source://benchmark//lib/benchmark.rb#409 def report(label = T.unsafe(nil), *format, &blk); end # An array of Benchmark::Tms objects representing each item. # - # source://benchmark//lib/benchmark.rb#399 + # source://benchmark//lib/benchmark.rb#412 def width; end end # A data object, representing the times associated with a benchmark # measurement. # -# source://benchmark//lib/benchmark.rb#408 +# source://benchmark//lib/benchmark.rb#421 class Benchmark::Tms # Returns an initialized Tms object which has # +utime+ as the user CPU time, +stime+ as the system CPU time, @@ -485,13 +503,13 @@ class Benchmark::Tms # # @return [Tms] a new instance of Tms # - # source://benchmark//lib/benchmark.rb#443 + # source://benchmark//lib/benchmark.rb#456 def initialize(utime = T.unsafe(nil), stime = T.unsafe(nil), cutime = T.unsafe(nil), cstime = T.unsafe(nil), real = T.unsafe(nil), label = T.unsafe(nil)); end # Returns a new Tms object obtained by memberwise multiplication # of the individual times for this Tms object by +x+. # - # source://benchmark//lib/benchmark.rb#491 + # source://benchmark//lib/benchmark.rb#504 def *(x); end # Returns a new Tms object obtained by memberwise summation @@ -499,27 +517,27 @@ class Benchmark::Tms # Tms object. # This method and #/() are useful for taking statistics. # - # source://benchmark//lib/benchmark.rb#478 + # source://benchmark//lib/benchmark.rb#491 def +(other); end # Returns a new Tms object obtained by memberwise subtraction # of the individual times for the +other+ Tms object from those of this # Tms object. # - # source://benchmark//lib/benchmark.rb#485 + # source://benchmark//lib/benchmark.rb#498 def -(other); end # Returns a new Tms object obtained by memberwise division # of the individual times for this Tms object by +x+. # This method and #+() are useful for taking statistics. # - # source://benchmark//lib/benchmark.rb#498 + # source://benchmark//lib/benchmark.rb#511 def /(x); end # Returns a new Tms object whose times are the sum of the times for this # Tms object, plus the time required to execute the code block (+blk+). # - # source://benchmark//lib/benchmark.rb#452 + # source://benchmark//lib/benchmark.rb#465 def add(&blk); end # An in-place version of #add. @@ -527,17 +545,17 @@ class Benchmark::Tms # for this Tms object, plus the time required to execute # the code block (+blk+). # - # source://benchmark//lib/benchmark.rb#462 + # source://benchmark//lib/benchmark.rb#475 def add!(&blk); end # System CPU time of children # - # source://benchmark//lib/benchmark.rb#426 + # source://benchmark//lib/benchmark.rb#439 def cstime; end # User CPU time of children # - # source://benchmark//lib/benchmark.rb#423 + # source://benchmark//lib/benchmark.rb#436 def cutime; end # Returns the contents of this Tms object as @@ -556,22 +574,22 @@ class Benchmark::Tms # If +format+ is not given, FORMAT is used as default value, detailing the # user, system, total and real elapsed time. # - # source://benchmark//lib/benchmark.rb#517 + # source://benchmark//lib/benchmark.rb#530 def format(format = T.unsafe(nil), *args); end # Label # - # source://benchmark//lib/benchmark.rb#435 + # source://benchmark//lib/benchmark.rb#448 def label; end # Elapsed real time # - # source://benchmark//lib/benchmark.rb#429 + # source://benchmark//lib/benchmark.rb#442 def real; end # System CPU time # - # source://benchmark//lib/benchmark.rb#420 + # source://benchmark//lib/benchmark.rb#433 def stime; end # Returns a new 6-element array, consisting of the @@ -579,27 +597,27 @@ class Benchmark::Tms # user CPU time, children's system CPU time and elapsed # real time. # - # source://benchmark//lib/benchmark.rb#542 + # source://benchmark//lib/benchmark.rb#555 def to_a; end # Returns a hash containing the same data as `to_a`. # - # source://benchmark//lib/benchmark.rb#549 + # source://benchmark//lib/benchmark.rb#562 def to_h; end # Same as #format. # - # source://benchmark//lib/benchmark.rb#532 + # source://benchmark//lib/benchmark.rb#545 def to_s; end # Total time, that is +utime+ + +stime+ + +cutime+ + +cstime+ # - # source://benchmark//lib/benchmark.rb#432 + # source://benchmark//lib/benchmark.rb#445 def total; end # User CPU time # - # source://benchmark//lib/benchmark.rb#417 + # source://benchmark//lib/benchmark.rb#430 def utime; end protected @@ -611,7 +629,7 @@ class Benchmark::Tms # +op+ can be a mathematical operation such as +, -, # *, / # - # source://benchmark//lib/benchmark.rb#570 + # source://benchmark//lib/benchmark.rb#583 def memberwise(op, x); end end diff --git a/sorbet/rbi/gems/date@3.4.1.rbi b/sorbet/rbi/gems/date@3.5.1.rbi similarity index 100% rename from sorbet/rbi/gems/date@3.4.1.rbi rename to sorbet/rbi/gems/date@3.5.1.rbi diff --git a/sorbet/rbi/gems/erb@5.0.2.rbi b/sorbet/rbi/gems/erb@5.0.2.rbi deleted file mode 100644 index 8ab060e0ab..0000000000 --- a/sorbet/rbi/gems/erb@5.0.2.rbi +++ /dev/null @@ -1,879 +0,0 @@ -# typed: false - -# DO NOT EDIT MANUALLY -# This is an autogenerated file for types exported from the `erb` gem. -# Please instead update this file by running `bin/tapioca gem erb`. - - -# = ERB -- Ruby Templating -# -# == Introduction -# -# ERB provides an easy to use but powerful templating system for Ruby. Using -# ERB, actual Ruby code can be added to any plain text document for the -# purposes of generating document information details and/or flow control. -# -# A very simple example is this: -# -# require 'erb' -# -# x = 42 -# template = ERB.new <<-EOF -# The value of x is: <%= x %> -# EOF -# puts template.result(binding) -# -# Prints: The value of x is: 42 -# -# More complex examples are given below. -# -# -# == Recognized Tags -# -# ERB recognizes certain tags in the provided template and converts them based -# on the rules below: -# -# <% Ruby code -- inline with output %> -# <%= Ruby expression -- replace with result %> -# <%# comment -- ignored -- useful in testing %> (`<% #` doesn't work. Don't use Ruby comments.) -# % a line of Ruby code -- treated as <% line %> (optional -- see ERB.new) -# %% replaced with % if first thing on a line and % processing is used -# <%% or %%> -- replace with <% or %> respectively -# -# All other text is passed through ERB filtering unchanged. -# -# -# == Options -# -# There are several settings you can change when you use ERB: -# * the nature of the tags that are recognized; -# * the binding used to resolve local variables in the template. -# -# See the ERB.new and ERB#result methods for more detail. -# -# == Character encodings -# -# ERB (or Ruby code generated by ERB) returns a string in the same -# character encoding as the input string. When the input string has -# a magic comment, however, it returns a string in the encoding specified -# by the magic comment. -# -# # -*- coding: utf-8 -*- -# require 'erb' -# -# template = ERB.new < -# \_\_ENCODING\_\_ is <%= \_\_ENCODING\_\_ %>. -# EOF -# puts template.result -# -# Prints: \_\_ENCODING\_\_ is Big5. -# -# -# == Examples -# -# === Plain Text -# -# ERB is useful for any generic templating situation. Note that in this example, we use the -# convenient "% at start of line" tag, and we quote the template literally with -# %q{...} to avoid trouble with the backslash. -# -# require "erb" -# -# # Create template. -# template = %q{ -# From: James Edward Gray II -# To: <%= to %> -# Subject: Addressing Needs -# -# <%= to[/\w+/] %>: -# -# Just wanted to send a quick note assuring that your needs are being -# addressed. -# -# I want you to know that my team will keep working on the issues, -# especially: -# -# <%# ignore numerous minor requests -- focus on priorities %> -# % priorities.each do |priority| -# * <%= priority %> -# % end -# -# Thanks for your patience. -# -# James Edward Gray II -# }.gsub(/^ /, '') -# -# message = ERB.new(template, trim_mode: "%<>") -# -# # Set up template data. -# to = "Community Spokesman " -# priorities = [ "Run Ruby Quiz", -# "Document Modules", -# "Answer Questions on Ruby Talk" ] -# -# # Produce result. -# email = message.result -# puts email -# -# Generates: -# -# From: James Edward Gray II -# To: Community Spokesman -# Subject: Addressing Needs -# -# Community: -# -# Just wanted to send a quick note assuring that your needs are being addressed. -# -# I want you to know that my team will keep working on the issues, especially: -# -# * Run Ruby Quiz -# * Document Modules -# * Answer Questions on Ruby Talk -# -# Thanks for your patience. -# -# James Edward Gray II -# -# === Ruby in HTML -# -# ERB is often used in .rhtml files (HTML with embedded Ruby). Notice the need in -# this example to provide a special binding when the template is run, so that the instance -# variables in the Product object can be resolved. -# -# require "erb" -# -# # Build template data class. -# class Product -# def initialize( code, name, desc, cost ) -# @code = code -# @name = name -# @desc = desc -# @cost = cost -# -# @features = [ ] -# end -# -# def add_feature( feature ) -# @features << feature -# end -# -# # Support templating of member data. -# def get_binding -# binding -# end -# -# # ... -# end -# -# # Create template. -# template = %{ -# -# Ruby Toys -- <%= @name %> -# -# -#

<%= @name %> (<%= @code %>)

-#

<%= @desc %>

-# -#
    -# <% @features.each do |f| %> -#
  • <%= f %>
  • -# <% end %> -#
-# -#

-# <% if @cost < 10 %> -# Only <%= @cost %>!!! -# <% else %> -# Call for a price, today! -# <% end %> -#

-# -# -# -# }.gsub(/^ /, '') -# -# rhtml = ERB.new(template) -# -# # Set up template data. -# toy = Product.new( "TZ-1002", -# "Rubysapien", -# "Geek's Best Friend! Responds to Ruby commands...", -# 999.95 ) -# toy.add_feature("Listens for verbal commands in the Ruby language!") -# toy.add_feature("Ignores Perl, Java, and all C variants.") -# toy.add_feature("Karate-Chop Action!!!") -# toy.add_feature("Matz signature on left leg.") -# toy.add_feature("Gem studded eyes... Rubies, of course!") -# -# # Produce result. -# rhtml.run(toy.get_binding) -# -# Generates (some blank lines removed): -# -# -# Ruby Toys -- Rubysapien -# -# -#

Rubysapien (TZ-1002)

-#

Geek's Best Friend! Responds to Ruby commands...

-# -#
    -#
  • Listens for verbal commands in the Ruby language!
  • -#
  • Ignores Perl, Java, and all C variants.
  • -#
  • Karate-Chop Action!!!
  • -#
  • Matz signature on left leg.
  • -#
  • Gem studded eyes... Rubies, of course!
  • -#
-# -#

-# Call for a price, today! -#

-# -# -# -# -# -# == Notes -# -# There are a variety of templating solutions available in various Ruby projects. -# For example, RDoc, distributed with Ruby, uses its own template engine, which -# can be reused elsewhere. -# -# Other popular engines could be found in the corresponding -# {Category}[https://www.ruby-toolbox.com/categories/template_engines] of -# The Ruby Toolbox. -# -# source://erb//lib/erb/version.rb#2 -class ERB - # Constructs a new ERB object with the template specified in _str_. - # - # An ERB object works by building a chunk of Ruby code that will output - # the completed template when run. - # - # If _trim_mode_ is passed a String containing one or more of the following - # modifiers, ERB will adjust its code generation as listed: - # - # % enables Ruby code processing for lines beginning with % - # <> omit newline for lines starting with <% and ending in %> - # > omit newline for lines ending in %> - # - omit blank lines ending in -%> - # - # _eoutvar_ can be used to set the name of the variable ERB will build up - # its output in. This is useful when you need to run multiple ERB - # templates through the same binding and/or when you want to control where - # output ends up. Pass the name of the variable to be used inside a String. - # - # === Example - # - # require "erb" - # - # # build data class - # class Listings - # PRODUCT = { :name => "Chicken Fried Steak", - # :desc => "A well messaged pattie, breaded and fried.", - # :cost => 9.95 } - # - # attr_reader :product, :price - # - # def initialize( product = "", price = "" ) - # @product = product - # @price = price - # end - # - # def build - # b = binding - # # create and run templates, filling member data variables - # ERB.new(<<~'END_PRODUCT', trim_mode: "", eoutvar: "@product").result b - # <%= PRODUCT[:name] %> - # <%= PRODUCT[:desc] %> - # END_PRODUCT - # ERB.new(<<~'END_PRICE', trim_mode: "", eoutvar: "@price").result b - # <%= PRODUCT[:name] %> -- <%= PRODUCT[:cost] %> - # <%= PRODUCT[:desc] %> - # END_PRICE - # end - # end - # - # # setup template data - # listings = Listings.new - # listings.build - # - # puts listings.product + "\n" + listings.price - # - # _Generates_ - # - # Chicken Fried Steak - # A well massaged pattie, breaded and fried. - # - # Chicken Fried Steak -- 9.95 - # A well massaged pattie, breaded and fried. - # - # @return [ERB] a new instance of ERB - # - # source://erb//lib/erb.rb#334 - def initialize(str, safe_level = T.unsafe(nil), legacy_trim_mode = T.unsafe(nil), legacy_eoutvar = T.unsafe(nil), trim_mode: T.unsafe(nil), eoutvar: T.unsafe(nil)); end - - # Define unnamed class which has _methodname_ as instance method, and return it. - # - # example: - # class MyClass_ - # def initialize(arg1, arg2) - # @arg1 = arg1; @arg2 = arg2 - # end - # end - # filename = 'example.rhtml' # @arg1 and @arg2 are used in example.rhtml - # erb = ERB.new(File.read(filename)) - # erb.filename = filename - # MyClass = erb.def_class(MyClass_, 'render()') - # print MyClass.new('foo', 123).render() - # - # source://erb//lib/erb.rb#499 - def def_class(superklass = T.unsafe(nil), methodname = T.unsafe(nil)); end - - # Define _methodname_ as instance method of _mod_ from compiled Ruby source. - # - # example: - # filename = 'example.rhtml' # 'arg1' and 'arg2' are used in example.rhtml - # erb = ERB.new(File.read(filename)) - # erb.def_method(MyClass, 'render(arg1, arg2)', filename) - # print MyClass.new.render('foo', 123) - # - # source://erb//lib/erb.rb#463 - def def_method(mod, methodname, fname = T.unsafe(nil)); end - - # Create unnamed module, define _methodname_ as instance method of it, and return it. - # - # example: - # filename = 'example.rhtml' # 'arg1' and 'arg2' are used in example.rhtml - # erb = ERB.new(File.read(filename)) - # erb.filename = filename - # MyModule = erb.def_module('render(arg1, arg2)') - # class MyClass - # include MyModule - # end - # - # source://erb//lib/erb.rb#480 - def def_module(methodname = T.unsafe(nil)); end - - # The encoding to eval - # - # source://erb//lib/erb.rb#369 - def encoding; end - - # The optional _filename_ argument passed to Kernel#eval when the ERB code - # is run - # - # source://erb//lib/erb.rb#373 - def filename; end - - # The optional _filename_ argument passed to Kernel#eval when the ERB code - # is run - # - # source://erb//lib/erb.rb#373 - def filename=(_arg0); end - - # The optional _lineno_ argument passed to Kernel#eval when the ERB code - # is run - # - # source://erb//lib/erb.rb#377 - def lineno; end - - # The optional _lineno_ argument passed to Kernel#eval when the ERB code - # is run - # - # source://erb//lib/erb.rb#377 - def lineno=(_arg0); end - - # Sets optional filename and line number that will be used in ERB code - # evaluation and error reporting. See also #filename= and #lineno= - # - # erb = ERB.new('<%= some_x %>') - # erb.render - # # undefined local variable or method `some_x' - # # from (erb):1 - # - # erb.location = ['file.erb', 3] - # # All subsequent error reporting would use new location - # erb.render - # # undefined local variable or method `some_x' - # # from file.erb:4 - # - # source://erb//lib/erb.rb#394 - def location=(_arg0); end - - # Creates a new compiler for ERB. See ERB::Compiler.new for details - # - # source://erb//lib/erb.rb#361 - def make_compiler(trim_mode); end - - # Executes the generated ERB code to produce a completed template, returning - # the results of that code. - # - # _b_ accepts a Binding object which is used to set the context of - # code evaluation. - # - # source://erb//lib/erb.rb#423 - def result(b = T.unsafe(nil)); end - - # Render a template on a new toplevel binding with local variables specified - # by a Hash object. - # - # source://erb//lib/erb.rb#432 - def result_with_hash(hash); end - - # Generate results and print them. (see ERB#result) - # - # source://erb//lib/erb.rb#412 - def run(b = T.unsafe(nil)); end - - # Can be used to set _eoutvar_ as described in ERB::new. It's probably - # easier to just use the constructor though, since calling this method - # requires the setup of an ERB _compiler_ object. - # - # source://erb//lib/erb.rb#404 - def set_eoutvar(compiler, eoutvar = T.unsafe(nil)); end - - # The Ruby code generated by ERB - # - # source://erb//lib/erb.rb#366 - def src; end - - private - - # Returns a new binding each time *near* TOPLEVEL_BINDING for runs that do - # not specify a binding. - # - # source://erb//lib/erb.rb#444 - def new_toplevel(vars = T.unsafe(nil)); end - - class << self - # Returns revision information for the erb.rb module. - # - # source://erb//lib/erb.rb#266 - def version; end - end -end - -# -- -# ERB::Compiler -# -# Compiles ERB templates into Ruby code; the compiled code produces the -# template result when evaluated. ERB::Compiler provides hooks to define how -# generated output is handled. -# -# Internally ERB does something like this to generate the code returned by -# ERB#src: -# -# compiler = ERB::Compiler.new('<>') -# compiler.pre_cmd = ["_erbout=+''"] -# compiler.put_cmd = "_erbout.<<" -# compiler.insert_cmd = "_erbout.<<" -# compiler.post_cmd = ["_erbout"] -# -# code, enc = compiler.compile("Got <%= obj %>!\n") -# puts code -# -# Generates: -# -# #coding:UTF-8 -# _erbout=+''; _erbout.<< "Got ".freeze; _erbout.<<(( obj ).to_s); _erbout.<< "!\n".freeze; _erbout -# -# By default the output is sent to the print method. For example: -# -# compiler = ERB::Compiler.new('<>') -# code, enc = compiler.compile("Got <%= obj %>!\n") -# puts code -# -# Generates: -# -# #coding:UTF-8 -# print "Got ".freeze; print(( obj ).to_s); print "!\n".freeze -# -# == Evaluation -# -# The compiled code can be used in any context where the names in the code -# correctly resolve. Using the last example, each of these print 'Got It!' -# -# Evaluate using a variable: -# -# obj = 'It' -# eval code -# -# Evaluate using an input: -# -# mod = Module.new -# mod.module_eval %{ -# def get(obj) -# #{code} -# end -# } -# extend mod -# get('It') -# -# Evaluate using an accessor: -# -# klass = Class.new Object -# klass.class_eval %{ -# attr_accessor :obj -# def initialize(obj) -# @obj = obj -# end -# def get_it -# #{code} -# end -# } -# klass.new('It').get_it -# -# Good! See also ERB#def_method, ERB#def_module, and ERB#def_class. -# -# source://erb//lib/erb/compiler.rb#73 -class ERB::Compiler - # Construct a new compiler using the trim_mode. See ERB::new for available - # trim modes. - # - # @return [Compiler] a new instance of Compiler - # - # source://erb//lib/erb/compiler.rb#433 - def initialize(trim_mode); end - - # source://erb//lib/erb/compiler.rb#315 - def add_insert_cmd(out, content); end - - # source://erb//lib/erb/compiler.rb#311 - def add_put_cmd(out, content); end - - # Compiles an ERB template into Ruby code. Returns an array of the code - # and encoding like ["code", Encoding]. - # - # @raise [ArgumentError] - # - # source://erb//lib/erb/compiler.rb#321 - def compile(s); end - - # source://erb//lib/erb/compiler.rb#381 - def compile_content(stag, out); end - - # source://erb//lib/erb/compiler.rb#368 - def compile_etag(etag, out, scanner); end - - # source://erb//lib/erb/compiler.rb#344 - def compile_stag(stag, out, scanner); end - - # The command to handle text that is inserted prior to a newline - # - # source://erb//lib/erb/compiler.rb#446 - def insert_cmd; end - - # The command to handle text that is inserted prior to a newline - # - # source://erb//lib/erb/compiler.rb#446 - def insert_cmd=(_arg0); end - - # source://erb//lib/erb/compiler.rb#427 - def make_scanner(src); end - - # Returns the value of attribute percent. - # - # source://erb//lib/erb/compiler.rb#440 - def percent; end - - # An array of commands appended to compiled code - # - # source://erb//lib/erb/compiler.rb#452 - def post_cmd; end - - # An array of commands appended to compiled code - # - # source://erb//lib/erb/compiler.rb#452 - def post_cmd=(_arg0); end - - # An array of commands prepended to compiled code - # - # source://erb//lib/erb/compiler.rb#449 - def pre_cmd; end - - # An array of commands prepended to compiled code - # - # source://erb//lib/erb/compiler.rb#449 - def pre_cmd=(_arg0); end - - # source://erb//lib/erb/compiler.rb#398 - def prepare_trim_mode(mode); end - - # The command to handle text that ends with a newline - # - # source://erb//lib/erb/compiler.rb#443 - def put_cmd; end - - # The command to handle text that ends with a newline - # - # source://erb//lib/erb/compiler.rb#443 - def put_cmd=(_arg0); end - - # Returns the value of attribute trim_mode. - # - # source://erb//lib/erb/compiler.rb#440 - def trim_mode; end - - private - - # A buffered text in #compile - # - # source://erb//lib/erb/compiler.rb#457 - def content; end - - # A buffered text in #compile - # - # source://erb//lib/erb/compiler.rb#457 - def content=(_arg0); end - - # source://erb//lib/erb/compiler.rb#459 - def detect_magic_comment(s, enc = T.unsafe(nil)); end - - # :startdoc: - # - # source://erb//lib/erb/compiler.rb#485 - def warn_invalid_trim_mode(mode, uplevel:); end -end - -# source://erb//lib/erb/compiler.rb#278 -class ERB::Compiler::Buffer - # @return [Buffer] a new instance of Buffer - # - # source://erb//lib/erb/compiler.rb#279 - def initialize(compiler, enc = T.unsafe(nil), frozen = T.unsafe(nil)); end - - # source://erb//lib/erb/compiler.rb#301 - def close; end - - # source://erb//lib/erb/compiler.rb#295 - def cr; end - - # source://erb//lib/erb/compiler.rb#291 - def push(cmd); end - - # Returns the value of attribute script. - # - # source://erb//lib/erb/compiler.rb#289 - def script; end -end - -# source://erb//lib/erb/compiler.rb#254 -class ERB::Compiler::ExplicitScanner < ::ERB::Compiler::Scanner - # source://erb//lib/erb/compiler.rb#255 - def scan; end -end - -# source://erb//lib/erb/compiler.rb#74 -class ERB::Compiler::PercentLine - # @return [PercentLine] a new instance of PercentLine - # - # source://erb//lib/erb/compiler.rb#75 - def initialize(str); end - - # Returns the value of attribute value. - # - # source://erb//lib/erb/compiler.rb#79 - def to_s; end - - # Returns the value of attribute value. - # - # source://erb//lib/erb/compiler.rb#78 - def value; end -end - -# source://erb//lib/erb/compiler.rb#82 -class ERB::Compiler::Scanner - # @return [Scanner] a new instance of Scanner - # - # source://erb//lib/erb/compiler.rb#108 - def initialize(src, trim_mode, percent); end - - # Returns the value of attribute etags. - # - # source://erb//lib/erb/compiler.rb#115 - def etags; end - - # source://erb//lib/erb/compiler.rb#117 - def scan; end - - # Returns the value of attribute stag. - # - # source://erb//lib/erb/compiler.rb#114 - def stag; end - - # Sets the attribute stag - # - # @param value the value to set the attribute stag to. - # - # source://erb//lib/erb/compiler.rb#114 - def stag=(_arg0); end - - # Returns the value of attribute stags. - # - # source://erb//lib/erb/compiler.rb#115 - def stags; end - - class << self - # source://erb//lib/erb/compiler.rb#97 - def default_scanner=(klass); end - - # source://erb//lib/erb/compiler.rb#101 - def make_scanner(src, trim_mode, percent); end - - # source://erb//lib/erb/compiler.rb#94 - def regist_scanner(klass, trim_mode, percent); end - - # source://erb//lib/erb/compiler.rb#86 - def register_scanner(klass, trim_mode, percent); end - end -end - -# source://erb//lib/erb/compiler.rb#107 -ERB::Compiler::Scanner::DEFAULT_ETAGS = T.let(T.unsafe(nil), Array) - -# source://erb//lib/erb/compiler.rb#106 -ERB::Compiler::Scanner::DEFAULT_STAGS = T.let(T.unsafe(nil), Array) - -# source://erb//lib/erb/compiler.rb#240 -class ERB::Compiler::SimpleScanner < ::ERB::Compiler::Scanner - # source://erb//lib/erb/compiler.rb#241 - def scan; end -end - -# source://erb//lib/erb/compiler.rb#120 -class ERB::Compiler::TrimScanner < ::ERB::Compiler::Scanner - # @return [TrimScanner] a new instance of TrimScanner - # - # source://erb//lib/erb/compiler.rb#121 - def initialize(src, trim_mode, percent); end - - # source://erb//lib/erb/compiler.rb#210 - def explicit_trim_line(line); end - - # @return [Boolean] - # - # source://erb//lib/erb/compiler.rb#229 - def is_erb_stag?(s); end - - # source://erb//lib/erb/compiler.rb#152 - def percent_line(line, &block); end - - # source://erb//lib/erb/compiler.rb#140 - def scan(&block); end - - # source://erb//lib/erb/compiler.rb#165 - def scan_line(line); end - - # source://erb//lib/erb/compiler.rb#174 - def trim_line1(line); end - - # source://erb//lib/erb/compiler.rb#188 - def trim_line2(line); end -end - -# :stopdoc: -# -# source://erb//lib/erb/compiler.rb#476 -ERB::Compiler::WARNING_UPLEVEL = T.let(T.unsafe(nil), Integer) - -# ERB::DefMethod -# -# Utility module to define eRuby script as instance method. -# -# === Example -# -# example.rhtml: -# <% for item in @items %> -# <%= item %> -# <% end %> -# -# example.rb: -# require 'erb' -# class MyClass -# extend ERB::DefMethod -# def_erb_method('render()', 'example.rhtml') -# def initialize(items) -# @items = items -# end -# end -# print MyClass.new([10,20,30]).render() -# -# result: -# -# 10 -# -# 20 -# -# 30 -# -# source://erb//lib/erb/def_method.rb#33 -module ERB::DefMethod - private - - # define _methodname_ as instance method of current module, using ERB - # object or eRuby file - # - # source://erb//lib/erb/def_method.rb#36 - def def_erb_method(methodname, erb_or_fname); end - - class << self - # define _methodname_ as instance method of current module, using ERB - # object or eRuby file - # - # source://erb//lib/erb/def_method.rb#46 - def def_erb_method(methodname, erb_or_fname); end - end -end - -module ERB::Escape; end - -# source://erb//lib/erb.rb#355 -ERB::NOT_GIVEN = T.let(T.unsafe(nil), Object) - -# ERB::Util -# -# A utility module for conversion routines, often handy in HTML generation. -# -# source://erb//lib/erb/util.rb#32 -module ERB::Util - include ::ERB::Escape - - private - - # source://erb//lib/erb/util.rb#47 - def h(_arg0); end - - # cgi.gem <= v0.3.2 - # - # source://erb//lib/erb/util.rb#73 - def u(s); end - - # cgi.gem <= v0.3.2 - # - # source://erb//lib/erb/util.rb#63 - def url_encode(s); end - - class << self - # source://erb//lib/erb/util.rb#48 - def h(_arg0); end - - # source://erb//lib/erb/util.rb#46 - def html_escape(_arg0); end - - # cgi.gem <= v0.3.2 - # - # source://erb//lib/erb/util.rb#74 - def u(s); end - - # cgi.gem <= v0.3.2 - # - # source://erb//lib/erb/util.rb#75 - def url_encode(s); end - end -end - -# source://erb//lib/erb/version.rb#3 -ERB::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/erb@6.0.1.rbi b/sorbet/rbi/gems/erb@6.0.1.rbi new file mode 100644 index 0000000000..cfe5487e40 --- /dev/null +++ b/sorbet/rbi/gems/erb@6.0.1.rbi @@ -0,0 +1,816 @@ +# typed: false + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `erb` gem. +# Please instead update this file by running `bin/tapioca gem erb`. + + +# source://erb//lib/erb/version.rb#2 +class ERB + # :markup: markdown + # + # :call-seq: + # ERB.new(template, trim_mode: nil, eoutvar: '_erbout') + # + # Returns a new \ERB object containing the given string +template+. + # + # For details about `template`, its embedded tags, and generated results, see ERB. + # + # **Keyword Argument `trim_mode`** + # + # You can use keyword argument `trim_mode: '%'` + # to enable the [shorthand format][shorthand format] for execution tags. + # + # This value allows [blank line control][blank line control]: + # + # - `'-'`: Omit each blank line ending with `'%>'`. + # + # Other values allow [newline control][newline control]: + # + # - `'>'`: Omit newline for each line ending with `'%>'`. + # - `'<>'`: Omit newline for each line starting with `'<%'` and ending with `'%>'`. + # + # You can also [combine trim modes][combine trim modes]. + # + # **Keyword Argument `eoutvar`** + # + # The string value of keyword argument `eoutvar` specifies the name of the variable + # that method #result uses to construct its result string; + # see #src. + # + # This is useful when you need to run multiple \ERB templates through the same binding + # and/or when you want to control where output ends up. + # + # It's good practice to choose a variable name that begins with an underscore: `'_'`. + # + # [blank line control]: rdoc-ref:ERB@Suppressing+Unwanted+Blank+Lines + # [combine trim modes]: rdoc-ref:ERB@Combining+Trim+Modes + # [newline control]: rdoc-ref:ERB@Suppressing+Unwanted+Newlines + # [shorthand format]: rdoc-ref:ERB@Shorthand+Format+for+Execution+Tags + # + # @return [ERB] a new instance of ERB + # + # source://erb//lib/erb.rb#832 + def initialize(str, trim_mode: T.unsafe(nil), eoutvar: T.unsafe(nil)); end + + # :markup: markdown + # + # :call-seq: + # def_class(super_class = Object, method_name = 'result') -> new_class + # + # Returns a new nameless class whose superclass is `super_class`, + # and which has instance method `method_name`. + # + # Create a template from HTML that has embedded expression tags that use `@arg1` and `@arg2`: + # + # ``` + # html = <