szczupac 0.1.0 → 0.3.0

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: d454bd0ac9716b5b3916394e48a0464128931bd4a0fd7fd2e6a12600dd76bfef
4
- data.tar.gz: ca780cbe6e44e6e445f5a3dace15869843250b262a8719b5e3b80b2b4680a6d3
3
+ metadata.gz: e2d747def49ff2b27088286fa6c5f388868b50bf5a91bc558ce6eabe606b70c1
4
+ data.tar.gz: 5aa49ae7455586547c1ad07d8fe16a0efe220b54187c99949c1aa9cddeaeb94b
5
5
  SHA512:
6
- metadata.gz: 249cec6e1117910ac22660d4e4dfb995b47be7f1b971c9ef396fd46f0c1282862222883f48ca378fbe238b935655d0ca99ce4d34860f6243c3dc962edc9a5efa
7
- data.tar.gz: ddc994f3f9c040664a16829df9153c2595b7cd451174c9077822eecba6400efb3429600602a68e8c411cba1d4cba6ebbc6448f6ab17600d33fd30b2897f852b7
6
+ metadata.gz: 8fe7a1cf269fb19966378ac0febab1322639fc0720d217ed6071378f9e7d0a3086ad51684b12734c8b864489fbe5129d38b8e55e86f9e78f50cbebeaeaa1d62e
7
+ data.tar.gz: 7e3a3f13966678dc9ed56f9282890036497d7b7ef8e977432eb7399044142df764c344eb26e5570e7d7118af88f63e8949952eb8b69aaebd5fea3809101caed6
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Szczupac
4
- VERSION = "0.1.0"
4
+ VERSION = "0.3.0"
5
5
  end
data/lib/szczupac.rb CHANGED
@@ -3,6 +3,8 @@
3
3
  require_relative "szczupac/version"
4
4
 
5
5
  module Szczupac
6
+ extend self
7
+
6
8
  def call(**named_lanes)
7
9
  named_lanes
8
10
  .flat_map do |name, values|
@@ -15,8 +17,9 @@ module Szczupac
15
17
  .map { |v| { name => v } }
16
18
  .product([first_from_rest])
17
19
  .map { |v| v.reduce(&:merge) }
20
+ .map { |v| v.sort_by { |k, _| named_lanes.keys.index(k) }.to_h }
18
21
  end
19
22
  .uniq
20
23
  end
21
- module_function :call
24
+ alias [] call
22
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: szczupac
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paweł Pacana