sxn 0.2.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/.gem_rbs_collection/addressable/2.8/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/addressable/2.8/addressable.rbs +62 -0
- data/.gem_rbs_collection/async/2.12/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/async/2.12/async.rbs +119 -0
- data/.gem_rbs_collection/async/2.12/kernel.rbs +5 -0
- data/.gem_rbs_collection/async/2.12/manifest.yaml +7 -0
- data/.gem_rbs_collection/bcrypt/3.1/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/bcrypt/3.1/bcrypt.rbs +47 -0
- data/.gem_rbs_collection/bcrypt/3.1/manifest.yaml +2 -0
- data/.gem_rbs_collection/bigdecimal/3.1/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/bigdecimal/3.1/bigdecimal-math.rbs +119 -0
- data/.gem_rbs_collection/bigdecimal/3.1/bigdecimal.rbs +1630 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/array.rbs +4 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/executor.rbs +26 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/hash.rbs +4 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/map.rbs +65 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/promises.rbs +249 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/utility/processor_counter.rbs +5 -0
- data/.gem_rbs_collection/diff-lcs/1.5/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/diff-lcs/1.5/diff-lcs.rbs +11 -0
- data/.gem_rbs_collection/listen/3.9/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/listen/3.9/listen.rbs +25 -0
- data/.gem_rbs_collection/listen/3.9/listener.rbs +24 -0
- data/.gem_rbs_collection/mini_mime/0.1/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/mini_mime/0.1/mini_mime.rbs +14 -0
- data/.gem_rbs_collection/parallel/1.20/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/parallel/1.20/parallel.rbs +86 -0
- data/.gem_rbs_collection/rake/13.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rake/13.0/manifest.yaml +2 -0
- data/.gem_rbs_collection/rake/13.0/rake.rbs +39 -0
- data/.gem_rbs_collection/rubocop-ast/1.46/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rubocop-ast/1.46/rubocop-ast.rbs +822 -0
- data/.gem_rbs_collection/sqlite3/2.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/sqlite3/2.0/database.rbs +20 -0
- data/.gem_rbs_collection/sqlite3/2.0/pragmas.rbs +5 -0
- data/.rspec +4 -0
- data/.rubocop.yml +121 -0
- data/.simplecov +51 -0
- data/CHANGELOG.md +49 -0
- data/Gemfile +24 -0
- data/Gemfile.lock +329 -0
- data/LICENSE.txt +21 -0
- data/README.md +225 -0
- data/Rakefile +54 -0
- data/Steepfile +50 -0
- data/bin/sxn +6 -0
- data/lib/sxn/CLI.rb +275 -0
- data/lib/sxn/commands/init.rb +137 -0
- data/lib/sxn/commands/projects.rb +350 -0
- data/lib/sxn/commands/rules.rb +435 -0
- data/lib/sxn/commands/sessions.rb +300 -0
- data/lib/sxn/commands/worktrees.rb +416 -0
- data/lib/sxn/commands.rb +13 -0
- data/lib/sxn/config/config_cache.rb +295 -0
- data/lib/sxn/config/config_discovery.rb +242 -0
- data/lib/sxn/config/config_validator.rb +562 -0
- data/lib/sxn/config.rb +259 -0
- data/lib/sxn/core/config_manager.rb +290 -0
- data/lib/sxn/core/project_manager.rb +307 -0
- data/lib/sxn/core/rules_manager.rb +306 -0
- data/lib/sxn/core/session_manager.rb +336 -0
- data/lib/sxn/core/worktree_manager.rb +281 -0
- data/lib/sxn/core.rb +13 -0
- data/lib/sxn/database/errors.rb +29 -0
- data/lib/sxn/database/session_database.rb +691 -0
- data/lib/sxn/database.rb +24 -0
- data/lib/sxn/errors.rb +76 -0
- data/lib/sxn/rules/base_rule.rb +367 -0
- data/lib/sxn/rules/copy_files_rule.rb +346 -0
- data/lib/sxn/rules/errors.rb +28 -0
- data/lib/sxn/rules/project_detector.rb +871 -0
- data/lib/sxn/rules/rules_engine.rb +485 -0
- data/lib/sxn/rules/setup_commands_rule.rb +307 -0
- data/lib/sxn/rules/template_rule.rb +262 -0
- data/lib/sxn/rules.rb +148 -0
- data/lib/sxn/runtime_validations.rb +96 -0
- data/lib/sxn/security/secure_command_executor.rb +364 -0
- data/lib/sxn/security/secure_file_copier.rb +478 -0
- data/lib/sxn/security/secure_path_validator.rb +258 -0
- data/lib/sxn/security.rb +15 -0
- data/lib/sxn/templates/common/gitignore.liquid +99 -0
- data/lib/sxn/templates/common/session-info.md.liquid +58 -0
- data/lib/sxn/templates/errors.rb +36 -0
- data/lib/sxn/templates/javascript/README.md.liquid +59 -0
- data/lib/sxn/templates/javascript/session-info.md.liquid +206 -0
- data/lib/sxn/templates/rails/CLAUDE.md.liquid +78 -0
- data/lib/sxn/templates/rails/database.yml.liquid +31 -0
- data/lib/sxn/templates/rails/session-info.md.liquid +144 -0
- data/lib/sxn/templates/template_engine.rb +346 -0
- data/lib/sxn/templates/template_processor.rb +279 -0
- data/lib/sxn/templates/template_security.rb +410 -0
- data/lib/sxn/templates/template_variables.rb +713 -0
- data/lib/sxn/templates.rb +28 -0
- data/lib/sxn/ui/output.rb +103 -0
- data/lib/sxn/ui/progress_bar.rb +91 -0
- data/lib/sxn/ui/prompt.rb +116 -0
- data/lib/sxn/ui/table.rb +183 -0
- data/lib/sxn/ui.rb +12 -0
- data/lib/sxn/version.rb +5 -0
- data/lib/sxn.rb +63 -0
- data/rbs_collection.lock.yaml +180 -0
- data/rbs_collection.yaml +39 -0
- data/scripts/test.sh +31 -0
- data/sig/external/liquid.rbs +116 -0
- data/sig/external/thor.rbs +99 -0
- data/sig/external/tty.rbs +71 -0
- data/sig/sxn/cli.rbs +46 -0
- data/sig/sxn/commands/init.rbs +38 -0
- data/sig/sxn/commands/projects.rbs +72 -0
- data/sig/sxn/commands/rules.rbs +95 -0
- data/sig/sxn/commands/sessions.rbs +62 -0
- data/sig/sxn/commands/worktrees.rbs +82 -0
- data/sig/sxn/commands.rbs +6 -0
- data/sig/sxn/config/config_cache.rbs +67 -0
- data/sig/sxn/config/config_discovery.rbs +64 -0
- data/sig/sxn/config/config_validator.rbs +64 -0
- data/sig/sxn/config.rbs +74 -0
- data/sig/sxn/core/config_manager.rbs +67 -0
- data/sig/sxn/core/project_manager.rbs +52 -0
- data/sig/sxn/core/rules_manager.rbs +54 -0
- data/sig/sxn/core/session_manager.rbs +59 -0
- data/sig/sxn/core/worktree_manager.rbs +50 -0
- data/sig/sxn/core.rbs +87 -0
- data/sig/sxn/database/errors.rbs +37 -0
- data/sig/sxn/database/session_database.rbs +151 -0
- data/sig/sxn/database.rbs +83 -0
- data/sig/sxn/errors.rbs +89 -0
- data/sig/sxn/rules/base_rule.rbs +137 -0
- data/sig/sxn/rules/copy_files_rule.rbs +65 -0
- data/sig/sxn/rules/errors.rbs +33 -0
- data/sig/sxn/rules/project_detector.rbs +115 -0
- data/sig/sxn/rules/rules_engine.rbs +118 -0
- data/sig/sxn/rules/setup_commands_rule.rbs +60 -0
- data/sig/sxn/rules/template_rule.rbs +44 -0
- data/sig/sxn/rules.rbs +287 -0
- data/sig/sxn/runtime_validations.rbs +16 -0
- data/sig/sxn/security/secure_command_executor.rbs +63 -0
- data/sig/sxn/security/secure_file_copier.rbs +79 -0
- data/sig/sxn/security/secure_path_validator.rbs +30 -0
- data/sig/sxn/security.rbs +128 -0
- data/sig/sxn/templates/errors.rbs +43 -0
- data/sig/sxn/templates/template_engine.rbs +50 -0
- data/sig/sxn/templates/template_processor.rbs +44 -0
- data/sig/sxn/templates/template_security.rbs +62 -0
- data/sig/sxn/templates/template_variables.rbs +103 -0
- data/sig/sxn/templates.rbs +104 -0
- data/sig/sxn/ui/output.rbs +50 -0
- data/sig/sxn/ui/progress_bar.rbs +39 -0
- data/sig/sxn/ui/prompt.rbs +38 -0
- data/sig/sxn/ui/table.rbs +43 -0
- data/sig/sxn/ui.rbs +63 -0
- data/sig/sxn/version.rbs +5 -0
- data/sig/sxn.rbs +29 -0
- metadata +635 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8c4ab07a7db971653928d5f28ad031c215d1366fa3317d8a4ab3c53fe6c10935
|
4
|
+
data.tar.gz: ece376145596157b9f4c2be71508334f80ce85f542ee40ca9f5af17db6ee3202
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 508ece263bcb4fe72595aded4fee96243fe7f440f6ee1c6d91dcc9bfe619de98dac48dd8fd5d717ee3a11e866d057c7cfb8c40d0b1ec6383ad19d9f6f6d2cd20
|
7
|
+
data.tar.gz: 0e319461455ed3e5212dd1f67e76f94aff6c6a8292d4f3512d4d5a0be81d3b71aabe803b6444cc744f03f23814087b25816e433234c3551c150f3445387e21d0
|
@@ -0,0 +1,62 @@
|
|
1
|
+
module Addressable
|
2
|
+
class Template
|
3
|
+
attr_reader pattern: String
|
4
|
+
|
5
|
+
def initialize: (String pattern) -> void
|
6
|
+
def extract: (URI uri, ?untyped processor) -> Hash[String, String]
|
7
|
+
def partial_expand: (Hash[untyped, untyped] mapping, ?untyped processor, ?bool normalize_values) -> self
|
8
|
+
def expand: (Hash[untyped, untyped] mapping, ?untyped processor, ?bool normalize_values) -> URI
|
9
|
+
def variables: () -> Array[String]
|
10
|
+
alias keys variables
|
11
|
+
alias names variables
|
12
|
+
end
|
13
|
+
|
14
|
+
class URI
|
15
|
+
def self.parse: (String | URI uri) -> instance
|
16
|
+
|
17
|
+
attr_reader scheme: String
|
18
|
+
def scheme=: (String new_scheme) -> String
|
19
|
+
attr_reader user: String?
|
20
|
+
def user=: (String? new_user) -> String?
|
21
|
+
attr_reader password: String?
|
22
|
+
def password=: (String? new_password) -> String?
|
23
|
+
def userinfo: () -> String?
|
24
|
+
def userinfo=: (String? new_userinfo) -> String?
|
25
|
+
attr_reader host: String
|
26
|
+
def host=: (String new_host) -> String
|
27
|
+
def hostname: () -> String
|
28
|
+
def hostname=: (String new_hostname) -> String
|
29
|
+
def tld: () -> String
|
30
|
+
def tld=: (String new_tld) -> String
|
31
|
+
def domain: () -> String
|
32
|
+
def authority: () -> String
|
33
|
+
def authority=: (String new_authority) -> String
|
34
|
+
def omit: (*Symbol components) -> URI
|
35
|
+
def omit!: (*Symbol components) -> URI
|
36
|
+
def origin: () -> String
|
37
|
+
def origin=: (String new_origin) -> String
|
38
|
+
attr_reader port: Integer
|
39
|
+
def port=: (String | Integer? new_port) -> Integer
|
40
|
+
def inferred_port: () -> Integer
|
41
|
+
def default_port: () -> Integer
|
42
|
+
def site: () -> String
|
43
|
+
def site=: (String new_site) -> String
|
44
|
+
attr_reader path: String
|
45
|
+
def path=: (String new_path) -> String
|
46
|
+
def basename: () -> String
|
47
|
+
def extname: () -> String?
|
48
|
+
attr_reader query: String?
|
49
|
+
def query=: (String? new_query) -> String?
|
50
|
+
def query_values: (?singleton(Hash) return_type) -> Hash[String, String]?
|
51
|
+
| (singleton(Array) return_type) -> Array[String]
|
52
|
+
def query_values=: (Hash[String, String]? new_query_values) -> Hash[String, String]?
|
53
|
+
| (Array[String] new_query_values) -> Array[String]
|
54
|
+
| (Array[[String | Array[String]]] new_query_values) -> Array[[String | Array[String]]]
|
55
|
+
def request_uri: () -> String
|
56
|
+
def request_uri=: (String new_request_uri) -> String
|
57
|
+
def fragment: () -> String?
|
58
|
+
def fragment=: (String? new_fragment) -> String?
|
59
|
+
|
60
|
+
def normalize: () -> self
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,119 @@
|
|
1
|
+
module Async
|
2
|
+
class Barrier
|
3
|
+
def initialize: (?parent: (Task[untyped] | Semaphore)?) -> void
|
4
|
+
|
5
|
+
def size: () -> ::Integer
|
6
|
+
|
7
|
+
def async: (*untyped arguments, ?parent: (Task[untyped] | Semaphore)?, **untyped options) { (Task[untyped], *untyped) -> untyped } -> Task[untyped]
|
8
|
+
|
9
|
+
def empty?: () -> bool
|
10
|
+
|
11
|
+
def wait: () -> void
|
12
|
+
|
13
|
+
def stop: () -> void
|
14
|
+
end
|
15
|
+
|
16
|
+
class Clock
|
17
|
+
def self.now: () -> ::Numeric
|
18
|
+
|
19
|
+
def self.measure: () { () -> void } -> ::Numeric
|
20
|
+
|
21
|
+
def self.start: () -> Clock
|
22
|
+
|
23
|
+
def initialize: (?::Numeric total) -> void
|
24
|
+
|
25
|
+
def start!: () -> void
|
26
|
+
|
27
|
+
def stop!: () -> ::Numeric
|
28
|
+
|
29
|
+
def total: () -> ::Numeric
|
30
|
+
end
|
31
|
+
|
32
|
+
class Condition
|
33
|
+
def initialize: () -> void
|
34
|
+
|
35
|
+
def wait: () -> untyped
|
36
|
+
|
37
|
+
def empty?: () -> bool
|
38
|
+
|
39
|
+
def signal: (?untyped? value) -> void
|
40
|
+
end
|
41
|
+
|
42
|
+
class Node
|
43
|
+
end
|
44
|
+
|
45
|
+
class Notification < Condition
|
46
|
+
def signal: (?untyped? value, ?task: untyped) -> void
|
47
|
+
end
|
48
|
+
|
49
|
+
class Queue < Notification
|
50
|
+
end
|
51
|
+
|
52
|
+
class LimitedQueue < Queue
|
53
|
+
end
|
54
|
+
|
55
|
+
class Semaphore
|
56
|
+
def initialize: (?::Integer limit, ?parent: (Task[untyped] | Semaphore | Barrier)?) -> void
|
57
|
+
|
58
|
+
def limit=: (::Integer limit) -> void
|
59
|
+
|
60
|
+
def empty?: () -> bool
|
61
|
+
|
62
|
+
def blocking?: () -> bool
|
63
|
+
|
64
|
+
def async: (*untyped arguments, ?parent: (Task[untyped] | Semaphore | Barrier)?, **untyped options) { (Task[untyped], *untyped) -> untyped } -> Task[untyped]
|
65
|
+
|
66
|
+
def acquire: () ?{ () -> untyped } -> void
|
67
|
+
|
68
|
+
def release: () -> void
|
69
|
+
end
|
70
|
+
|
71
|
+
class TimeoutError < StandardError
|
72
|
+
end
|
73
|
+
|
74
|
+
class Task[Result] < Node
|
75
|
+
attr_reader result: Result
|
76
|
+
|
77
|
+
attr_reader status: (:initialized | :running | :failed | :stopped | :completed)
|
78
|
+
|
79
|
+
def initialize: (?Task[untyped] parent, ?finished: untyped?, **untyped options) { (*untyped) -> untyped } -> void
|
80
|
+
|
81
|
+
def yield: () -> untyped
|
82
|
+
|
83
|
+
def with_timeout: (::Numeric duration, ?singleton(StandardError) exception, ?::String message) { (*untyped) -> untyped } -> untyped
|
84
|
+
|
85
|
+
def alive?: () -> bool
|
86
|
+
|
87
|
+
def finished?: () -> bool
|
88
|
+
|
89
|
+
def running?: () -> bool
|
90
|
+
|
91
|
+
def stopped?: () -> bool
|
92
|
+
|
93
|
+
def completed?: () -> bool
|
94
|
+
|
95
|
+
def run: (*untyped arguments) -> void
|
96
|
+
|
97
|
+
def async: [NewResult] (*untyped arguments, **untyped options) { (Task[untyped], *untyped) -> NewResult } -> Task[NewResult]
|
98
|
+
|
99
|
+
def wait: () -> Result
|
100
|
+
|
101
|
+
def stop: (?bool later) -> untyped
|
102
|
+
|
103
|
+
def defer_stop: () { () -> untyped } -> void
|
104
|
+
|
105
|
+
def self.current: () -> Task[untyped]?
|
106
|
+
|
107
|
+
alias complete? completed?
|
108
|
+
|
109
|
+
# @deprecated
|
110
|
+
def self.yield: () -> untyped
|
111
|
+
|
112
|
+
# @deprecated
|
113
|
+
def sleep: (?untyped? duration) -> untyped
|
114
|
+
end
|
115
|
+
|
116
|
+
# @deprecated
|
117
|
+
class Wrapper
|
118
|
+
end
|
119
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# manifest.yaml describes dependencies which do not appear in the gemspec.
|
2
|
+
# If this gem includes such dependencies, comment-out the following lines and
|
3
|
+
# declare the dependencies.
|
4
|
+
# If all dependencies appear in the gemspec, you should remove this file.
|
5
|
+
#
|
6
|
+
# dependencies:
|
7
|
+
# - name: pathname
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module BCrypt
|
2
|
+
class Password < String
|
3
|
+
attr_reader checksum: String
|
4
|
+
attr_reader salt: String
|
5
|
+
attr_reader version: String
|
6
|
+
attr_reader cost: Integer
|
7
|
+
def self.create: (_ToS secret, {cost: _ToI} options) -> BCrypt::Password
|
8
|
+
def self.valid_hash?: (String h) -> bool
|
9
|
+
def initialize: (String raw_hash) -> void
|
10
|
+
def ==: (_ToS secret) -> bool
|
11
|
+
alias is_password? ==
|
12
|
+
end
|
13
|
+
|
14
|
+
class Engine
|
15
|
+
DEFAULT_COST: Integer
|
16
|
+
MIN_COST: Integer
|
17
|
+
MAX_COST: Integer
|
18
|
+
MAX_SECRET_BYTESIZE: Integer
|
19
|
+
MAX_SALT_LENGTH: Integer
|
20
|
+
|
21
|
+
def self.cost: () -> Integer
|
22
|
+
def self.cost=: (Integer cost) -> Integer
|
23
|
+
def self.hash_secret: (_ToS secret, String salt, ?untyped _) -> String
|
24
|
+
def self.generate_salt: (?_ToI cost) -> String
|
25
|
+
def self.valid_salt?: (String salt) -> bool
|
26
|
+
def self.valid_secret?: (Object secret) -> bool
|
27
|
+
def self.calibrate: (Numeric upper_time_limit_in_ms) -> Integer
|
28
|
+
def self.autodetect_cost: (String salt) -> Integer
|
29
|
+
end
|
30
|
+
|
31
|
+
class Error < StandardError
|
32
|
+
end
|
33
|
+
|
34
|
+
module Errors
|
35
|
+
class InvalidSalt < Error
|
36
|
+
end
|
37
|
+
|
38
|
+
class InvalidHash < Error
|
39
|
+
end
|
40
|
+
|
41
|
+
class InvalidCost < Error
|
42
|
+
end
|
43
|
+
|
44
|
+
class InvalidSecret < Error
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,119 @@
|
|
1
|
+
# <!-- rdoc-file=ext/bigdecimal/lib/bigdecimal/math.rb -->
|
2
|
+
# Provides mathematical functions.
|
3
|
+
#
|
4
|
+
# Example:
|
5
|
+
#
|
6
|
+
# require "bigdecimal/math"
|
7
|
+
#
|
8
|
+
# include BigMath
|
9
|
+
#
|
10
|
+
# a = BigDecimal((PI(100)/2).to_s)
|
11
|
+
# puts sin(a,100) # => 0.99999999999999999999......e0
|
12
|
+
#
|
13
|
+
module BigMath
|
14
|
+
# <!--
|
15
|
+
# rdoc-file=ext/bigdecimal/lib/bigdecimal/math.rb
|
16
|
+
# - E(numeric) -> BigDecimal
|
17
|
+
# -->
|
18
|
+
# Computes e (the base of natural logarithms) to the specified number of digits
|
19
|
+
# of precision, `numeric`.
|
20
|
+
#
|
21
|
+
# BigMath.E(10).to_s
|
22
|
+
# #=> "0.271828182845904523536028752390026306410273e1"
|
23
|
+
#
|
24
|
+
def self?.E: (Numeric prec) -> BigDecimal
|
25
|
+
|
26
|
+
# <!--
|
27
|
+
# rdoc-file=ext/bigdecimal/lib/bigdecimal/math.rb
|
28
|
+
# - PI(numeric) -> BigDecimal
|
29
|
+
# -->
|
30
|
+
# Computes the value of pi to the specified number of digits of precision,
|
31
|
+
# `numeric`.
|
32
|
+
#
|
33
|
+
# BigMath.PI(10).to_s
|
34
|
+
# #=> "0.3141592653589793238462643388813853786957412e1"
|
35
|
+
#
|
36
|
+
def self?.PI: (Numeric prec) -> BigDecimal
|
37
|
+
|
38
|
+
# <!--
|
39
|
+
# rdoc-file=ext/bigdecimal/lib/bigdecimal/math.rb
|
40
|
+
# - atan(decimal, numeric) -> BigDecimal
|
41
|
+
# -->
|
42
|
+
# Computes the arctangent of `decimal` to the specified number of digits of
|
43
|
+
# precision, `numeric`.
|
44
|
+
#
|
45
|
+
# If `decimal` is NaN, returns NaN.
|
46
|
+
#
|
47
|
+
# BigMath.atan(BigDecimal('-1'), 16).to_s
|
48
|
+
# #=> "-0.785398163397448309615660845819878471907514682065e0"
|
49
|
+
#
|
50
|
+
def self?.atan: (BigDecimal x, Numeric prec) -> BigDecimal
|
51
|
+
|
52
|
+
# <!--
|
53
|
+
# rdoc-file=ext/bigdecimal/lib/bigdecimal/math.rb
|
54
|
+
# - cos(decimal, numeric) -> BigDecimal
|
55
|
+
# -->
|
56
|
+
# Computes the cosine of `decimal` to the specified number of digits of
|
57
|
+
# precision, `numeric`.
|
58
|
+
#
|
59
|
+
# If `decimal` is Infinity or NaN, returns NaN.
|
60
|
+
#
|
61
|
+
# BigMath.cos(BigMath.PI(4), 16).to_s
|
62
|
+
# #=> "-0.999999999999999999999999999999856613163740061349e0"
|
63
|
+
#
|
64
|
+
def self?.cos: (BigDecimal x, Numeric prec) -> BigDecimal
|
65
|
+
|
66
|
+
# <!--
|
67
|
+
# rdoc-file=ext/bigdecimal/bigdecimal.c
|
68
|
+
# - BigMath.exp(decimal, numeric) -> BigDecimal
|
69
|
+
# -->
|
70
|
+
# Computes the value of e (the base of natural logarithms) raised to the power
|
71
|
+
# of `decimal`, to the specified number of digits of precision.
|
72
|
+
#
|
73
|
+
# If `decimal` is infinity, returns Infinity.
|
74
|
+
#
|
75
|
+
# If `decimal` is NaN, returns NaN.
|
76
|
+
#
|
77
|
+
def self?.exp: (BigDecimal, Numeric prec) -> BigDecimal
|
78
|
+
|
79
|
+
# <!--
|
80
|
+
# rdoc-file=ext/bigdecimal/bigdecimal.c
|
81
|
+
# - BigMath.log(decimal, numeric) -> BigDecimal
|
82
|
+
# -->
|
83
|
+
# Computes the natural logarithm of `decimal` to the specified number of digits
|
84
|
+
# of precision, `numeric`.
|
85
|
+
#
|
86
|
+
# If `decimal` is zero or negative, raises Math::DomainError.
|
87
|
+
#
|
88
|
+
# If `decimal` is positive infinity, returns Infinity.
|
89
|
+
#
|
90
|
+
# If `decimal` is NaN, returns NaN.
|
91
|
+
#
|
92
|
+
def self?.log: (BigDecimal, Numeric prec) -> BigDecimal
|
93
|
+
|
94
|
+
# <!--
|
95
|
+
# rdoc-file=ext/bigdecimal/lib/bigdecimal/math.rb
|
96
|
+
# - sin(decimal, numeric) -> BigDecimal
|
97
|
+
# -->
|
98
|
+
# Computes the sine of `decimal` to the specified number of digits of precision,
|
99
|
+
# `numeric`.
|
100
|
+
#
|
101
|
+
# If `decimal` is Infinity or NaN, returns NaN.
|
102
|
+
#
|
103
|
+
# BigMath.sin(BigMath.PI(5)/4, 5).to_s
|
104
|
+
# #=> "0.70710678118654752440082036563292800375e0"
|
105
|
+
#
|
106
|
+
def self?.sin: (BigDecimal x, Numeric prec) -> BigDecimal
|
107
|
+
|
108
|
+
# <!--
|
109
|
+
# rdoc-file=ext/bigdecimal/lib/bigdecimal/math.rb
|
110
|
+
# - sqrt(decimal, numeric) -> BigDecimal
|
111
|
+
# -->
|
112
|
+
# Computes the square root of `decimal` to the specified number of digits of
|
113
|
+
# precision, `numeric`.
|
114
|
+
#
|
115
|
+
# BigMath.sqrt(BigDecimal('2'), 16).to_s
|
116
|
+
# #=> "0.1414213562373095048801688724e1"
|
117
|
+
#
|
118
|
+
def self?.sqrt: (BigDecimal x, Numeric prec) -> BigDecimal
|
119
|
+
end
|