helpema 3.0.210108 → 3.0.210706

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: 0f73de852bf1c5e430ed5b5a0887e0b16ad37f3f4156843b40738065400b40e9
4
- data.tar.gz: 111bed98f5e6f8c7cba8c1f2353ea8a1d94e24ac84cda4351380d54283bc779a
3
+ metadata.gz: 295a6ea0d195e0b52b4f0960d946e87975cbf73059c93e08c54b2aa797e4e17c
4
+ data.tar.gz: 65ee413650aaff19864215e8fe95f29f5aa0e898510b13ee436d737aacd535c1
5
5
  SHA512:
6
- metadata.gz: 6b39435438e44edef870ed22e4b0a5acb6f2c2439cbe99906606fa62d6b224cbb1ce2fcc453f91c3b64bee6b70367d97605343c4a892db1e89eea0fac2a7fb39
7
- data.tar.gz: 567e0d4eb2be6863b3f6fb9d183b77b3c549755dee855a629e282f544514dcf51b00cbc4ba9a4a5fdedb67e113ef963efd6a406a06c978182ea03f2cbaa7ee91
6
+ metadata.gz: adbb195324d7f68fd7bb7033cbef3f9a925c7fe9866c834862779fdb9e306b4ecb4967aa2ad31cacad639b45a6555203c9bae7a049dadf552231b39efd43fdc1
7
+ data.tar.gz: 43d34fde681cdcbe0a2dbf4927402fd92c63eaae10d69a40894610fcea3b20c28622790829f585f22bbf9349206c62be4e344deb62bd76c72436cb55fe97759e
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Helpema
2
2
 
