Skip to content

Commit

Permalink
Move bigdecimal from rbs/stdlib
Browse files Browse the repository at this point in the history
  • Loading branch information
ksss committed Feb 2, 2025
1 parent 0fc4e8c commit 3056837
Show file tree
Hide file tree
Showing 4 changed files with 1,672 additions and 0 deletions.
19 changes: 19 additions & 0 deletions gems/bigdecimal/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This configuration inherits from /.rubocop.yml.
# You can configure RBS style of this gem.
# This file is used on CI. It is configured to automatically
# make rubocop suggestions on pull requests for this gem.
# If you do not like the style enforcement, you should remove this file.
inherit_from: ../../.rubocop.yml

##
# If you want to customize the style, please consult with the gem reviewers.
# You can see the list of cops at https://github.com/ksss/rubocop-on-rbs/blob/main/docs/modules/ROOT/pages/cops.adoc

RBS/Layout:
Enabled: true

RBS/Lint:
Enabled: true

RBS/Style:
Enabled: true
22 changes: 22 additions & 0 deletions gems/bigdecimal/3.1/_test/test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Write Ruby code to test the RBS.
# It is type checked by `steep check` command.

require "bigdecimal"
require "bigdecimal/util"

BigDecimal("1.23")

BigDecimal("1.23") + BigDecimal("1.23")
BigDecimal("1.23") - BigDecimal("1.23")
BigDecimal("1.23") * BigDecimal("1.23")
BigDecimal("1.23") / BigDecimal("1.23")

BigDecimal("1.23").to_d
BigDecimal("1.23").to_f
BigDecimal("1.23").to_i
BigDecimal("1.23").to_r

123.to_d
12.3.to_d
12r.to_d(3)
0i.to_d
Loading

0 comments on commit 3056837

Please sign in to comment.