helpema 2.0.200124 → 2.1.200129

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99e52f3d2144ddf05fe8d83ef1a3929a62c43bd68fb8c7db11d360dd2288fe5a
4
- data.tar.gz: 636874ab3c6c109751825ec67fd08ae8aff7a18e7adf37b134f4c9ede3c6cc5f
3
+ metadata.gz: d18fa86fd912cfcc45ebb9efbdae0f9ae2a207399660fca0b3f0e3ce3b2bad64
4
+ data.tar.gz: c18e1447a10e90e878644d982e1578965309264eae84c7badc3676c31e1c018b
5
5
  SHA512:
6
- metadata.gz: 2a22a1de5d55755b4b8481f73d9710cf8472c1e8ad5bcd73418147014432641b8d632085efeaf52d9758e536dce79b2d3b295f686ac172c525ea1fca59c3c9c1
7
- data.tar.gz: a5e908afbed85d4812f2b9284d3535334c07ccdaf4c78799a0d32c103bac33ec99edb4b36e2f72321aa9c9bd7f37725b4b88a23b051051b88419c54304c49d83
6
+ metadata.gz: e7b98dfb0588da2070870131947cff69d9777d586fe72a7d513e3156c3f78b405e9d513d195ae18a952d099894965c44d0ba06fddd605825c6f06fe86297f604
7
+ data.tar.gz: f9cedadc0afe83aa718c637fe017555f50931023343ebc24519742b8cc17f89fe87367f4de4eafbfdcf30305b66ce4e0d23c8355ad344e62efa89e3827d42239
data/README.md CHANGED
@@ -1,14 +1,24 @@
1
1
  # helpema
2
2
 
3
- * [VERSION 2.0.200124](https://github.com/carlosjhr64/helpema/releases)
3
+ * [VERSION 2.1.200129](https://github.com/carlosjhr64/helpema/releases)
4
4
  * [github](https://github/carlosjhr64/helpema)
5
5
  * [rubygems](https://rubygems/gems/helpema)
6
6
 
7
7
  ## DESCRIPTION:
8
8
 
9
9
  Meant to be an eclectic collection of useful single functions and wrappers.
10
- Wrappers: ssss-split, ssss-combine, zbarcam, youtube-dl -j.
11
- Funtions: requires("gemname version",...).
10
+
11
+ Wrappers:
12
+
13
+ * ssss-split
14
+ * ssss-combine
15
+ * zbarcam
16
+ * youtube-dl -j
17
+
18
+ Functions:
19
+
20
+ * requires("gemname version",...)
21
+ * params(arg,...){|h Hash[Class,Obj]|...}
12
22
 
13
23
  More later.
14
24
 
@@ -27,6 +37,22 @@ More later.
27
37
  # For those quick little scripts one writes in one's bin
28
38
  # that annoyingly keep falling out of maintainance... right?
29
39
 
40
+ s0 = s1 = i = f0 = f1 = r = nil
41
+ Helpema.params(1, 2.0, 3, "Five", /Six/, "Seven", /Eight/) do |params|
42
+ s0 = params[String][0]
43
+ s1 = params[String][1]
44
+ i = params[Integer][0]
45
+ f0 = params[Float][0]
46
+ f1 = params[Float][1]
47
+ r = params[Regexp][0]
48
+ end
49
+ s0 #=> "Five"
50
+ s1 #=> "Seven"
51
+ i #=> 1
52
+ f0 #=> 2.0
53
+ f1 #=> nil
54
+ r #=> /Six/
55
+
30
56
  SSSS.split("Top Secret!", threshold: 2, shares: 3)
31
57
  #~> ^\["1-\h+", "2-\h+", "3-\h+"\]$
32
58
  # Note that the split has random outputs on the same inputs.
@@ -1,5 +1,5 @@
1
1
  module HELPEMA
2
- VERSION = '2.0.200124'
2
+ VERSION = '2.1.200129'
3
3
 
4
4
  autoload :Helpema, 'helpema/helpema.rb'
5
5
  autoload :SSSS, 'helpema/ssss.rb'
@@ -11,6 +11,11 @@ module Helpema
11
11
  end
12
12
  loaded
13
13
  end
14
+
15
+ def params(*args)
16
+ yield args.inject(Hash.new{|h,k|h[k]=[]}){|h,v|h[v.class].push(v) && h}
17
+ end
18
+
14
19
  extend self
15
20
  end
16
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: helpema
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.200124
4
+ version: 2.1.200129
5
5
  platform: ruby
6
6
  authors:
7
7
  - carlosjhr64
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-24 00:00:00.000000000 Z
11
+ date: 2020-01-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Meant to be an eclectic collection of useful single functions and wrappers.