mayak 0.0.12 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e0f62a1884888e93ab1375ff4a8f240b53a7886228ff9bbd6750ccb7cc68705
4
- data.tar.gz: cd02858a1b245c5060f94923b1cf8bc4f490dc92768b388da369ce8ef38c4cc5
3
+ metadata.gz: 221a2d0600601424c1b7f01078c26369743c85a240df39ac5a8b28dd68b6618e
4
+ data.tar.gz: 3b1abd6a9ecb58ea5ea251c1e93ca1ae53186c3902bcd9ba94f24f997d46b531
5
5
  SHA512:
6
- metadata.gz: c4dc1ffc9f62a1958f7f50849298cb3e38992bb727b7015ab480248ed314beef0ad5d5480483219c9ee4298d95e51ad7f644bbe6b99fb32abb65792d9f79477c
7
- data.tar.gz: 65a3581b578d4192e21dda936d6b431b5d29d6b31941c98ed626223203a3d5781d3d497c2ab322c9b6653ad04120f9209d9e6503240e050740b2239a968988fe
6
+ metadata.gz: 1bdce4716909e84e70db5aec924f2c80fd86e82cfbd7502382e9ac3d6e48dbbae55d3d5afe449037f23865ec4a81bc3042369cecf5815ab1527ffc8a2dc348c5
7
+ data.tar.gz: 52008707af1699cf0cd7c35acf3feca9f3593577a7ad8a76e239e36310ae4f9e316a9b87f6bc9d0d7cd8b00a0324c26bd5344e4f3c54dded86af14e93bad2821
@@ -18,6 +18,20 @@ module Mayak
18
18
  @blk = T.let(blk, T.proc.params(input: Input).returns(Output))
19
19
  end
20
20
 
21
+ sig {
22
+ type_parameters(
23
+ :Input,
24
+ :Output
25
+ ).params(
26
+ proc: T.proc.params(arg0: T.type_parameter(:Input)).returns(T.type_parameter(:Output))
27
+ ).returns(
28
+ ::Mayak::Function[T.type_parameter(:Input), T.type_parameter(:Output)]
29
+ )
30
+ }
31
+ def self.from_proc(proc)
32
+ ::Mayak::Function[T.type_parameter(:Input), T.type_parameter(:Output)].new { |input| proc.call(input) }
33
+ end
34
+
21
35
  sig { params(input: Input).returns(Output) }
22
36
  def call(input)
23
37
  blk.call(input)
data/lib/mayak.rb CHANGED
@@ -6,6 +6,8 @@ require 'sorbet-runtime'
6
6
  require_relative 'mayak/cache'
7
7
  require_relative 'mayak/function'
8
8
  require_relative 'mayak/failable_function'
9
+ require_relative 'mayak/optional_function'
10
+ require_relative 'mayak/validation_result'
9
11
  require_relative 'mayak/json'
10
12
  require_relative 'mayak/numeric'
11
13
  require_relative 'mayak/random'
data/mayak.gemspec CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "mayak"
7
- spec.version = "0.0.12"
7
+ spec.version = "0.0.14"
8
8
  spec.summary = "Set of fully typed utility classes and interfaces integrated with Sorbet."
9
9
  spec.description = spec.summary
10
10
  spec.authors = ["Daniil Bober"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mayak
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniil Bober