diff --git a/spec/compiler/codegen/macro_spec.cr b/spec/compiler/codegen/macro_spec.cr index 2c511e8eb3f8..0360d05fc83b 100644 --- a/spec/compiler/codegen/macro_spec.cr +++ b/spec/compiler/codegen/macro_spec.cr @@ -770,7 +770,7 @@ describe "Code gen: macro" do )).to_string.should eq("Green") end - it "says that enum has Flags attribute" do + it "says that enum has Flags annotation" do run(%( @[Flags] enum Color @@ -779,11 +779,11 @@ describe "Code gen: macro" do Blue end - {{Color.has_attribute?("Flags")}} + {{Color.annotation(Flags) ? true : false}} )).to_b.should be_true end - it "says that enum doesn't have Flags attribute" do + it "says that enum doesn't have Flags annotation" do run(%( enum Color Red @@ -791,7 +791,7 @@ describe "Code gen: macro" do Blue end - {{Color.has_attribute?("Flags")}} + {{Color.annotation(Flags) ? true : false}} )).to_b.should be_false end diff --git a/spec/compiler/crystal/tools/doc/doc_renderer_spec.cr b/spec/compiler/crystal/tools/doc/doc_renderer_spec.cr index 5ca6ad4be651..4938060e24b2 100644 --- a/spec/compiler/crystal/tools/doc/doc_renderer_spec.cr +++ b/spec/compiler/crystal/tools/doc/doc_renderer_spec.cr @@ -15,7 +15,7 @@ private def it_renders(context, input, output, file = __FILE__, line = __LINE__) generator.type(program) end Doc::Markdown.parse input, Doc::Markdown::DocRenderer.new(c, io) - end.should eq(output), file, line + end.should eq(output), file: file, line: line end end diff --git a/spec/std/compress/zlib/stress_spec.cr b/spec/std/compress/zlib/stress_spec.cr index 4edd527e2e7b..b2be8e229a13 100644 --- a/spec/std/compress/zlib/stress_spec.cr +++ b/spec/std/compress/zlib/stress_spec.cr @@ -5,7 +5,7 @@ module Compress::Zlib describe Zlib do it "write read should be inverse with random string" do expected = String.build do |io| - 1_000_000.times { rand(2000).to_i.to_s(32, io) } + 1_000_000.times { rand(2000).to_i.to_s(io, 32) } end io = IO::Memory.new diff --git a/spec/std/http/client/client_spec.cr b/spec/std/http/client/client_spec.cr index 4af7437bdc43..97084adf8a78 100644 --- a/spec/std/http/client/client_spec.cr +++ b/spec/std/http/client/client_spec.cr @@ -264,11 +264,11 @@ module HTTP client = TestClient.new "www.example.com" request = HTTP::Request.new("GET", "/") client.set_defaults(request) - request.host.should eq "www.example.com" + request.hostname.should eq "www.example.com" request = HTTP::Request.new("GET", "/", HTTP::Headers{"Host" => "other.example.com"}) client.set_defaults(request) - request.host.should eq "other.example.com" + request.hostname.should eq "other.example.com" end end @@ -288,7 +288,7 @@ module HTTP io_request.rewind request = HTTP::Request.from_io(io_request).as(HTTP::Request) - request.host.should eq("") + request.hostname.should eq("") end it "can specify host and port when initialized with IO" do diff --git a/spec/std/http/request_spec.cr b/spec/std/http/request_spec.cr index 7c45004bae46..78e6b72994f2 100644 --- a/spec/std/http/request_spec.cr +++ b/spec/std/http/request_spec.cr @@ -439,9 +439,9 @@ module HTTP request.query_params.to_s.should eq(new_query) end - it "gets request host from the headers" do + it "gets request hostname from the headers" do request = Request.from_io(IO::Memory.new("GET / HTTP/1.1\r\nHost: host.example.org:3000\r\nReferer:\r\n\r\n")).as(Request) - request.host.should eq("host.example.org") + request.hostname.should eq("host.example.org") end it "#hostname" do diff --git a/spec/std/http/server/handlers/log_handler_spec.cr b/spec/std/http/server/handlers/log_handler_spec.cr index c2a15c385626..3840d3a6eb71 100644 --- a/spec/std/http/server/handlers/log_handler_spec.cr +++ b/spec/std/http/server/handlers/log_handler_spec.cr @@ -39,22 +39,6 @@ describe HTTP::LogHandler do logs.check(:info, %r(^- - GET / HTTP/1.1 - 200 \(\d+(\.\d+)?[mµn]s\)$)) end - it "logs to io" do - request = HTTP::Request.new("GET", "/") - response = HTTP::Server::Response.new(IO::Memory.new) - context = HTTP::Server::Context.new(request, response) - - backend = Log::MemoryBackend.new - io = IO::Memory.new - handler = HTTP::LogHandler.new(io) - handler.next = ->(ctx : HTTP::Server::Context) {} - handler.call(context) - - retry do - io.to_s.should match(%r(- - GET / HTTP/1.1 - 200 \(\d+(\.\d+)?[mµn]s\)$)) - end - end - it "log failed request" do io = IO::Memory.new request = HTTP::Request.new("GET", "/") diff --git a/spec/std/int_spec.cr b/spec/std/int_spec.cr index 93b6db182998..2f765ac13461 100644 --- a/spec/std/int_spec.cr +++ b/spec/std/int_spec.cr @@ -9,8 +9,6 @@ end private def to_s_with_io(num, base, upcase = false) String.build { |io| num.to_s(io, base, upcase: upcase) } - # Test deprecated overload: - String.build { |io| num.to_s(base, io, upcase) } end describe "Int" do @@ -176,7 +174,6 @@ describe "Int" do it { 1234.to_s(36).should eq("ya") } it { -1234.to_s(36).should eq("-ya") } it { 1234.to_s(16, upcase: true).should eq("4D2") } - it { 1234.to_s(16, true).should eq("4D2") } # Deprecated test it { -1234.to_s(16, upcase: true).should eq("-4D2") } it { 1234.to_s(36, upcase: true).should eq("YA") } it { -1234.to_s(36, upcase: true).should eq("-YA") } diff --git a/spec/std/set_spec.cr b/spec/std/set_spec.cr index c83c704daba5..bd08fa150004 100644 --- a/spec/std/set_spec.cr +++ b/spec/std/set_spec.cr @@ -340,20 +340,6 @@ describe "Set" do iter.next.should be_a(Iterator::Stop) end - it "check subset" do - set = Set{1, 2, 3} - empty_set = Set(Int32).new - - set.subset?(Set{1, 2, 3, 4}).should be_true - set.subset?(Set{1, 2, 3, "4"}).should be_true - set.subset?(Set{1, 2, 3}).should be_true - set.subset?(Set{1, 2}).should be_false - set.subset?(empty_set).should be_false - - empty_set.subset?(Set{1}).should be_true - empty_set.subset?(empty_set).should be_true - end - it "#subset_of?" do set = Set{1, 2, 3} empty_set = Set(Int32).new @@ -368,20 +354,6 @@ describe "Set" do empty_set.subset_of?(empty_set).should be_true end - it "check proper_subset" do - set = Set{1, 2, 3} - empty_set = Set(Int32).new - - set.proper_subset?(Set{1, 2, 3, 4}).should be_true - set.proper_subset?(Set{1, 2, 3, "4"}).should be_true - set.proper_subset?(Set{1, 2, 3}).should be_false - set.proper_subset?(Set{1, 2}).should be_false - set.proper_subset?(empty_set).should be_false - - empty_set.proper_subset?(Set{1}).should be_true - empty_set.proper_subset?(empty_set).should be_false - end - it "#proper_subset_of?" do set = Set{1, 2, 3} empty_set = Set(Int32).new @@ -396,20 +368,6 @@ describe "Set" do empty_set.proper_subset_of?(empty_set).should be_false end - it "check superset" do - set = Set{1, 2, "3"} - empty_set = Set(Int32).new - - set.superset?(empty_set).should be_true - set.superset?(Set{1, 2}).should be_true - set.superset?(Set{1, 2, "3"}).should be_true - set.superset?(Set{1, 2, 3}).should be_false - set.superset?(Set{1, 2, 3, 4}).should be_false - set.superset?(Set{1, 4}).should be_false - - empty_set.superset?(empty_set).should be_true - end - it "#superset_of?" do set = Set{1, 2, "3"} empty_set = Set(Int32).new @@ -424,20 +382,6 @@ describe "Set" do empty_set.superset_of?(empty_set).should be_true end - it "check proper_superset" do - set = Set{1, 2, "3"} - empty_set = Set(Int32).new - - set.proper_superset?(empty_set).should be_true - set.proper_superset?(Set{1, 2}).should be_true - set.proper_superset?(Set{1, 2, "3"}).should be_false - set.proper_superset?(Set{1, 2, 3}).should be_false - set.proper_superset?(Set{1, 2, 3, 4}).should be_false - set.proper_superset?(Set{1, 4}).should be_false - - empty_set.proper_superset?(empty_set).should be_false - end - it "#proper_superset_of?" do set = Set{1, 2, "3"} empty_set = Set(Int32).new diff --git a/spec/std/string_spec.cr b/spec/std/string_spec.cr index 4ed341010a12..dedc005f2a36 100644 --- a/spec/std/string_spec.cr +++ b/spec/std/string_spec.cr @@ -2162,13 +2162,6 @@ describe "String" do it { String.build { |io| "12".ljust(io, 7, '-') }.should eq("12-----") } it { String.build { |io| "12".ljust(io, 7, 'あ') }.should eq("12あああああ") } end - - describe "to io (deprecated)" do - it { String.build { |io| "123".ljust(2, io) }.should eq("123") } - it { String.build { |io| "123".ljust(5, io) }.should eq("123 ") } - it { String.build { |io| "12".ljust(7, '-', io) }.should eq("12-----") } - it { String.build { |io| "12".ljust(7, 'あ', io) }.should eq("12あああああ") } - end end describe "rjust" do @@ -2183,13 +2176,6 @@ describe "String" do it { String.build { |io| "12".rjust(io, 7, '-') }.should eq("-----12") } it { String.build { |io| "12".rjust(io, 7, 'あ') }.should eq("あああああ12") } end - - describe "to io (deprecated)" do - it { String.build { |io| "123".rjust(2, io) }.should eq("123") } - it { String.build { |io| "123".rjust(5, io) }.should eq(" 123") } - it { String.build { |io| "12".rjust(7, '-', io) }.should eq("-----12") } - it { String.build { |io| "12".rjust(7, 'あ', io) }.should eq("あああああ12") } - end end describe "center" do @@ -2204,13 +2190,6 @@ describe "String" do it { String.build { |io| "12".center(io, 7, '-') }.should eq("--12---") } it { String.build { |io| "12".center(io, 7, 'あ') }.should eq("ああ12あああ") } end - - describe "to io (deprecated)" do - it { String.build { |io| "123".center(2, io) }.should eq("123") } - it { String.build { |io| "123".center(5, io) }.should eq(" 123 ") } - it { String.build { |io| "12".center(7, '-', io) }.should eq("--12---") } - it { String.build { |io| "12".center(7, 'あ', io) }.should eq("ああ12あああ") } - end end describe "succ" do diff --git a/spec/std/time/span_spec.cr b/spec/std/time/span_spec.cr index 8976872af00c..ca3eb40f35f8 100644 --- a/spec/std/time/span_spec.cr +++ b/spec/std/time/span_spec.cr @@ -173,9 +173,8 @@ describe Time::Span do 1_000_000.5.days.to_s.should eq("1000000.12:00:00") end - it "test negate and duration" do + it "test negate and abs" do (-Time::Span.new(nanoseconds: 1234500)).to_s.should eq("-00:00:00.001234500") - Time::Span.new(nanoseconds: -1234500).duration.to_s.should eq("00:00:00.001234500") Time::Span.new(nanoseconds: -1234500).abs.to_s.should eq("00:00:00.001234500") (-Time::Span.new(nanoseconds: 7700)).to_s.should eq("-00:00:00.000007700") (+Time::Span.new(nanoseconds: 7700)).to_s.should eq("00:00:00.000007700") diff --git a/spec/std/uri_spec.cr b/spec/std/uri_spec.cr index 071ba01b3929..a2c973548d7b 100644 --- a/spec/std/uri_spec.cr +++ b/spec/std/uri_spec.cr @@ -204,21 +204,6 @@ describe "URI" do it { URI.new(scheme: "scheme", path: "/path").authority.should be_nil } end - describe "#full_path" do - it { URI.new(path: "/foo").full_path.should eq("/foo") } - it { URI.new.full_path.should eq("/") } - it { URI.new(path: "/foo", query: "q=1").full_path.should eq("/foo?q=1") } - it { URI.new(path: "/", query: "q=1").full_path.should eq("/?q=1") } - it { URI.new(query: "q=1").full_path.should eq("/?q=1") } - it { URI.new(path: "/a%3Ab").full_path.should eq("/a%3Ab") } - - it "does not add '?' to the end if the query params are empty" do - uri = URI.parse("http://www.example.com/foo") - uri.query = "" - uri.full_path.should eq("/foo") - end - end - describe "#request_target" do it { URI.new(path: "/foo").request_target.should eq("/foo") } it { URI.new.request_target.should eq("/") } diff --git a/spec/std/yaml/builder_spec.cr b/spec/std/yaml/builder_spec.cr index 5c225aa64b91..b16cab6d0aeb 100644 --- a/spec/std/yaml/builder_spec.cr +++ b/spec/std/yaml/builder_spec.cr @@ -190,16 +190,4 @@ describe YAML::Builder do end end.should eq 1.to_yaml end - - it ".new (with block)" do - String.build do |io| - YAML::Builder.new(io) do |builder| - builder.stream do - builder.document do - builder.scalar(1) - end - end - end - end.should eq 1.to_yaml - end end diff --git a/src/compiler/crystal/macros.cr b/src/compiler/crystal/macros.cr index 1a2098a1b093..addd92827715 100644 --- a/src/compiler/crystal/macros.cr +++ b/src/compiler/crystal/macros.cr @@ -1919,13 +1919,6 @@ module Crystal::Macros def has_method?(name : StringLiteral | SymbolLiteral) : BoolLiteral end - # Returns `true` if this type has an attribute. For example `@[Flags]` - # or `@[Packed]` (the name you pass to this method is `"Flags"` or `"Packed"` - # in these cases). - @[Deprecated("Use #annotation instead")] - def has_attribute?(name : StringLiteral | SymbolLiteral) : BoolLiteral - end - # Returns the last `Annotation` with the given `type` # attached to this variable or `NilLiteral` if there are none. def annotation(type : TypeNode) : Annotation | NilLiteral diff --git a/src/compiler/crystal/macros/methods.cr b/src/compiler/crystal/macros/methods.cr index 0a36142a0f4a..ef77a3ae21cc 100644 --- a/src/compiler/crystal/macros/methods.cr +++ b/src/compiler/crystal/macros/methods.cr @@ -1624,19 +1624,6 @@ module Crystal value = arg.to_string("argument to 'TypeNode#has_method?'") TypeNode.has_method?(type, value) end - when "has_attribute?" - interpreter.report_warning_at(name_loc, "Deprecated TypeNode#has_attribute?. Use #annotation instead") - interpret_one_arg_method(method, args) do |arg| - value = arg.to_string("argument to 'TypeNode#has_attribute?'") - case value - when "Flags" - BoolLiteral.new(!!type.as?(EnumType).try &.flags?) - when "Packed" - BoolLiteral.new(!!type.as?(ClassType).try &.packed?) - else - BoolLiteral.new(false) - end - end when "annotation" fetch_annotation(self, method, args) do |type| self.type.annotation(type) diff --git a/src/dir.cr b/src/dir.cr index cac0382f88f9..5cb49c7d4814 100644 --- a/src/dir.cr +++ b/src/dir.cr @@ -248,12 +248,6 @@ class Dir mkdir(path, mode) unless Dir.exists?(path) end - # Removes the directory at the given path. - @[Deprecated("Use `Dir.delete` instead")] - def self.rmdir(path : Path | String) - delete(path) - end - # Removes the directory at the given path. def self.delete(path : Path | String) Crystal::System::Dir.delete(path.to_s) diff --git a/src/file/info.cr b/src/file/info.cr index 40a12f32e4e3..c12a0ed6471d 100644 --- a/src/file/info.cr +++ b/src/file/info.cr @@ -96,21 +96,9 @@ class File # The user ID that the file belongs to. abstract def owner_id : String - # :ditto: - @[Deprecated("Use File#owner_id instead")] - def owner : UInt32 - owner_id.to_u32 - end - # The group ID that the file belongs to. abstract def group_id : String - # :ditto: - @[Deprecated("Use File#group_id instead")] - def group : UInt32 - group_id.to_u32 - end - # Returns true if this `Info` and *other* are of the same file. # # On unix, this compares device and inode fields, and will compare equal for diff --git a/src/hash.cr b/src/hash.cr index 19a059969afe..acf4a45d234d 100644 --- a/src/hash.cr +++ b/src/hash.cr @@ -1208,25 +1208,6 @@ class Hash(K, V) entry ? entry.value : yield key end - # Deletes each key-value pair for which the given block returns `true`. - # - # ``` - # h = {"foo" => "bar", "fob" => "baz", "bar" => "qux"} - # h.delete_if { |key, value| key.starts_with?("fo") } - # h # => { "bar" => "qux" } - # ``` - @[Deprecated("Use `#reject!` instead")] - def delete_if - keys_to_delete = [] of K - each do |key, value| - keys_to_delete << key if yield(key, value) - end - keys_to_delete.each do |key| - delete(key) - end - self - end - # Returns `true` when hash contains no key-value pairs. # # ``` diff --git a/src/http/request.cr b/src/http/request.cr index dd8b04ee1f0c..2074458e3451 100644 --- a/src/http/request.cr +++ b/src/http/request.cr @@ -245,15 +245,6 @@ class HTTP::Request value end - # Returns request host from headers. - @[Deprecated("Use `#hostname` instead.")] - def host - host = @headers["Host"]? - return unless host - index = host.index(":") - index ? host[0...index] : host - end - # Extracts the hostname from `Host` header. # # Returns `nil` if the `Host` header is missing. diff --git a/src/http/server/handlers/log_handler.cr b/src/http/server/handlers/log_handler.cr index 43c9af150c3e..36d1c90c7a91 100644 --- a/src/http/server/handlers/log_handler.cr +++ b/src/http/server/handlers/log_handler.cr @@ -5,11 +5,6 @@ require "log" class HTTP::LogHandler include HTTP::Handler - @[Deprecated("Use `new([Log])` instead")] - def initialize(io : IO) - @log = Log.new("http.server", Log::IOBackend.new(io), :info) - end - def initialize(@log = Log.for("http.server")) end diff --git a/src/http/web_socket.cr b/src/http/web_socket.cr index 4d72a4babdb3..827c1d87c1b9 100644 --- a/src/http/web_socket.cr +++ b/src/http/web_socket.cr @@ -103,11 +103,6 @@ class HTTP::WebSocket end end - @[Deprecated("Use WebSocket#close(code, message) instead")] - def close(message) - close(nil, message) - end - # Sends a close frame to the client, and closes the connection. # The close frame may contain a body (message) that indicates the reason for closing. def close(code : CloseCode | Int? = nil, message = nil) diff --git a/src/int.cr b/src/int.cr index 90f20589e4e6..ead9935133fb 100644 --- a/src/int.cr +++ b/src/int.cr @@ -620,11 +620,6 @@ struct Int end end - @[Deprecated("Use `#to_s(base : Int, *, upcase : Bool = false)` instead")] - def to_s(base : Int, _upcase : Bool) : String - to_s(base, upcase: _upcase) - end - def to_s(io : IO, base : Int = 10, *, upcase : Bool = false) : Nil raise ArgumentError.new("Invalid base #{base}") unless 2 <= base <= 36 || base == 62 raise ArgumentError.new("upcase must be false for base 62") if upcase && base == 62 @@ -641,11 +636,6 @@ struct Int end end - @[Deprecated("Use `#to_s(io : IO, base : Int, *, upcase : Bool = false)` instead")] - def to_s(base : Int, io : IO, upcase : Bool = false) : Nil - to_s(io, base, upcase: upcase) - end - private def internal_to_s(base, upcase = false) # Given sizeof(self) <= 128 bits, we need at most 128 bytes for a base 2 # representation, plus one byte for the trailing 0. diff --git a/src/log/setup.cr b/src/log/setup.cr index cb26c44d5962..7371f8876b40 100644 --- a/src/log/setup.cr +++ b/src/log/setup.cr @@ -26,14 +26,6 @@ class Log end end - @[Deprecated("Use default_level, default_sources named arguments")] - def self.setup_from_env(*, builder : Log::Builder = Log.builder, - level : String, - sources : String, - backend = Log::IOBackend.new) - Log.setup(sources, Log::Severity.parse(level), backend, builder: builder) - end - # Setups logging based on `LOG_LEVEL` environment variable. def self.setup_from_env(*, builder : Log::Builder = Log.builder, default_level : Log::Severity = Log::Severity::Info, diff --git a/src/option_parser.cr b/src/option_parser.cr index 4f483843ab21..90a63d0ffa4a 100644 --- a/src/option_parser.cr +++ b/src/option_parser.cr @@ -115,11 +115,6 @@ class OptionParser parser end - @[Deprecated("Use `parse` instead.")] - def self.parse! : self - parse(ARGV) { |parser| yield parser } - end - # Creates a new parser. def initialize @flags = [] of String @@ -447,9 +442,4 @@ class OptionParser end end end - - @[Deprecated("Use `parse` instead.")] - def parse! - parse - end end diff --git a/src/process.cr b/src/process.cr index c679205b0538..3c83e25d02a3 100644 --- a/src/process.cr +++ b/src/process.cr @@ -41,14 +41,6 @@ class Process Crystal::System::Process.ppid.to_i64 end - # Sends a *signal* to the processes identified by the given *pids*. - @[Deprecated("Use #signal instead")] - def self.kill(signal : Signal, *pids : Int) - pids.each do |pid| - signal(signal, pid) - end - end - # Sends *signal* to the process identified by *pid*. def self.signal(signal : Signal, pid : Int) : Nil Crystal::System::Process.signal(pid, signal.value) @@ -296,12 +288,6 @@ class Process @process_info = Crystal::System::Process.new(pid) end - # See also: `Process.kill` - @[Deprecated("Use #signal instead")] - def kill(sig = Signal::TERM) - signal sig - end - # Sends *signal* to this process. def signal(signal : Signal) Crystal::System::Process.signal(@process_info.pid, signal) diff --git a/src/set.cr b/src/set.cr index 68ba76a51e7f..933223e1ef11 100644 --- a/src/set.cr +++ b/src/set.cr @@ -430,11 +430,6 @@ struct Set(T) all? { |value| other.includes?(value) } end - @[Deprecated("Use #subset_of? instead.")] - def subset?(other : Set) - subset_of?(other) - end - # Returns `true` if the set is a proper subset of the *other* set. # # This set must have fewer elements than the *other* set, and all @@ -449,11 +444,6 @@ struct Set(T) all? { |value| other.includes?(value) } end - @[Deprecated("Use #proper_subset_of? instead.")] - def proper_subset?(other : Set) - proper_subset_of?(other) - end - # Returns `true` if the set is a superset of the *other* set. # # The *other* must have the same or fewer elements than this set, and all of @@ -467,11 +457,6 @@ struct Set(T) other.subset_of?(self) end - @[Deprecated("Use #superset_of? instead.")] - def superset?(other : Set) - superset_of?(other) - end - # Returns `true` if the set is a superset of the *other* set. # # The *other* must have the same or fewer elements than this set, and all of @@ -485,11 +470,6 @@ struct Set(T) other.proper_subset_of?(self) end - @[Deprecated("Use #proper_superset_of? instead.")] - def proper_superset?(other : Set) - proper_superset_of?(other) - end - # :nodoc: def object_id @hash.object_id diff --git a/src/spec/expectations.cr b/src/spec/expectations.cr index 07b8c9337c39..8bd2a4f2d88c 100644 --- a/src/spec/expectations.cr +++ b/src/spec/expectations.cr @@ -502,16 +502,6 @@ module Spec fail(failure_message, file, line) end end - - @[Deprecated("Use named arguments `.should(expectation, file: file, line: line)`")] - def should(expectation, _file, _line) - should(expectation, file: _file, line: _line) - end - - @[Deprecated("Use named arguments `.should_not(expectation, file: file, line: line)`")] - def should_not(expectation, _file, _line) - should_not(expectation, file: _file, line: _line) - end end end diff --git a/src/static_array.cr b/src/static_array.cr index 07c35ad9ba9f..31a1a9fa3eae 100644 --- a/src/static_array.cr +++ b/src/static_array.cr @@ -193,20 +193,6 @@ struct StaticArray(T, N) self end - # Fills the array by substituting all elements with the given value. - # - # ``` - # array = StaticArray(Int32, 3).new { |i| i + 1 } - # array.[]= 2 # => nil - # array # => StaticArray[2, 2, 2] - # ``` - @[Deprecated("Use `#fill(value : T)` instead")] - def []=(value : T) - size.times do |i| - to_unsafe[i] = value - end - end - # Modifies `self` by randomizing the order of elements in the array # using the given *random* number generator. Returns `self`. # diff --git a/src/string.cr b/src/string.cr index a66c9bcadc21..8521c2efa26b 100644 --- a/src/string.cr +++ b/src/string.cr @@ -4014,19 +4014,6 @@ class String just len, char, -1 end - # Adds spaces to right of the string until it is at least size of *len*, - # and then appends the result to the given IO. - # - # ``` - # io = IO::Memory.new - # "Purple".ljust(8, io) - # io.to_s # => "Purple " - # ``` - @[Deprecated("Use `#ljust(io :IO, len : Int, char : Char = ' ')` instead")] - def ljust(len : Int, io : IO) : Nil - ljust(io, len) - end - # Adds instances of *char* to right of the string until it is at least size of *len*, # and then appends the result to the given IO. # @@ -4040,19 +4027,6 @@ class String (len - size).times { io << char } end - # Adds instances of *char* to right of the string until it is at least size of *len*, - # and then appends the result to the given IO. - # - # ``` - # io = IO::Memory.new - # "Purple".ljust(8, '-', io) - # io.to_s # => "Purple--" - # ``` - @[Deprecated("Use `#ljust(io :IO, len : Int, char : Char = ' ')` instead")] - def ljust(len : Int, char : Char, io : IO) : Nil - ljust(io, len, char) - end - # Adds instances of *char* to left of the string until it is at least size of *len*. # # ``` @@ -4064,19 +4038,6 @@ class String just len, char, 1 end - # Adds spaces to left of the string until it is at least size of *len*, - # and then appends the result to the given IO. - # - # ``` - # io = IO::Memory.new - # "Purple".rjust(8, io) - # io.to_s # => " Purple" - # ``` - @[Deprecated("Use `#rjust(io :IO, len : Int, char : Char = ' ')` instead")] - def rjust(len : Int, io : IO) : Nil - rjust(io, len) - end - # Adds instances of *char* to left of the string until it is at least size of *len*, # and then appends the result to the given IO. # @@ -4090,19 +4051,6 @@ class String io << self end - # Adds instances of *char* to left of the string until it is at least size of *len*, - # and then appends the result to the given IO. - # - # ``` - # io = IO::Memory.new - # "Purple".rjust(8, '-', io) - # io.to_s # => "--Purple" - # ``` - @[Deprecated("Use `#rjust(io :IO, len : Int, char : Char = ' ')` instead")] - def rjust(len : Int, char : Char, io : IO) : Nil - rjust(io, len, char) - end - # Adds instances of *char* to left and right of the string until it is at least size of *len*. # # ``` @@ -4115,19 +4063,6 @@ class String just len, char, 0 end - # Adds spaces to left and right of the string until it is at least size of *len*, - # then appends the result to the given IO. - # - # ``` - # io = IO::Memory.new - # "Purple".center(9, io) - # io.to_s # => " Purple " - # ``` - @[Deprecated("Use `#center(io :IO, len : Int, char : Char = ' ')` instead")] - def center(len : Int, io : IO) : Nil - center(io, len) - end - # Adds instances of *char* to left and right of the string until it is at least size of *len*, # then appends the result to the given IO. # @@ -4152,19 +4087,6 @@ class String right_padding.times { io << char } end - # Adds instances of *char* to left and right of the string until it is at least size of *len*, - # then appends the result to the given IO. - # - # ``` - # io = IO::Memory.new - # "Purple".center(9, '-', io) - # io.to_s # => "-Purple--" - # ``` - @[Deprecated("Use `#center(io :IO, len : Int, char : Char = ' ')` instead")] - def center(len : Int, char : Char, io : IO) : Nil - center(io, len, char) - end - private def just(len, char, justify) return self if size >= len diff --git a/src/time.cr b/src/time.cr index 6e7532c52822..b36d8a4cef1e 100644 --- a/src/time.cr +++ b/src/time.cr @@ -1091,14 +1091,6 @@ struct Time Format.new(format).format(self, io) end - # Formats this `Time` according to the pattern in *format* to the given *io*. - # - # See `Time::Format` for details. - @[Deprecated("Use `#to_s(io : IO, format : String)` instead")] - def to_s(format : String, io : IO) : Nil - to_s(io, format) - end - # Format this time using the format specified by [RFC 3339](https://tools.ietf.org/html/rfc3339) ([ISO 8601](http://xml.coverpages.org/ISO-FDIS-8601.pdf) profile). # # ``` diff --git a/src/time/span.cr b/src/time/span.cr index f9321fd0c527..ec50e9a990f7 100644 --- a/src/time/span.cr +++ b/src/time/span.cr @@ -227,12 +227,6 @@ struct Time::Span @seconds end - # Alias of `abs`. - @[Deprecated("Use `#abs` instead.")] - def duration : Time::Span - abs - end - # Returns the absolute (non-negative) amount of time this `Time::Span` # represents by removing the sign. def abs : Time::Span diff --git a/src/uri.cr b/src/uri.cr index 1d675c03f50c..9e079f0017e2 100644 --- a/src/uri.cr +++ b/src/uri.cr @@ -232,12 +232,6 @@ class URI end end - # :ditto: - @[Deprecated("Use `#request_target` instead.")] - def full_path : String - request_target - end - # Returns `true` if URI has a *scheme* specified. def absolute? : Bool @scheme ? true : false diff --git a/src/yaml/builder.cr b/src/yaml/builder.cr index 29f4cf954c84..77924f184809 100644 --- a/src/yaml/builder.cr +++ b/src/yaml/builder.cr @@ -56,14 +56,6 @@ class YAML::Builder io.flush end - # :ditto: - @[Deprecated("Use .build instead")] - def self.new(io : IO, & : self ->) : Nil - build(io) do |builder| - yield builder - end - end - # Starts a YAML stream. def start_stream emit stream_start, LibYAML::Encoding::UTF8