Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions stdlib/pp/0/pp.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
# Tanaka Akira <akr@fsij.org>
#
class PP < PrettyPrint
# <!-- rdoc-file=lib/pp.rb -->
# The version string
#
VERSION: String

interface _PrettyPrint
def pretty_print: (untyped q) -> untyped

Expand Down Expand Up @@ -124,6 +129,14 @@ class PP < PrettyPrint
#
def pp: (_PrettyPrint obj) -> untyped

# <!--
# rdoc-file=lib/pp.rb
# - pp_hash_pair(k, v)
# -->
# A pretty print for a pair of Hash
#
def pp_hash_pair: (untyped k, untyped v) -> void

# <!--
# rdoc-file=lib/pp.rb
# - object_group(obj) { || ... }
Expand Down
4 changes: 4 additions & 0 deletions stdlib/shellwords/0/shellwords.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
# * Akinori MUSHA <knu@iDaemons.org> (current maintainer)
#
module Shellwords
# <!-- rdoc-file=lib/shellwords.rb -->
# The version number string.
#
VERSION: String
# <!--
# rdoc-file=lib/shellwords.rb
# - shellescape(str)
Expand Down
6 changes: 6 additions & 0 deletions stdlib/strscan/0/string_scanner.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -1646,3 +1646,9 @@ end
StringScanner::Id: String

StringScanner::Version: String

# <!-- rdoc-file=ext/strscan/strscan.c -->
# The error class for StringScanner. See StringScanner#unscan.
#
class StringScanner::Error < StandardError
end
9 changes: 9 additions & 0 deletions test/stdlib/PP_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ class PPSingletonTest < Test::Unit::TestCase
library "pp"
testing "singleton(::PP)"

def test_version
assert_const_type "String", "PP::VERSION"
end

def test_pp
assert_send_type "(::PP::_PrettyPrint obj, ?::PP::_LeftShift out, ?::Integer width) -> untyped",
PP, :pp, Object.new, ''.dup
Expand Down Expand Up @@ -105,6 +109,11 @@ def test_pp_hash
assert_send_type "(untyped obj) -> untyped",
PP.new, :pp_hash, {}
end

def test_pp_hash_pair
assert_send_type "(untyped k, untyped v) -> void",
PP.new, :pp_hash_pair, :a, 1
end
end

class PP::ObjectMixinTest < Test::Unit::TestCase
Expand Down
4 changes: 4 additions & 0 deletions test/stdlib/Shellwords_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ class ShellwordsSingletonTest < Test::Unit::TestCase
library "shellwords"
testing "singleton(::Shellwords)"

def test_version
assert_const_type "String", "Shellwords::VERSION"
end

def test_shellescape
assert_send_type "(::String str) -> ::String",
Shellwords, :shellescape, "shell"
Expand Down
4 changes: 4 additions & 0 deletions test/stdlib/StringScanner_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ def test_must_C_version
assert_send_type "() -> singleton(::StringScanner)",
StringScanner, :must_C_version
end

def test_error
assert_const_type "Class", "StringScanner::Error"
end
end

class StringScannerTest < Test::Unit::TestCase
Expand Down
Loading