sofia 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.byebug_history +6 -0
- data/.rubocop.yml +179 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +132 -0
- data/LICENSE.txt +21 -0
- data/README.md +21 -0
- data/Rakefile +16 -0
- data/lib/sofia/adapter/net_http.rb +67 -0
- data/lib/sofia/adapter.rb +20 -0
- data/lib/sofia/client.rb +55 -0
- data/lib/sofia/error/argument_error.rb +8 -0
- data/lib/sofia/error/connection_failed.rb +8 -0
- data/lib/sofia/error/invalid_json.rb +8 -0
- data/lib/sofia/error/ssl_error.rb +8 -0
- data/lib/sofia/error/timeout_error.rb +8 -0
- data/lib/sofia/error.rb +14 -0
- data/lib/sofia/helper.rb +9 -0
- data/lib/sofia/request.rb +56 -0
- data/lib/sofia/response.rb +57 -0
- data/lib/sofia/sorbet_types.rb +19 -0
- data/lib/sofia/types/adapter.rb +39 -0
- data/lib/sofia/types/base_url.rb +33 -0
- data/lib/sofia/types/body.rb +60 -0
- data/lib/sofia/types/headers.rb +56 -0
- data/lib/sofia/types/params.rb +56 -0
- data/lib/sofia/types/path.rb +28 -0
- data/lib/sofia/types.rb +13 -0
- data/lib/sofia/version.rb +5 -0
- data/lib/sofia.rb +25 -0
- data/sig/sofia.rbs +4 -0
- data/sorbet/config +6 -0
- data/sorbet/rbi/annotations/.gitattributes +1 -0
- data/sorbet/rbi/annotations/activesupport.rbi +495 -0
- data/sorbet/rbi/annotations/minitest.rbi +120 -0
- data/sorbet/rbi/annotations/mocha.rbi +34 -0
- data/sorbet/rbi/annotations/rainbow.rbi +269 -0
- data/sorbet/rbi/dsl/.gitattributes +1 -0
- data/sorbet/rbi/dsl/active_support/callbacks.rbi +21 -0
- data/sorbet/rbi/gems/.gitattributes +1 -0
- data/sorbet/rbi/gems/activesupport@8.1.2.rbi +20360 -0
- data/sorbet/rbi/gems/ast@2.4.3.rbi +585 -0
- data/sorbet/rbi/gems/base64@0.3.0.rbi +545 -0
- data/sorbet/rbi/gems/benchmark@0.4.1.rbi +619 -0
- data/sorbet/rbi/gems/bigdecimal@4.0.1.rbi +239 -0
- data/sorbet/rbi/gems/concurrent-ruby@1.3.6.rbi +11674 -0
- data/sorbet/rbi/gems/connection_pool@3.0.2.rbi +9 -0
- data/sorbet/rbi/gems/date@3.4.1.rbi +75 -0
- data/sorbet/rbi/gems/drb@2.2.3.rbi +1661 -0
- data/sorbet/rbi/gems/erb@5.0.2.rbi +878 -0
- data/sorbet/rbi/gems/erubi@1.13.1.rbi +155 -0
- data/sorbet/rbi/gems/factory_bot@6.5.6.rbi +2748 -0
- data/sorbet/rbi/gems/i18n@1.14.8.rbi +2359 -0
- data/sorbet/rbi/gems/io-console@0.8.1.rbi +9 -0
- data/sorbet/rbi/gems/json@2.12.2.rbi +2051 -0
- data/sorbet/rbi/gems/language_server-protocol@3.17.0.5.rbi +9 -0
- data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +86 -0
- data/sorbet/rbi/gems/logger@1.7.0.rbi +963 -0
- data/sorbet/rbi/gems/minitest@5.25.5.rbi +1547 -0
- data/sorbet/rbi/gems/mocha@3.0.1.rbi +28 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
- data/sorbet/rbi/gems/openssl@4.0.0.rbi +1908 -0
- data/sorbet/rbi/gems/parallel@1.27.0.rbi +291 -0
- data/sorbet/rbi/gems/parser@3.3.8.0.rbi +5535 -0
- data/sorbet/rbi/gems/pp@0.6.2.rbi +368 -0
- data/sorbet/rbi/gems/prettyprint@0.2.0.rbi +477 -0
- data/sorbet/rbi/gems/prism@1.5.1.rbi +42049 -0
- data/sorbet/rbi/gems/psych@5.2.6.rbi +2469 -0
- data/sorbet/rbi/gems/racc@1.8.1.rbi +160 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +403 -0
- data/sorbet/rbi/gems/rake@13.2.1.rbi +3033 -0
- data/sorbet/rbi/gems/rbi@0.3.3.rbi +6742 -0
- data/sorbet/rbi/gems/rbs@3.9.5.rbi +6978 -0
- data/sorbet/rbi/gems/rdoc@6.14.2.rbi +12688 -0
- data/sorbet/rbi/gems/regexp_parser@2.10.0.rbi +3795 -0
- data/sorbet/rbi/gems/reline@0.6.2.rbi +2441 -0
- data/sorbet/rbi/gems/rexml@3.4.1.rbi +5240 -0
- data/sorbet/rbi/gems/rubocop-ast@1.45.1.rbi +7721 -0
- data/sorbet/rbi/gems/rubocop@1.76.1.rbi +62517 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
- data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +9 -0
- data/sorbet/rbi/gems/securerandom@0.4.1.rbi +75 -0
- data/sorbet/rbi/gems/spoom@1.6.3.rbi +6985 -0
- data/sorbet/rbi/gems/stringio@3.1.7.rbi +9 -0
- data/sorbet/rbi/gems/tapioca@0.16.11.rbi +3628 -0
- data/sorbet/rbi/gems/thor@1.4.0.rbi +4399 -0
- data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5918 -0
- data/sorbet/rbi/gems/unicode-display_width@3.1.4.rbi +132 -0
- data/sorbet/rbi/gems/unicode-emoji@4.0.4.rbi +251 -0
- data/sorbet/rbi/gems/uri@1.1.1.rbi +2405 -0
- data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +435 -0
- data/sorbet/rbi/gems/yard@0.9.37.rbi +18379 -0
- data/sorbet/rbi/shims/byebug.rbi +6 -0
- data/sorbet/rbi/shims/client.rbi +22 -0
- data/sorbet/rbi/todo.rbi +7 -0
- data/sorbet/tapioca/config.yml +13 -0
- data/sorbet/tapioca/require.rb +4 -0
- metadata +137 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# typed: false
|
|
2
|
+
|
|
3
|
+
# DO NOT EDIT MANUALLY
|
|
4
|
+
# This is an autogenerated file for types exported from the `bigdecimal` gem.
|
|
5
|
+
# Please instead update this file by running `bin/tapioca gem bigdecimal`.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# source://bigdecimal//lib/bigdecimal.rb#13
|
|
9
|
+
class BigDecimal < ::Numeric
|
|
10
|
+
# call-seq:
|
|
11
|
+
# self ** other -> bigdecimal
|
|
12
|
+
#
|
|
13
|
+
# Returns the \BigDecimal value of +self+ raised to power +other+:
|
|
14
|
+
#
|
|
15
|
+
# b = BigDecimal('3.14')
|
|
16
|
+
# b ** 2 # => 0.98596e1
|
|
17
|
+
# b ** 2.0 # => 0.98596e1
|
|
18
|
+
# b ** Rational(2, 1) # => 0.98596e1
|
|
19
|
+
#
|
|
20
|
+
# Related: BigDecimal#power.
|
|
21
|
+
#
|
|
22
|
+
# source://bigdecimal//lib/bigdecimal.rb#77
|
|
23
|
+
def **(y); end
|
|
24
|
+
|
|
25
|
+
# call-seq:
|
|
26
|
+
# power(n)
|
|
27
|
+
# power(n, prec)
|
|
28
|
+
#
|
|
29
|
+
# Returns the value raised to the power of n.
|
|
30
|
+
#
|
|
31
|
+
# Also available as the operator **.
|
|
32
|
+
#
|
|
33
|
+
# source://bigdecimal//lib/bigdecimal.rb#97
|
|
34
|
+
def power(y, prec = T.unsafe(nil)); end
|
|
35
|
+
|
|
36
|
+
# Returns the square root of the value.
|
|
37
|
+
#
|
|
38
|
+
# Result has at least prec significant digits.
|
|
39
|
+
#
|
|
40
|
+
# @raise [FloatDomainError]
|
|
41
|
+
#
|
|
42
|
+
# source://bigdecimal//lib/bigdecimal.rb#212
|
|
43
|
+
def sqrt(prec); end
|
|
44
|
+
|
|
45
|
+
# call-seq:
|
|
46
|
+
# a.to_d -> bigdecimal
|
|
47
|
+
#
|
|
48
|
+
# Returns self.
|
|
49
|
+
#
|
|
50
|
+
# require 'bigdecimal/util'
|
|
51
|
+
#
|
|
52
|
+
# d = BigDecimal("3.14")
|
|
53
|
+
# d.to_d # => 0.314e1
|
|
54
|
+
#
|
|
55
|
+
# source://bigdecimal//lib/bigdecimal/util.rb#110
|
|
56
|
+
def to_d; end
|
|
57
|
+
|
|
58
|
+
# call-seq:
|
|
59
|
+
# a.to_digits -> string
|
|
60
|
+
#
|
|
61
|
+
# Converts a BigDecimal to a String of the form "nnnnnn.mmm".
|
|
62
|
+
# This method is deprecated; use BigDecimal#to_s("F") instead.
|
|
63
|
+
#
|
|
64
|
+
# require 'bigdecimal/util'
|
|
65
|
+
#
|
|
66
|
+
# d = BigDecimal("3.14")
|
|
67
|
+
# d.to_digits # => "3.14"
|
|
68
|
+
#
|
|
69
|
+
# source://bigdecimal//lib/bigdecimal/util.rb#90
|
|
70
|
+
def to_digits; end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# source://bigdecimal//lib/bigdecimal.rb#14
|
|
74
|
+
module BigDecimal::Internal
|
|
75
|
+
class << self
|
|
76
|
+
# Coerce x to BigDecimal with the specified precision.
|
|
77
|
+
# TODO: some methods (example: BigMath.exp) require more precision than specified to coerce.
|
|
78
|
+
#
|
|
79
|
+
# @raise [ArgumentError]
|
|
80
|
+
#
|
|
81
|
+
# source://bigdecimal//lib/bigdecimal.rb#18
|
|
82
|
+
def coerce_to_bigdecimal(x, prec, method_name); end
|
|
83
|
+
|
|
84
|
+
# source://bigdecimal//lib/bigdecimal.rb#30
|
|
85
|
+
def coerce_validate_prec(prec, method_name, accept_zero: T.unsafe(nil)); end
|
|
86
|
+
|
|
87
|
+
# source://bigdecimal//lib/bigdecimal.rb#50
|
|
88
|
+
def infinity_computation_result; end
|
|
89
|
+
|
|
90
|
+
# source://bigdecimal//lib/bigdecimal.rb#57
|
|
91
|
+
def nan_computation_result; end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
BigDecimal::VERSION = T.let(T.unsafe(nil), String)
|
|
96
|
+
|
|
97
|
+
# Core BigMath methods for BigDecimal (log, exp) are defined here.
|
|
98
|
+
# Other methods (sin, cos, atan) are defined in 'bigdecimal/math.rb'.
|
|
99
|
+
#
|
|
100
|
+
# source://bigdecimal//lib/bigdecimal.rb#240
|
|
101
|
+
module BigMath
|
|
102
|
+
private
|
|
103
|
+
|
|
104
|
+
# source://bigdecimal//lib/bigdecimal.rb#310
|
|
105
|
+
def _exp_taylor(x, prec); end
|
|
106
|
+
|
|
107
|
+
# call-seq:
|
|
108
|
+
# BigMath.exp(decimal, numeric) -> BigDecimal
|
|
109
|
+
#
|
|
110
|
+
# Computes the value of e (the base of natural logarithms) raised to the
|
|
111
|
+
# power of +decimal+, to the specified number of digits of precision.
|
|
112
|
+
#
|
|
113
|
+
# If +decimal+ is infinity, returns Infinity.
|
|
114
|
+
#
|
|
115
|
+
# If +decimal+ is NaN, returns NaN.
|
|
116
|
+
#
|
|
117
|
+
# source://bigdecimal//lib/bigdecimal.rb#332
|
|
118
|
+
def exp(x, prec); end
|
|
119
|
+
|
|
120
|
+
# call-seq:
|
|
121
|
+
# BigMath.log(decimal, numeric) -> BigDecimal
|
|
122
|
+
#
|
|
123
|
+
# Computes the natural logarithm of +decimal+ to the specified number of
|
|
124
|
+
# digits of precision, +numeric+.
|
|
125
|
+
#
|
|
126
|
+
# If +decimal+ is zero or negative, raises Math::DomainError.
|
|
127
|
+
#
|
|
128
|
+
# If +decimal+ is positive infinity, returns Infinity.
|
|
129
|
+
#
|
|
130
|
+
# If +decimal+ is NaN, returns NaN.
|
|
131
|
+
#
|
|
132
|
+
# source://bigdecimal//lib/bigdecimal.rb#255
|
|
133
|
+
def log(x, prec); end
|
|
134
|
+
|
|
135
|
+
class << self
|
|
136
|
+
# call-seq:
|
|
137
|
+
# BigMath.exp(decimal, numeric) -> BigDecimal
|
|
138
|
+
#
|
|
139
|
+
# Computes the value of e (the base of natural logarithms) raised to the
|
|
140
|
+
# power of +decimal+, to the specified number of digits of precision.
|
|
141
|
+
#
|
|
142
|
+
# If +decimal+ is infinity, returns Infinity.
|
|
143
|
+
#
|
|
144
|
+
# If +decimal+ is NaN, returns NaN.
|
|
145
|
+
#
|
|
146
|
+
# source://bigdecimal//lib/bigdecimal.rb#332
|
|
147
|
+
def exp(x, prec); end
|
|
148
|
+
|
|
149
|
+
# call-seq:
|
|
150
|
+
# BigMath.log(decimal, numeric) -> BigDecimal
|
|
151
|
+
#
|
|
152
|
+
# Computes the natural logarithm of +decimal+ to the specified number of
|
|
153
|
+
# digits of precision, +numeric+.
|
|
154
|
+
#
|
|
155
|
+
# If +decimal+ is zero or negative, raises Math::DomainError.
|
|
156
|
+
#
|
|
157
|
+
# If +decimal+ is positive infinity, returns Infinity.
|
|
158
|
+
#
|
|
159
|
+
# If +decimal+ is NaN, returns NaN.
|
|
160
|
+
#
|
|
161
|
+
# @raise [Math::DomainError]
|
|
162
|
+
#
|
|
163
|
+
# source://bigdecimal//lib/bigdecimal.rb#255
|
|
164
|
+
def log(x, prec); end
|
|
165
|
+
|
|
166
|
+
private
|
|
167
|
+
|
|
168
|
+
# source://bigdecimal//lib/bigdecimal.rb#310
|
|
169
|
+
def _exp_taylor(x, prec); end
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# source://bigdecimal//lib/bigdecimal/util.rb#141
|
|
174
|
+
class Complex < ::Numeric
|
|
175
|
+
# call-seq:
|
|
176
|
+
# cmp.to_d -> bigdecimal
|
|
177
|
+
# cmp.to_d(precision) -> bigdecimal
|
|
178
|
+
#
|
|
179
|
+
# Returns the value as a BigDecimal.
|
|
180
|
+
# If the imaginary part is not +0+, an error is raised
|
|
181
|
+
#
|
|
182
|
+
# The +precision+ parameter is used to determine the number of
|
|
183
|
+
# significant digits for the result. When +precision+ is set to +0+,
|
|
184
|
+
# the number of digits to represent the float being converted is determined
|
|
185
|
+
# automatically.
|
|
186
|
+
# The default +precision+ is +0+.
|
|
187
|
+
#
|
|
188
|
+
# require 'bigdecimal'
|
|
189
|
+
# require 'bigdecimal/util'
|
|
190
|
+
#
|
|
191
|
+
# Complex(0.1234567, 0).to_d(4) # => 0.1235e0
|
|
192
|
+
# Complex(Rational(22, 7), 0).to_d(3) # => 0.314e1
|
|
193
|
+
# Complex(1, 1).to_d # raises ArgumentError
|
|
194
|
+
#
|
|
195
|
+
# See also Kernel.BigDecimal.
|
|
196
|
+
#
|
|
197
|
+
# source://bigdecimal//lib/bigdecimal/util.rb#164
|
|
198
|
+
def to_d(precision = T.unsafe(nil)); end
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# source://bigdecimal//lib/bigdecimal/util.rb#172
|
|
202
|
+
class NilClass
|
|
203
|
+
# call-seq:
|
|
204
|
+
# nil.to_d -> bigdecimal
|
|
205
|
+
#
|
|
206
|
+
# Returns nil represented as a BigDecimal.
|
|
207
|
+
#
|
|
208
|
+
# require 'bigdecimal'
|
|
209
|
+
# require 'bigdecimal/util'
|
|
210
|
+
#
|
|
211
|
+
# nil.to_d # => 0.0
|
|
212
|
+
#
|
|
213
|
+
# source://bigdecimal//lib/bigdecimal/util.rb#183
|
|
214
|
+
def to_d; end
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# source://bigdecimal//lib/bigdecimal/util.rb#116
|
|
218
|
+
class Rational < ::Numeric
|
|
219
|
+
# call-seq:
|
|
220
|
+
# rat.to_d(precision) -> bigdecimal
|
|
221
|
+
#
|
|
222
|
+
# Returns the value as a BigDecimal.
|
|
223
|
+
#
|
|
224
|
+
# The +precision+ parameter is used to determine the number of
|
|
225
|
+
# significant digits for the result. When +precision+ is set to +0+,
|
|
226
|
+
# the number of digits to represent the float being converted is determined
|
|
227
|
+
# automatically.
|
|
228
|
+
# The default +precision+ is +0+.
|
|
229
|
+
#
|
|
230
|
+
# require 'bigdecimal'
|
|
231
|
+
# require 'bigdecimal/util'
|
|
232
|
+
#
|
|
233
|
+
# Rational(22, 7).to_d(3) # => 0.314e1
|
|
234
|
+
#
|
|
235
|
+
# See also Kernel.BigDecimal.
|
|
236
|
+
#
|
|
237
|
+
# source://bigdecimal//lib/bigdecimal/util.rb#135
|
|
238
|
+
def to_d(precision = T.unsafe(nil)); end
|
|
239
|
+
end
|