3
- * [VERSION 3.0.210108](https://github.com/carlosjhr64/helpema/releases)
3
+ * [VERSION 3.0.210706](https://github.com/carlosjhr64/helpema/releases)
4
4
  * [github](https://github.com/carlosjhr64/helpema)
5
5
  * [rubygems](https://rubygems.org/gems/helpema)
6
6
 
data/lib/helpema.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Helpema
2
- VERSION = '3.0.210108'
2
+ VERSION = '3.0.210706'
3
3
 
4
4
  require_relative 'helpema/helpema'
5
5
 
data/lib/helpema/ssss.rb CHANGED
@@ -1,36 +1,37 @@
1
1
  module Helpema
2
- module SSSS
3
- class << self
4
- attr_accessor :version
5
- SSSS.version = 'Version: 0\.[567]\b' # version as of this writing is 0.5
2
+ module SSSS
3
+ extend Helpema
4
+ class << self; attr_accessor :version; end
5
+ SSSS.version = 'Version: 0\.[567]\b' # version as of this writing is 0.5
6
6
 
7
- def split(secret:, threshold:, shares:, token:nil, level:nil, hexmode:false) =
8
- _split(secret:secret, threshold:threshold, shares:shares, token:token, level:level, hexmode:hexmode)
9
- define_command(:_split,
10
- cmd: 'ssss-split', v: SSSS.version,
11
- usage: {Q:true,t:2,n:3,w:nil,s:nil,x:false},
12
- synonyms: {threshold: :t, shares: :n, token: :w, level: :s, hexmode: :x},
13
- mode: 'w+', exception: 'ssss-split failed.',
14
- err: [:child, :out]
15
- ) do |pipe, options, blk|
16
- pipe.puts options.fetch(:secret)
17
- pipe.read.split.last(options[:shares])
18
- end
7
+ SSSS.define_command(:_split,
8
+ cmd: 'ssss-split', v: SSSS.version,
9
+ usage: {Q:true,t:2,n:3,w:nil,s:nil,x:false},
10
+ synonyms: {threshold: :t, shares: :n, token: :w, level: :s, hexmode: :x},
11
+ mode: 'w+', exception: 'ssss-split failed.',
12
+ err: [:child, :out]
13
+ ) do |pipe, options, blk|
14
+ pipe.puts options.fetch(:secret)
15
+ pipe.read.split.last(options[:shares])
16
+ end
17
+ def split(secret:, threshold:, shares:, token:nil, level:nil, hexmode:false) =
18
+ SSSS._split(secret:secret, threshold:threshold, shares:shares, token:token, level:level, hexmode:hexmode)
19
19
 
20
- def combine(secrets:, threshold:, hexmode:false)
21
- raise 'Need threshold number of secrets.' unless secrets.size >= threshold
22
- _combine(secrets:secrets, threshold:threshold, hexmode:hexmode)
23
- end
24
- define_command(:_combine,
25
- cmd: 'ssss-combine', v: SSSS.version,
26
- usage: {Q:true,t:2,x:false}, synonyms: {threshold: :t, hexmode: :x},
27
- mode: 'w+', exception: 'ssss-combine failed.',
28
- err: [:child, :out]
29
- ) do |pipe, options, blk|
30
- secrets,n = options.fetch_values(:secrets,:threshold)
31
- secrets.first(n).each{pipe.puts _1}
32
- pipe.read.lines.last.chomp
20
+ SSSS.define_command(:_combine,
21
+ cmd: 'ssss-combine', v: SSSS.version,
22
+ usage: {Q:true,t:2,x:false}, synonyms: {threshold: :t, hexmode: :x},
23
+ mode: 'w+', exception: 'ssss-combine failed.',
24
+ err: [:child, :out]
25
+ ) do |pipe, options, blk|
26
+ secrets,n = options.fetch_values(:secrets,:threshold)
27
+ secrets.first(n).each{pipe.puts _1}
28
+ pipe.read.lines.last.chomp
29
+ end
30
+ def combine(secrets:, threshold:, hexmode:false)
31
+ raise 'Need threshold number of secrets.' unless secrets.size >= threshold
32
+ SSSS._combine(secrets:secrets, threshold:threshold, hexmode:hexmode)
33
+ end
34
+
35
+ extend self
33
36
  end
34
37
  end
35
- end
36
- end
@@ -1,25 +1,26 @@
1
1
  require 'json'
2
2
 
3
3
  module Helpema
4
- module YouTubeDL
5
- class << self
6
- attr_accessor :version
7
- YouTubeDL.version = '^202\d\.[01]\d\.[0123]\d$'
4
+ module YouTubeDL
5
+ extend Helpema
6
+ class << self; attr_accessor :version; end
7
+ YouTubeDL.version = '^202\d\.[01]\d\.[0123]\d$'
8
8
 
9
- def json(url, &blk) = _json(url:url, &blk)
10
- define_command(:_json,
11
- cmd: 'youtube-dl', version: YouTubeDL.version,
12
- usage: {j:true, arg0:nil}, synonyms: {url: :arg0},
13
- err: '/dev/null'
14
- ) do |pipe, options, blk|
15
- pipe.each do |data|
16
- begin
17
- data = JSON.parse data
18
- ensure
19
- blk.call data
9
+ YouTubeDL.define_command(:_json,
10
+ cmd: 'youtube-dl', version: YouTubeDL.version,
11
+ usage: {j:true, arg0:nil}, synonyms: {url: :arg0},
12
+ err: '/dev/null'
13
+ ) do |pipe, options, blk|
14
+ pipe.each do |data|
15
+ begin
16
+ data = JSON.parse data
17
+ ensure
18
+ blk.call data
19
+ end
20
20
  end
21
21
  end
22
+ def json(url, &blk) = YouTubeDL._json(url:url, &blk)
23
+
24
+ extend self
22
25
  end
23
26
  end
24
- end
25
- end
data/lib/helpema/zbar.rb CHANGED
@@ -1,42 +1,46 @@
1
1
  require 'tmpdir'
2
2
 
3
3
  module Helpema
4
- module ZBar
5
- class << self
6
- attr_accessor :version, :screenshot
7
- ZBar.version = '^0\.2[345]\b' # version as of this writing is 0.23
8
- ZBar.screenshot = ['gnome-screenshot', '-f']
4
+ module ZBar
5
+ extend Helpema
6
+ class << self; attr_accessor :version, :screenshot; end
7
+ ZBar.version = '^0\.2[345]\b' # version as of this writing is 0.23
8
+ ZBar.screenshot = ['gnome-screenshot', '-f']
9
9
 
10
- def cam() = _cam()
11
- define_command(:_cam,
12
- cmd: 'zbarcam', version: ZBar.version,
13
- usage: {raw:true,quiet:true,nodisplay:true, :prescale= => '800x800'},
14
- synonyms: {prescale: :prescale=}
15
- ) do |pipe, kw, blk|
16
- begin
17
- pipe.gets.chomp # This is the return value!
18
- ensure
19
- Process.kill('TERM', pipe.pid)
10
+ def snapshot(filename)
11
+ system(*ZBar.screenshot, filename)
20
12
  end
21
- end
22
13
 
23
- def img(filename) = _img(filename:filename)
24
- define_command(:_img, cmd: 'zbarimg', version: ZBar.version,
25
- usage: {q:true,raw:true,arg0:nil}, synonyms: {filename: :arg0})
14
+ ZBar.define_command(:_cam,
15
+ cmd: 'zbarcam',
16
+ version: ZBar.version,
17
+ usage: {raw:true,quiet:true,nodisplay:true, :prescale= => '800x800'},
18
+ synonyms: {prescale: :prescale=}
19
+ ) do |pipe, kw, blk|
20
+ begin
21
+ pipe.gets.chomp # This is the return value!
22
+ ensure
23
+ Process.kill('TERM', pipe.pid)
24
+ end
25
+ end
26
+ def cam() = ZBar._cam()
27
+
28
+ ZBar.define_command(:_img,
29
+ cmd: 'zbarimg',
30
+ version: ZBar.version,
31
+ usage: {q:true,raw:true,arg0:nil},
32
+ synonyms: {filename: :arg0})
33
+ def img(filename) = ZBar._img(filename:filename)
26
34
 
27
- def screen
28
- raw = nil
29
- Dir.mktmpdir do |tmpdir|
30
- _ = File.join(tmpdir, "#{$$}.#{Time.now.to_f}.png")
31
- raw = _ if snapshot(_) and not (_=ZBar.img(_).chomp).empty?
35
+ def screen
36
+ raw = nil
37
+ Dir.mktmpdir do |tmpdir|
38
+ _ = File.join(tmpdir, "#{$$}.#{Time.now.to_f}.png")
39
+ raw = _ if ZBar.snapshot(_) and not (_=ZBar.img(_).chomp).empty?
40
+ end
41
+ raw
32
42
  end
33
- raw
34
- end
35
43
 
36
- private
37
- def snapshot(filename)
38
- system(*ZBar.screenshot, filename)
44
+ extend self
39
45
  end
40
46
  end
41
- end
42
- 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: 3.0.210108
4
+ version: 3.0.210706
5
5
  platform: ruby
6
6
  authors:
7
7
  - carlosjhr64
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-08 00:00:00.000000000 Z
11
+ date: 2021-07-06 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.
@@ -44,14 +44,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
46
  requirements:
47
- - 'ruby: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]'
48
- - 'youtube-dl: 2020.12.31'
47
+ - 'ruby: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-linux]'
48
+ - 'youtube-dl: 2021.06.06'
49
49
  - 'ssss-split: 0.5'
50
50
  - 'ssss-combine: 0.5'
51
51
  - 'zbarcam: 0.23'
52
52
  - 'zbarimg: 0.23'
53
- - 'gnome-screenshot: gnome-screenshot 3.38.0'
54
- rubygems_version: 3.2.3
53
+ - 'gnome-screenshot: gnome-screenshot 40.0'
54
+ rubygems_version: 3.2.15
55
55
  signing_key:
56
56
  specification_version: 4
57
57
  summary: Meant to be an eclectic collection of useful single functions and wrappers.