rbs 2.2.1 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Rakefile +4 -0
- data/lib/rbs/version.rb +1 -1
- data/stdlib/cgi/0/core.rbs +607 -38
- data/stdlib/json/0/json.rbs +1 -1
- data/stdlib/set/0/set.rbs +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d38dbf926f1fd55787f5d4a70ed5e31ce737e040b698e2aa3d5f68ab14a8b791
|
4
|
+
data.tar.gz: 0d86ba79682c662bc3ab2058a0e4464be43d8a317e58194c0e7dfd1f8aaec735
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25801791a12dfe85b729fc0e72eb9ebdb0e801c3c1fe3a1f8d9ec2ded0476e8b2a35a7ac520f034a1d8fe2e954bf4bc6d59caaaf9136286cd5844e8f3d8ae7da
|
7
|
+
data.tar.gz: b5ad3e185184b6ffcb786379abd5909284bab2a680ece911db40fccc7b8d258a52d588114ee99178c00b1d5bcf2030698c7e9db94b7b00b3d2ea88d269dd9de7
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 2.2.2 (2022-02-22)
|
6
|
+
|
7
|
+
### Signature updates
|
8
|
+
|
9
|
+
* `cgi` ([\#761](https://github.com/ruby/rbs/pull/761))
|
10
|
+
* `json` ([\#761](https://github.com/ruby/rbs/pull/761))
|
11
|
+
* `set` ([\#761](https://github.com/ruby/rbs/pull/761))
|
12
|
+
|
5
13
|
## 2.2.1 (2022-02-22)
|
6
14
|
|
7
15
|
### Library changes
|
data/Rakefile
CHANGED
data/lib/rbs/version.rb
CHANGED
data/stdlib/cgi/0/core.rbs
CHANGED
@@ -269,6 +269,10 @@
|
|
269
269
|
# h('Usage: foo "bar" <baz>') # alias
|
270
270
|
#
|
271
271
|
class CGI
|
272
|
+
include CGI::Util
|
273
|
+
|
274
|
+
extend CGI::Util
|
275
|
+
|
272
276
|
# <!--
|
273
277
|
# rdoc-file=lib/cgi/core.rb
|
274
278
|
# - CGI.new(tag_maker) { block }
|
@@ -350,11 +354,6 @@ class CGI
|
|
350
354
|
def initialize: (?String tag_maker) ?{ (String name, String value) -> void } -> void
|
351
355
|
| (Hash[Symbol, untyped] options_hash) ?{ (String name, String value) -> void } -> void
|
352
356
|
|
353
|
-
# <!-- rdoc-file=lib/cgi/core.rb -->
|
354
|
-
# Return the accept character set for this CGI instance.
|
355
|
-
#
|
356
|
-
attr_reader accept_charset: String
|
357
|
-
|
358
357
|
# <!--
|
359
358
|
# rdoc-file=lib/cgi/core.rb
|
360
359
|
# - accept_charset()
|
@@ -381,10 +380,15 @@ class CGI
|
|
381
380
|
# # {"name1" => ["value1", "value2", ...],
|
382
381
|
# # "name2" => ["value1", "value2", ...], ... }
|
383
382
|
#
|
384
|
-
def self.parse: (String query) -> Hash[String,
|
383
|
+
def self.parse: (String query) -> Hash[String, Array[String]]
|
385
384
|
|
386
385
|
public
|
387
386
|
|
387
|
+
# <!-- rdoc-file=lib/cgi/core.rb -->
|
388
|
+
# Return the accept character set for this CGI instance.
|
389
|
+
#
|
390
|
+
attr_reader accept_charset: String
|
391
|
+
|
388
392
|
# <!-- rdoc-file=lib/cgi/core.rb -->
|
389
393
|
# This method is an alias for #http_header, when HTML5 tag maker is inactive.
|
390
394
|
#
|
@@ -513,7 +517,7 @@ class CGI
|
|
513
517
|
def http_header: (?String options) -> String
|
514
518
|
| (?Hash[String | Symbol, untyped] header_hash) -> String
|
515
519
|
|
516
|
-
def nph?: () ->
|
520
|
+
def nph?: () -> untyped
|
517
521
|
|
518
522
|
# <!--
|
519
523
|
# rdoc-file=lib/cgi/core.rb
|
@@ -612,43 +616,608 @@ class CGI
|
|
612
616
|
# Synonym for $stdout.
|
613
617
|
#
|
614
618
|
def stdoutput: () -> ::IO
|
615
|
-
end
|
616
619
|
|
617
|
-
# <!-- rdoc-file=lib/cgi/core.rb -->
|
618
|
-
# String for carriage return
|
619
|
-
#
|
620
|
-
|
620
|
+
# <!-- rdoc-file=lib/cgi/core.rb -->
|
621
|
+
# String for carriage return
|
622
|
+
#
|
623
|
+
CR: String
|
621
624
|
|
622
|
-
# <!-- rdoc-file=lib/cgi/core.rb -->
|
623
|
-
# Standard internet newline sequence
|
624
|
-
#
|
625
|
-
|
625
|
+
# <!-- rdoc-file=lib/cgi/core.rb -->
|
626
|
+
# Standard internet newline sequence
|
627
|
+
#
|
628
|
+
EOL: String
|
626
629
|
|
627
|
-
# <!-- rdoc-file=lib/cgi/core.rb -->
|
628
|
-
# HTTP status codes.
|
629
|
-
#
|
630
|
-
|
630
|
+
# <!-- rdoc-file=lib/cgi/core.rb -->
|
631
|
+
# HTTP status codes.
|
632
|
+
#
|
633
|
+
HTTP_STATUS: Hash[String, String]
|
631
634
|
|
632
|
-
# <!-- rdoc-file=lib/cgi/core.rb -->
|
633
|
-
# String for linefeed
|
634
|
-
#
|
635
|
-
|
635
|
+
# <!-- rdoc-file=lib/cgi/core.rb -->
|
636
|
+
# String for linefeed
|
637
|
+
#
|
638
|
+
LF: String
|
636
639
|
|
637
|
-
# <!-- rdoc-file=lib/cgi/core.rb -->
|
638
|
-
# Maximum number of request parameters when multipart
|
639
|
-
#
|
640
|
-
|
640
|
+
# <!-- rdoc-file=lib/cgi/core.rb -->
|
641
|
+
# Maximum number of request parameters when multipart
|
642
|
+
#
|
643
|
+
MAX_MULTIPART_COUNT: Integer
|
641
644
|
|
642
|
-
# <!-- rdoc-file=lib/cgi/core.rb -->
|
643
|
-
# Whether processing will be required in binary vs text
|
644
|
-
#
|
645
|
-
|
645
|
+
# <!-- rdoc-file=lib/cgi/core.rb -->
|
646
|
+
# Whether processing will be required in binary vs text
|
647
|
+
#
|
648
|
+
NEEDS_BINMODE: bool
|
646
649
|
|
647
|
-
# <!-- rdoc-file=lib/cgi/core.rb -->
|
648
|
-
# Path separators in different environments.
|
649
|
-
#
|
650
|
-
|
650
|
+
# <!-- rdoc-file=lib/cgi/core.rb -->
|
651
|
+
# Path separators in different environments.
|
652
|
+
#
|
653
|
+
PATH_SEPARATOR: Hash[String, String]
|
654
|
+
|
655
|
+
REVISION: String
|
656
|
+
|
657
|
+
VERSION: String
|
658
|
+
|
659
|
+
# <!-- rdoc-file=lib/cgi/cookie.rb -->
|
660
|
+
# Class representing an HTTP cookie.
|
661
|
+
#
|
662
|
+
# In addition to its specific fields and methods, a Cookie instance is a
|
663
|
+
# delegator to the array of its values.
|
664
|
+
#
|
665
|
+
# See RFC 2965.
|
666
|
+
#
|
667
|
+
# ## Examples of use
|
668
|
+
# cookie1 = CGI::Cookie.new("name", "value1", "value2", ...)
|
669
|
+
# cookie1 = CGI::Cookie.new("name" => "name", "value" => "value")
|
670
|
+
# cookie1 = CGI::Cookie.new('name' => 'name',
|
671
|
+
# 'value' => ['value1', 'value2', ...],
|
672
|
+
# 'path' => 'path', # optional
|
673
|
+
# 'domain' => 'domain', # optional
|
674
|
+
# 'expires' => Time.now, # optional
|
675
|
+
# 'secure' => true, # optional
|
676
|
+
# 'httponly' => true # optional
|
677
|
+
# )
|
678
|
+
#
|
679
|
+
# cgi.out("cookie" => [cookie1, cookie2]) { "string" }
|
680
|
+
#
|
681
|
+
# name = cookie1.name
|
682
|
+
# values = cookie1.value
|
683
|
+
# path = cookie1.path
|
684
|
+
# domain = cookie1.domain
|
685
|
+
# expires = cookie1.expires
|
686
|
+
# secure = cookie1.secure
|
687
|
+
# httponly = cookie1.httponly
|
688
|
+
#
|
689
|
+
# cookie1.name = 'name'
|
690
|
+
# cookie1.value = ['value1', 'value2', ...]
|
691
|
+
# cookie1.path = 'path'
|
692
|
+
# cookie1.domain = 'domain'
|
693
|
+
# cookie1.expires = Time.now + 30
|
694
|
+
# cookie1.secure = true
|
695
|
+
# cookie1.httponly = true
|
696
|
+
#
|
697
|
+
class Cookie < Array[String]
|
698
|
+
# <!--
|
699
|
+
# rdoc-file=lib/cgi/cookie.rb
|
700
|
+
# - parse(raw_cookie)
|
701
|
+
# -->
|
702
|
+
# Parse a raw cookie string into a hash of cookie-name=>Cookie pairs.
|
703
|
+
#
|
704
|
+
# cookies = CGI::Cookie.parse("raw_cookie_string")
|
705
|
+
# # { "name1" => cookie1, "name2" => cookie2, ... }
|
706
|
+
#
|
707
|
+
def self.parse: (String raw_cookie) -> Hash[String, instance]
|
708
|
+
|
709
|
+
public
|
710
|
+
|
711
|
+
# <!-- rdoc-file=lib/cgi/cookie.rb -->
|
712
|
+
# Domain for which this cookie applies, as a `String`
|
713
|
+
#
|
714
|
+
def domain: () -> String?
|
715
|
+
|
716
|
+
# <!-- rdoc-file=lib/cgi/cookie.rb -->
|
717
|
+
# Domain for which this cookie applies, as a `String`
|
718
|
+
#
|
719
|
+
def domain=: (String domain) -> String
|
720
|
+
|
721
|
+
# <!-- rdoc-file=lib/cgi/cookie.rb -->
|
722
|
+
# Time at which this cookie expires, as a `Time`
|
723
|
+
#
|
724
|
+
def expires: () -> Time?
|
725
|
+
|
726
|
+
# <!-- rdoc-file=lib/cgi/cookie.rb -->
|
727
|
+
# Time at which this cookie expires, as a `Time`
|
728
|
+
#
|
729
|
+
def expires=: (Time time) -> Time
|
730
|
+
|
731
|
+
# <!-- rdoc-file=lib/cgi/cookie.rb -->
|
732
|
+
# True if this cookie is httponly; false otherwise
|
733
|
+
#
|
734
|
+
def httponly: () -> bool
|
735
|
+
|
736
|
+
# <!--
|
737
|
+
# rdoc-file=lib/cgi/cookie.rb
|
738
|
+
# - httponly=(val)
|
739
|
+
# -->
|
740
|
+
# Set whether the Cookie is a httponly cookie or not.
|
741
|
+
#
|
742
|
+
# `val` must be a boolean.
|
743
|
+
#
|
744
|
+
def httponly=: (boolish val) -> bool
|
745
|
+
|
746
|
+
# <!--
|
747
|
+
# rdoc-file=lib/cgi/cookie.rb
|
748
|
+
# - inspect()
|
749
|
+
# -->
|
750
|
+
# A summary of cookie string.
|
751
|
+
#
|
752
|
+
def inspect: () -> String
|
753
|
+
|
754
|
+
# <!-- rdoc-file=lib/cgi/cookie.rb -->
|
755
|
+
# Name of this cookie, as a `String`
|
756
|
+
#
|
757
|
+
def name: () -> String
|
758
|
+
|
759
|
+
# <!-- rdoc-file=lib/cgi/cookie.rb -->
|
760
|
+
# Name of this cookie, as a `String`
|
761
|
+
#
|
762
|
+
def name=: (String name) -> String
|
763
|
+
|
764
|
+
# <!-- rdoc-file=lib/cgi/cookie.rb -->
|
765
|
+
# Path for which this cookie applies, as a `String`
|
766
|
+
#
|
767
|
+
def path: () -> String?
|
768
|
+
|
769
|
+
# <!-- rdoc-file=lib/cgi/cookie.rb -->
|
770
|
+
# Path for which this cookie applies, as a `String`
|
771
|
+
#
|
772
|
+
def path=: (String path) -> String
|
773
|
+
|
774
|
+
# <!-- rdoc-file=lib/cgi/cookie.rb -->
|
775
|
+
# True if this cookie is secure; false otherwise
|
776
|
+
#
|
777
|
+
def secure: () -> bool
|
778
|
+
|
779
|
+
# <!--
|
780
|
+
# rdoc-file=lib/cgi/cookie.rb
|
781
|
+
# - secure=(val)
|
782
|
+
# -->
|
783
|
+
# Set whether the Cookie is a secure cookie or not.
|
784
|
+
#
|
785
|
+
# `val` must be a boolean.
|
786
|
+
#
|
787
|
+
def secure=: [A] (boolish val) -> A
|
788
|
+
|
789
|
+
# <!--
|
790
|
+
# rdoc-file=lib/cgi/cookie.rb
|
791
|
+
# - to_s()
|
792
|
+
# -->
|
793
|
+
# Convert the Cookie to its string representation.
|
794
|
+
#
|
795
|
+
def to_s: () -> String
|
796
|
+
|
797
|
+
# <!--
|
798
|
+
# rdoc-file=lib/cgi/cookie.rb
|
799
|
+
# - value()
|
800
|
+
# -->
|
801
|
+
# Returns the value or list of values for this cookie.
|
802
|
+
#
|
803
|
+
def value: () -> Array[String]
|
804
|
+
|
805
|
+
# <!--
|
806
|
+
# rdoc-file=lib/cgi/cookie.rb
|
807
|
+
# - value=(val)
|
808
|
+
# -->
|
809
|
+
# Replaces the value of this cookie with a new value or list of values.
|
810
|
+
#
|
811
|
+
def value=: (String val) -> String
|
812
|
+
| (Array[String] val) -> Array[String]
|
813
|
+
|
814
|
+
private
|
815
|
+
|
816
|
+
# <!--
|
817
|
+
# rdoc-file=lib/cgi/cookie.rb
|
818
|
+
# - Cookie.new(name_string,*value)
|
819
|
+
# - Cookie.new(options_hash)
|
820
|
+
# -->
|
821
|
+
# Create a new CGI::Cookie object.
|
822
|
+
#
|
823
|
+
# `name_string`
|
824
|
+
# : The name of the cookie; in this form, there is no #domain or #expiration.
|
825
|
+
# The #path is gleaned from the `SCRIPT_NAME` environment variable, and
|
826
|
+
# #secure is false.
|
827
|
+
# `*value`
|
828
|
+
# : value or list of values of the cookie
|
829
|
+
# `options_hash`
|
830
|
+
# : A Hash of options to initialize this Cookie. Possible options are:
|
831
|
+
#
|
832
|
+
# name
|
833
|
+
# : the name of the cookie. Required.
|
834
|
+
# value
|
835
|
+
# : the cookie's value or list of values.
|
836
|
+
# path
|
837
|
+
# : the path for which this cookie applies. Defaults to the value of the
|
838
|
+
# `SCRIPT_NAME` environment variable.
|
839
|
+
# domain
|
840
|
+
# : the domain for which this cookie applies.
|
841
|
+
# expires
|
842
|
+
# : the time at which this cookie expires, as a `Time` object.
|
843
|
+
# secure
|
844
|
+
# : whether this cookie is a secure cookie or not (default to false).
|
845
|
+
# Secure cookies are only transmitted to HTTPS servers.
|
846
|
+
# httponly
|
847
|
+
# : whether this cookie is a HttpOnly cookie or not (default to
|
848
|
+
#
|
849
|
+
# false). HttpOnly cookies are not available to javascript.
|
850
|
+
#
|
851
|
+
# These keywords correspond to attributes of the cookie object.
|
852
|
+
#
|
853
|
+
def initialize: (String name_string, *String value) -> void
|
854
|
+
| (Hash[String, untyped] options_hash) -> void
|
855
|
+
end
|
856
|
+
|
857
|
+
module Escape
|
858
|
+
public
|
859
|
+
|
860
|
+
# <!--
|
861
|
+
# rdoc-file=ext/cgi/escape/escape.c
|
862
|
+
# - CGI.escape(string) -> string
|
863
|
+
# -->
|
864
|
+
# Returns URL-escaped string.
|
865
|
+
#
|
866
|
+
def escape: (string str) -> String
|
867
|
+
|
868
|
+
# <!--
|
869
|
+
# rdoc-file=ext/cgi/escape/escape.c
|
870
|
+
# - CGI.escapeHTML(string) -> string
|
871
|
+
# -->
|
872
|
+
# Returns HTML-escaped string.
|
873
|
+
#
|
874
|
+
def escapeHTML: (string str) -> String
|
875
|
+
|
876
|
+
# <!--
|
877
|
+
# rdoc-file=ext/cgi/escape/escape.c
|
878
|
+
# - CGI.unescape(string, encoding=@@accept_charset) -> string
|
879
|
+
# -->
|
880
|
+
# Returns URL-unescaped string.
|
881
|
+
#
|
882
|
+
def unescape: (string str, ?encoding encoding) -> String
|
883
|
+
|
884
|
+
# <!--
|
885
|
+
# rdoc-file=ext/cgi/escape/escape.c
|
886
|
+
# - CGI.unescapeHTML(string) -> string
|
887
|
+
# -->
|
888
|
+
# Returns HTML-unescaped string.
|
889
|
+
#
|
890
|
+
def unescapeHTML: (string str) -> String
|
891
|
+
end
|
892
|
+
|
893
|
+
# <!-- rdoc-file=lib/cgi/core.rb -->
|
894
|
+
# Exception raised when there is an invalid encoding detected
|
895
|
+
#
|
896
|
+
class InvalidEncoding < Exception
|
897
|
+
end
|
898
|
+
|
899
|
+
# <!-- rdoc-file=lib/cgi/core.rb -->
|
900
|
+
# Mixin module that provides the following:
|
901
|
+
#
|
902
|
+
# 1. Access to the CGI environment variables as methods. See documentation to
|
903
|
+
# the CGI class for a list of these variables. The methods are exposed by
|
904
|
+
# removing the leading `HTTP_` (if it exists) and downcasing the name. For
|
905
|
+
# example, `auth_type` will return the environment variable `AUTH_TYPE`, and
|
906
|
+
# `accept` will return the value for `HTTP_ACCEPT`.
|
907
|
+
#
|
908
|
+
# 2. Access to cookies, including the cookies attribute.
|
909
|
+
#
|
910
|
+
# 3. Access to parameters, including the params attribute, and overloading #[]
|
911
|
+
# to perform parameter value lookup by key.
|
912
|
+
#
|
913
|
+
# 4. The initialize_query method, for initializing the above mechanisms,
|
914
|
+
# handling multipart forms, and allowing the class to be used in "offline"
|
915
|
+
# mode.
|
916
|
+
#
|
917
|
+
module QueryExtension
|
918
|
+
public
|
919
|
+
|
920
|
+
# <!--
|
921
|
+
# rdoc-file=lib/cgi/core.rb
|
922
|
+
# - [](key)
|
923
|
+
# -->
|
924
|
+
# Get the value for the parameter with a given key.
|
925
|
+
#
|
926
|
+
# If the parameter has multiple values, only the first will be retrieved; use
|
927
|
+
# #params to get the array of values.
|
928
|
+
#
|
929
|
+
def []: (String key) -> String?
|
930
|
+
|
931
|
+
def accept: () -> String?
|
932
|
+
|
933
|
+
def accept_charset: () -> String?
|
934
|
+
|
935
|
+
def accept_encoding: () -> String?
|
936
|
+
|
937
|
+
def accept_language: () -> String?
|
938
|
+
|
939
|
+
def auth_type: () -> String?
|
940
|
+
|
941
|
+
def cache_control: () -> String?
|
942
|
+
|
943
|
+
def content_length: () -> String?
|
944
|
+
|
945
|
+
def content_type: () -> String?
|
946
|
+
|
947
|
+
# <!-- rdoc-file=lib/cgi/core.rb -->
|
948
|
+
# Get the cookies as a hash of cookie-name=>Cookie pairs.
|
949
|
+
#
|
950
|
+
def cookies: () -> Hash[String, Cookie]
|
951
|
+
|
952
|
+
# <!-- rdoc-file=lib/cgi/core.rb -->
|
953
|
+
# Get the cookies as a hash of cookie-name=>Cookie pairs.
|
954
|
+
#
|
955
|
+
def cookies=: (Hash[String, Cookie] cookies) -> Hash[String, Cookie]
|
956
|
+
|
957
|
+
def create_body: (boolish is_large) -> (Tempfile | StringIO)
|
958
|
+
|
959
|
+
# <!-- rdoc-file=lib/cgi/core.rb -->
|
960
|
+
# Get the uploaded files as a hash of name=>values pairs
|
961
|
+
#
|
962
|
+
def files: () -> Hash[String, Tempfile | StringIO]
|
963
|
+
|
964
|
+
def from: () -> String?
|
965
|
+
|
966
|
+
def gateway_interface: () -> String?
|
967
|
+
|
968
|
+
# <!--
|
969
|
+
# rdoc-file=lib/cgi/core.rb
|
970
|
+
# - has_key?(*args)
|
971
|
+
# -->
|
972
|
+
# Returns true if a given query string parameter exists.
|
973
|
+
#
|
974
|
+
def has_key?: (String key) -> bool
|
975
|
+
|
976
|
+
def host: () -> String?
|
977
|
+
|
978
|
+
# <!--
|
979
|
+
# rdoc-file=lib/cgi/core.rb
|
980
|
+
# - include?(*args)
|
981
|
+
# -->
|
982
|
+
#
|
983
|
+
alias include? has_key?
|
984
|
+
|
985
|
+
# <!--
|
986
|
+
# rdoc-file=lib/cgi/core.rb
|
987
|
+
# - key?(*args)
|
988
|
+
# -->
|
989
|
+
#
|
990
|
+
alias key? has_key?
|
991
|
+
|
992
|
+
# <!--
|
993
|
+
# rdoc-file=lib/cgi/core.rb
|
994
|
+
# - keys(*args)
|
995
|
+
# -->
|
996
|
+
# Return all query parameter names as an array of String.
|
997
|
+
#
|
998
|
+
def keys: () -> Array[String]
|
999
|
+
|
1000
|
+
# <!--
|
1001
|
+
# rdoc-file=lib/cgi/core.rb
|
1002
|
+
# - multipart?()
|
1003
|
+
# -->
|
1004
|
+
# Returns whether the form contained multipart/form-data
|
1005
|
+
#
|
1006
|
+
def multipart?: () -> bool
|
1007
|
+
|
1008
|
+
def negotiate: () -> String?
|
1009
|
+
|
1010
|
+
# <!-- rdoc-file=lib/cgi/core.rb -->
|
1011
|
+
# Get the parameters as a hash of name=>values pairs, where values is an Array.
|
1012
|
+
#
|
1013
|
+
def params: () -> Hash[String, Array[String] | Tempfile | StringIO]
|
1014
|
+
|
1015
|
+
# <!--
|
1016
|
+
# rdoc-file=lib/cgi/core.rb
|
1017
|
+
# - params=(hash)
|
1018
|
+
# -->
|
1019
|
+
# Set all the parameters.
|
1020
|
+
#
|
1021
|
+
def params=: (Hash[String, Array[String] | Tempfile | StringIO] hash) -> Hash[String, Array[String] | Tempfile | StringIO]
|
1022
|
+
|
1023
|
+
def path_info: () -> String?
|
1024
|
+
|
1025
|
+
def path_translated: () -> String?
|
651
1026
|
|
652
|
-
|
1027
|
+
def pragma: () -> String?
|
653
1028
|
|
654
|
-
|
1029
|
+
def query_string: () -> String?
|
1030
|
+
|
1031
|
+
# <!--
|
1032
|
+
# rdoc-file=lib/cgi/core.rb
|
1033
|
+
# - raw_cookie()
|
1034
|
+
# -->
|
1035
|
+
# Get the raw cookies as a string.
|
1036
|
+
#
|
1037
|
+
def raw_cookie: () -> String?
|
1038
|
+
|
1039
|
+
# <!--
|
1040
|
+
# rdoc-file=lib/cgi/core.rb
|
1041
|
+
# - raw_cookie2()
|
1042
|
+
# -->
|
1043
|
+
# Get the raw RFC2965 cookies as a string.
|
1044
|
+
#
|
1045
|
+
def raw_cookie2: () -> String?
|
1046
|
+
|
1047
|
+
def referer: () -> String?
|
1048
|
+
|
1049
|
+
def remote_addr: () -> String?
|
1050
|
+
|
1051
|
+
def remote_host: () -> String?
|
1052
|
+
|
1053
|
+
def remote_ident: () -> String?
|
1054
|
+
|
1055
|
+
def remote_user: () -> String?
|
1056
|
+
|
1057
|
+
def request_method: () -> String?
|
1058
|
+
|
1059
|
+
def script_name: () -> String?
|
1060
|
+
|
1061
|
+
def server_name: () -> String?
|
1062
|
+
|
1063
|
+
def server_port: () -> String?
|
1064
|
+
|
1065
|
+
def server_protocol: () -> String?
|
1066
|
+
|
1067
|
+
def server_software: () -> String?
|
1068
|
+
|
1069
|
+
def unescape_filename?: () -> bool
|
1070
|
+
|
1071
|
+
def user_agent: () -> String?
|
1072
|
+
|
1073
|
+
private
|
1074
|
+
|
1075
|
+
# <!--
|
1076
|
+
# rdoc-file=lib/cgi/core.rb
|
1077
|
+
# - initialize_query()
|
1078
|
+
# -->
|
1079
|
+
# A wrapper class to use a StringIO object as the body and switch to a TempFile
|
1080
|
+
# when the passed threshold is passed. Initialize the data from the query.
|
1081
|
+
#
|
1082
|
+
# Handles multipart forms (in particular, forms that involve file uploads).
|
1083
|
+
# Reads query parameters in the @params field, and cookies into @cookies.
|
1084
|
+
#
|
1085
|
+
def initialize_query: () -> void
|
1086
|
+
|
1087
|
+
# <!--
|
1088
|
+
# rdoc-file=lib/cgi/core.rb
|
1089
|
+
# - read_from_cmdline()
|
1090
|
+
# -->
|
1091
|
+
# offline mode. read name=value pairs on standard input.
|
1092
|
+
#
|
1093
|
+
def read_from_cmdline: () -> String
|
1094
|
+
|
1095
|
+
# <!--
|
1096
|
+
# rdoc-file=lib/cgi/core.rb
|
1097
|
+
# - read_multipart(boundary, content_length)
|
1098
|
+
# -->
|
1099
|
+
# Parses multipart form elements according to
|
1100
|
+
# http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2
|
1101
|
+
#
|
1102
|
+
# Returns a hash of multipart form parameters with bodies of type StringIO or
|
1103
|
+
# Tempfile depending on whether the multipart form element exceeds 10 KB
|
1104
|
+
#
|
1105
|
+
# params[name => body]
|
1106
|
+
#
|
1107
|
+
def read_multipart: (String boundary, Integer content_length) -> (Tempfile | StringIO)
|
1108
|
+
end
|
1109
|
+
|
1110
|
+
module Util
|
1111
|
+
include CGI::Escape
|
1112
|
+
|
1113
|
+
public
|
1114
|
+
|
1115
|
+
# <!--
|
1116
|
+
# rdoc-file=lib/cgi/util.rb
|
1117
|
+
# - escapeElement(string, *elements)
|
1118
|
+
# -->
|
1119
|
+
# Escape only the tags of certain HTML elements in `string`.
|
1120
|
+
#
|
1121
|
+
# Takes an element or elements or array of elements. Each element is specified
|
1122
|
+
# by the name of the element, without angle brackets. This matches both the
|
1123
|
+
# start and the end tag of that element. The attribute list of the open tag will
|
1124
|
+
# also be escaped (for instance, the double-quotes surrounding attribute
|
1125
|
+
# values).
|
1126
|
+
#
|
1127
|
+
# print CGI.escapeElement('<BR><A HREF="url"></A>', "A", "IMG")
|
1128
|
+
# # "<BR><A HREF="url"></A>"
|
1129
|
+
#
|
1130
|
+
# print CGI.escapeElement('<BR><A HREF="url"></A>', ["A", "IMG"])
|
1131
|
+
# # "<BR><A HREF="url"></A>"
|
1132
|
+
#
|
1133
|
+
def escapeElement: (string string, *String | Array[String] elements) -> String
|
1134
|
+
|
1135
|
+
# <!-- rdoc-file=lib/cgi/util.rb -->
|
1136
|
+
# Synonym for CGI.escapeElement(str)
|
1137
|
+
#
|
1138
|
+
alias escape_element escapeElement
|
1139
|
+
|
1140
|
+
# <!-- rdoc-file=lib/cgi/util.rb -->
|
1141
|
+
# Synonym for CGI.escapeHTML(str)
|
1142
|
+
#
|
1143
|
+
alias escape_html escapeHTML
|
1144
|
+
|
1145
|
+
# <!--
|
1146
|
+
# rdoc-file=lib/cgi/util.rb
|
1147
|
+
# - h(string)
|
1148
|
+
# -->
|
1149
|
+
#
|
1150
|
+
alias h escapeHTML
|
1151
|
+
|
1152
|
+
# <!--
|
1153
|
+
# rdoc-file=lib/cgi/util.rb
|
1154
|
+
# - pretty(string, shift = " ")
|
1155
|
+
# -->
|
1156
|
+
# Prettify (indent) an HTML string.
|
1157
|
+
#
|
1158
|
+
# `string` is the HTML string to indent. `shift` is the indentation unit to
|
1159
|
+
# use; it defaults to two spaces.
|
1160
|
+
#
|
1161
|
+
# print CGI.pretty("<HTML><BODY></BODY></HTML>")
|
1162
|
+
# # <HTML>
|
1163
|
+
# # <BODY>
|
1164
|
+
# # </BODY>
|
1165
|
+
# # </HTML>
|
1166
|
+
#
|
1167
|
+
# print CGI.pretty("<HTML><BODY></BODY></HTML>", "\t")
|
1168
|
+
# # <HTML>
|
1169
|
+
# # <BODY>
|
1170
|
+
# # </BODY>
|
1171
|
+
# # </HTML>
|
1172
|
+
#
|
1173
|
+
def pretty: (string string, ?String shift) -> String
|
1174
|
+
|
1175
|
+
# <!--
|
1176
|
+
# rdoc-file=lib/cgi/util.rb
|
1177
|
+
# - rfc1123_date(time)
|
1178
|
+
# -->
|
1179
|
+
# Format a `Time` object as a String using the format specified by RFC 1123.
|
1180
|
+
#
|
1181
|
+
# CGI.rfc1123_date(Time.now)
|
1182
|
+
# # Sat, 01 Jan 2000 00:00:00 GMT
|
1183
|
+
#
|
1184
|
+
def rfc1123_date: (Time time) -> String
|
1185
|
+
|
1186
|
+
# <!--
|
1187
|
+
# rdoc-file=lib/cgi/util.rb
|
1188
|
+
# - unescapeElement(string, *elements)
|
1189
|
+
# -->
|
1190
|
+
# Undo escaping such as that done by CGI.escapeElement()
|
1191
|
+
#
|
1192
|
+
# print CGI.unescapeElement(
|
1193
|
+
# CGI.escapeHTML('<BR><A HREF="url"></A>'), "A", "IMG")
|
1194
|
+
# # "<BR><A HREF="url"></A>"
|
1195
|
+
#
|
1196
|
+
# print CGI.unescapeElement(
|
1197
|
+
# CGI.escapeHTML('<BR><A HREF="url"></A>'), ["A", "IMG"])
|
1198
|
+
# # "<BR><A HREF="url"></A>"
|
1199
|
+
#
|
1200
|
+
def unescapeElement: (string string, *String | Array[String] elements) -> String
|
1201
|
+
|
1202
|
+
# <!-- rdoc-file=lib/cgi/util.rb -->
|
1203
|
+
# Synonym for CGI.unescapeElement(str)
|
1204
|
+
#
|
1205
|
+
alias unescape_element unescapeElement
|
1206
|
+
|
1207
|
+
# <!-- rdoc-file=lib/cgi/util.rb -->
|
1208
|
+
# Synonym for CGI.unescapeHTML(str)
|
1209
|
+
#
|
1210
|
+
alias unescape_html unescapeHTML
|
1211
|
+
|
1212
|
+
# Abbreviated day-of-week names specified by RFC 822
|
1213
|
+
RFC822_DAYS: Array[String]
|
1214
|
+
|
1215
|
+
# Abbreviated month names specified by RFC 822
|
1216
|
+
RFC822_MONTHS: Array[String]
|
1217
|
+
|
1218
|
+
# <!-- rdoc-file=lib/cgi/util.rb -->
|
1219
|
+
# The set of special characters and their escaped values
|
1220
|
+
#
|
1221
|
+
TABLE_FOR_ESCAPE_HTML__: Hash[String, String]
|
1222
|
+
end
|
1223
|
+
end
|
data/stdlib/json/0/json.rbs
CHANGED
data/stdlib/set/0/set.rbs
CHANGED
@@ -186,7 +186,9 @@
|
|
186
186
|
# Resets the internal state; useful if an object
|
187
187
|
# has been modified while an element in the set.
|
188
188
|
#
|
189
|
-
class Set[A]
|
189
|
+
class Set[unchecked out A]
|
190
|
+
include Enumerable[A]
|
191
|
+
|
190
192
|
# <!--
|
191
193
|
# rdoc-file=lib/set.rb
|
192
194
|
# - new(enum = nil) { |o| ... }
|
@@ -605,8 +607,6 @@ class Set[A]
|
|
605
607
|
# Set[1, 'c', :s].to_a #=> [1, "c", :s]
|
606
608
|
#
|
607
609
|
def to_a: () -> Array[A]
|
608
|
-
|
609
|
-
include Enumerable[A]
|
610
610
|
end
|
611
611
|
|
612
612
|
%a{annotate:rdoc:skip}
|