Skip to content

Commit e232806

Browse files
committed
Add Ruby module type
1 parent fe6df89 commit e232806

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

core/ruby.rbs

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# <!-- rdoc-file=version.c -->
2+
# The [Ruby](rdoc-ref:Ruby) module that contains portable information among
3+
# implementations.
4+
#
5+
# The constants defined here are aliased in the toplevel with `RUBY_` prefix.
6+
#
7+
module Ruby
8+
# <!-- rdoc-file=version.c -->
9+
# The copyright string for ruby
10+
#
11+
COPYRIGHT: ::String
12+
13+
# <!-- rdoc-file=version.c -->
14+
# The full ruby version string, like `ruby -v` prints
15+
#
16+
DESCRIPTION: ::String
17+
18+
# <!-- rdoc-file=version.c -->
19+
# The engine or interpreter this ruby uses.
20+
#
21+
ENGINE: ::String
22+
23+
# <!-- rdoc-file=version.c -->
24+
# The version of the engine or interpreter this ruby uses.
25+
#
26+
ENGINE_VERSION: ::String
27+
28+
# <!-- rdoc-file=version.c -->
29+
# The patchlevel for this ruby. If this is a development build of ruby the
30+
# patchlevel will be -1
31+
#
32+
PATCHLEVEL: ::Integer
33+
34+
# <!-- rdoc-file=version.c -->
35+
# The platform for this ruby
36+
#
37+
PLATFORM: ::String
38+
39+
# <!-- rdoc-file=version.c -->
40+
# The date this ruby was released
41+
#
42+
RELEASE_DATE: ::String
43+
44+
# <!-- rdoc-file=version.c -->
45+
# The GIT commit hash for this ruby.
46+
#
47+
REVISION: ::String
48+
49+
# <!-- rdoc-file=version.c -->
50+
# The running version of ruby
51+
#
52+
VERSION: ::String
53+
end

test/stdlib/Ruby_test.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
require_relative "test_helper"
2+
require "resolv"
3+
4+
class RubyTest < Test::Unit::TestCase
5+
include TestHelper
6+
7+
testing "::Ruby"
8+
9+
def test_constants
10+
assert_const_type '::String', 'Ruby::COPYRIGHT'
11+
assert_const_type '::String', 'Ruby::DESCRIPTION'
12+
assert_const_type '::String', 'Ruby::ENGINE'
13+
assert_const_type '::String', 'Ruby::ENGINE_VERSION'
14+
assert_const_type '::Integer', 'Ruby::PATCHLEVEL'
15+
assert_const_type '::String', 'Ruby::PLATFORM'
16+
assert_const_type '::String', 'Ruby::RELEASE_DATE'
17+
assert_const_type '::String', 'Ruby::REVISION'
18+
assert_const_type '::String', 'Ruby::VERSION'
19+
end
20+
end

0 commit comments

Comments
 (0)