helpema 1.0.0 → 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
- SHA1:
3
- metadata.gz: f825bd3e6b6e1b825a3a998e4571af1f0186a620
4
- data.tar.gz: fc0978830f198cb1dc2876fc972d0ae7b3d04ba0
2
+ SHA256:
3
+ metadata.gz: 295a6ea0d195e0b52b4f0960d946e87975cbf73059c93e08c54b2aa797e4e17c
4
+ data.tar.gz: 65ee413650aaff19864215e8fe95f29f5aa0e898510b13ee436d737aacd535c1
5
5
  SHA512:
6
- metadata.gz: bdd8e438e980c9cb5189eb2490f72eff2033e120c0c653d5002b98afb720ef93b35c0515852b9cdaf0a495d5f0598288a6781ccbbb350bb42d720f58f96c7d39
7
- data.tar.gz: 2bfd8fae64732d33d251fdb752c67f9d201e09280394c8ac713f3ee470ddef9b95f1ad0731b534f31039fca30f0a0dbd680c93e642f5a39881b7868ec7d9dcc0
6
+ metadata.gz: adbb195324d7f68fd7bb7033cbef3f9a925c7fe9866c834862779fdb9e306b4ecb4967aa2ad31cacad639b45a6555203c9bae7a049dadf552231b39efd43fdc1
7
+ data.tar.gz: 43d34fde681cdcbe0a2dbf4927402fd92c63eaae10d69a40894610fcea3b20c28622790829f585f22bbf9349206c62be4e344deb62bd76c72436cb55fe97759e
data/README.md ADDED
@@ -0,0 +1,132 @@
1
+ # Helpema
2
+
3
+ * [VERSION 3.0.210706](https://github.com/carlosjhr64/helpema/releases)
4
+ * [github](https://github.com/carlosjhr64/helpema)
5
+ * [rubygems](https://rubygems.org/gems/helpema)
6
+
7
+ ## DESCRIPTION:
8
+
9
+ Meant to be an eclectic collection of useful single functions and wrappers.
10
+
11
+ Featured method: `requires "good ~>3.0", "bad ~>2.7", "ugly ~>1.8"`
12
+
13
+ ## INSTALL:
14
+
15
+ ```shell
16
+ $ gem install helpema
17
+ ```
18
+
19
+ ## SYNOPSIS:
20
+
21
+ ```ruby
22
+ require 'helpema'
23
+ include Helpema
24
+ using Helpema
25
+
26
+ ### requires ###
27
+ # Ensure ruby's and helpema's version.
28
+ # Returns the list of loaded gems.
29
+ # For those quick little scripts one writes in one's bin
30
+ # that annoyingly keep falling out of maintainance... right?
31
+ requires'
32
+ ruby ~>3.0
33
+ helpema ~>3.0
34
+ base_convert ~>4.0
35
+ entropia ~>0.1'
36
+ #=> ["base_convert", "entropia"]
37
+
38
+ ### String#satisfies? ###
39
+ # Uses Gem::Requirement and Gem::Version to check version strings.
40
+ '1.2.3'.satisfies? '~>1.1' #=> true
41
+ '1.2.3'.satisfies? '~>1.3' #=> false
42
+
43
+ ### run_command ###
44
+ # Automates pipe creation to a system command.
45
+ # See the code for all available features.
46
+ run_command('date',{d: 'Dec 31, 2020'}) #=> "Thu Dec 31 12:00:00 AM PST 2020\n"
47
+
48
+ ### define_command ###
49
+ # Creates a method out of a system command.
50
+ # See the code for all available features.
51
+ define_command(:date, cmd: 'date', usage: {d: nil}, synonyms: {string: :d})
52
+ date(string: 'Dec 31, 2020') #=> "Thu Dec 31 12:00:00 AM PST 2020\n"
53
+
54
+ ### to_arg ###
55
+ # A helper function to do system command calls.
56
+ to_arg :q, true #=> "-q"
57
+ to_arg :quiet, true #=> "--quiet"
58
+ to_arg :verbose, false #=> nil
59
+ to_arg :f, '/path-to/file' #=> ["-f", "/path-to/file"]
60
+ to_arg :geo=, '10x20' #=> "--geo=10x20"
61
+ to_arg :arg0, 'Hello World' #=> "Hello World"
62
+
63
+ ### Hash#to_args ###
64
+ {q: true, quiet: true, verbose: false, f: '/path-to/file', :geo= => '10x20', arg0: 'Hello World'}.to_args
65
+ #=> ["-q", "--quiet", "-f", "/path-to/file", "--geo=10x20", "Hello World"]
66
+
67
+ ### Array#classify ###
68
+ # Groups items in Array by class.
69
+ [1, 2.0, :Three, 'Four', /Five/, :Six, 'Seven'].classify
70
+ #=> {Integer=>[1], Float=>[2.0], Symbol=>[:Three, :Six], String=>["Four", "Seven"], Regexp=>[/Five/]}
71
+
72
+ ### SSSS.split ####
73
+ SSSS.split(secret: "Top Secret!", threshold: 2, shares: 3)
74
+ #~> ^\["1-\h+", "2-\h+", "3-\h+"\]$
75
+ # Note that the split has random outputs on the same inputs.
76
+
77
+ #### SSSS.combine ###
78
+ # Pregenerated splits combine to reproduce the secret.
79
+ SSSS.combine(secrets: ["3-055562917c41e68c6ab2c8", "1-27bf3cbfe8d2c25c7e8928"], threshold: 2)
80
+ #=> "Top Secret!"
81
+
82
+ ### YouTubeDL.json ###
83
+ list = []
84
+ url = 'https://www.youtube.com/watch?v=u4oK3ZSccZI'
85
+ YouTubeDL.json(url){|json| list.push json}
86
+ # The url was for just one video
87
+ list.length #=> 1
88
+ json = list[0]
89
+ json['title'] #=> "Fortnite Easy Last Ten"
90
+
91
+ ### ZBar.screen ###
92
+ # Reads qrcodes on screen.
93
+ string_or_nil = ZBar.screen
94
+
95
+ ### ZBar.cam ###
96
+ # Reads qrcodes from camera.
97
+ # You may want to wrap this one in a Timeout block.
98
+ string = ZBar.cam
99
+ ```
100
+
101
+ ## TROUBLESHOOTING:
102
+
103
+ Command version mismatch
104
+ : set `Helpema::WRAPPER.version = "your.version"` or just nil it.
105
+
106
+ More documentation
107
+ : see [sig/helpema.rb](sig/helpema.rbs) for the expected method signatures.
108
+
109
+ ## LICENSE:
110
+
111
+ (The MIT License)
112
+
113
+ Copyright (c) 2021 carlosjhr64
114
+
115
+ Permission is hereby granted, free of charge, to any person obtaining
116
+ a copy of this software and associated documentation files (the
117
+ 'Software'), to deal in the Software without restriction, including
118
+ without limitation the rights to use, copy, modify, merge, publish,
119
+ distribute, sublicense, and/or sell copies of the Software, and to
120
+ permit persons to whom the Software is furnished to do so, subject to
121
+ the following conditions:
122
+
123
+ The above copyright notice and this permission notice shall be
124
+ included in all copies or substantial portions of the Software.
125
+
126
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
127
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
128
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
129
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
130
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
131
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
132
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/lib/helpema.rb CHANGED
@@ -1,15 +1,18 @@
1
1
  module Helpema
2
- VERSION = '1.0.0'
3
- end
2
+ VERSION = '3.0.210706'
3
+
4
+ require_relative 'helpema/helpema'
4
5
 
5
- # This Gem
6
- require 'helpema/ssss.rb'
7
- require 'helpema/zbar.rb'
8
- require 'helpema/youtubedl.rb'
6
+ autoload :SSSS, 'helpema/ssss.rb'
7
+ autoload :YouTubeDL, 'helpema/youtubedl.rb'
8
+ autoload :ZBar, 'helpema/zbar.rb'
9
+ end
9
10
 
10
11
  # Requires:
11
12
  #`ruby`
13
+ #`youtube-dl`
12
14
  #`ssss-split`
13
15
  #`ssss-combine`
14
16
  #`zbarcam`
17
+ #`zbarimg`
15
18
  #`gnome-screenshot`
@@ -0,0 +1,112 @@
1
+ module Helpema
2
+ refine ::String do
3
+ def satisfies?(*reqs)
4
+ Gem::Requirement.new(*reqs).satisfied_by? Gem::Version.new(self)
5
+ end
6
+ end
7
+ refine ::Hash do
8
+ def to_args(usage:nil, synonyms:nil)
9
+ # create separate args from self with the translated synonyms
10
+ args = self.transform_keys(synonyms.to_h)
11
+ # pad usage's defaults to args
12
+ usage&.each{|key,default| args[key]=default unless args.has_key? key}
13
+ # order might be important so enforce usage
14
+ args = usage&.map{|k,v|[k,args[k]]} || args.to_a
15
+ # convert key,value tuples to final list of args
16
+ args.map!(&:to_arg)
17
+ # get rid of nil
18
+ args.select!{_1}
19
+ # ...and finally flatten!
20
+ args.flatten!
21
+ return args
22
+ end
23
+ end
24
+ refine ::Array do
25
+ def classify(hash: Hash.new{|h,k|h[k]=[]})
26
+ self.each{|v| hash[v.class] << v}
27
+ return hash
28
+ end
29
+ def to_arg
30
+ Helpema.to_arg(*self)
31
+ end
32
+ end
33
+ refine ::Symbol do
34
+ def to_flag
35
+ return nil if self[-1].match?(/\d/) # like :arg0
36
+ (self.length > 1)? "--#{self}": "-#{self}" # like --verbose or -V
37
+ end
38
+ end
39
+ using Helpema
40
+
41
+ def to_arg(key,value)
42
+ # keep only keys with value(no false or nil)
43
+ return nil unless value
44
+ # assume nil0/--long/-short
45
+ key = key.to_flag
46
+ if key
47
+ return key if value==true # a flag
48
+ return "#{key}#{value}" if key[-1]=='=' # joined key=value
49
+ return [key,value.to_s]
50
+ end
51
+ # It's a Nth arg, like arg0...
52
+ return value.to_s
53
+ end
54
+
55
+ def run_command(cmd, options={},
56
+ usage:nil, synonyms:nil, mode:'r',
57
+ exception:nil, forward_pass:nil, **popt, &blk)
58
+ args,ret = options.to_args(usage:usage,synonyms:synonyms),nil
59
+ $stderr.puts "#{cmd} #{args.join(' ')}" if $DEBUG
60
+ IO.popen([cmd, *args], mode, **popt) do |pipe|
61
+ ret = (forward_pass)? forward_pass.call(pipe, options, blk): (blk)? blk.call(pipe): pipe.read
62
+ end
63
+ (exception.nil? or $?.exitstatus==0)? ret : raise(exception)
64
+ end
65
+
66
+ def define_command(name,
67
+ cmd: name.to_s, version: nil, v: nil,
68
+ usage: nil, synonyms: nil,
69
+ mode: 'r',exception: nil,
70
+ **popt, &forward_pass)
71
+
72
+ # which version? --version or -v
73
+ if version and not `#{cmd} --version`.strip.match?(version)
74
+ raise "`#{cmd} --version` !~ #{version}"
75
+ end
76
+ if v and not `#{cmd} -v`.strip.match?(v)
77
+ raise "`#{cmd} -v` !~ #{v}"
78
+ end
79
+
80
+ define_method(name) do |**options, &blk|
81
+ run_command(cmd, options,
82
+ usage:usage, synonyms:synonyms, mode:mode,
83
+ exception:exception, forward_pass:forward_pass, **popt, &blk)
84
+ end
85
+ end
86
+
87
+ def requires(*list)
88
+ loaded = []
89
+ list.each do |gems|
90
+ gems.lines.each do |gemname_reqs|
91
+ gemname, *reqs = gemname_reqs.split
92
+ next unless gemname
93
+ unless reqs.empty?
94
+ case gemname
95
+ when 'helpema'
96
+ raise "helpema #{VERSION} not #{reqs.join(', ')}" unless VERSION.satisfies?(*reqs)
97
+ next
98
+ when 'ruby'
99
+ raise "ruby #{RUBY_VERSION} not #{reqs.join(', ')}" unless RUBY_VERSION.satisfies?(*reqs)
100
+ next
101
+ else
102
+ gem gemname, *reqs
103
+ end
104
+ end
105
+ require gemname and loaded.push gemname
106
+ end
107
+ end
108
+ return loaded
109
+ end
110
+
111
+ extend self
112
+ end
data/lib/helpema/ssss.rb CHANGED
@@ -1,27 +1,37 @@
1
- require 'open3'
2
-
3
1
  module Helpema
4
- module SSSS
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
5
6
 
6
- def self.split(pwd, t, n)
7
- pwds = nil
8
- Open3.popen3("ssss-split -Q -t #{t} -n #{n}") do |stdin, stdout, stderr|
9
- stdin.puts pwd
10
- stdin.close
11
- pwds = stdout.read.strip.split
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])
12
16
  end
13
- return pwds
14
- 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)
15
19
 
16
- def self.combine(*pwds)
17
- pwd = ''
18
- Open3.popen3("ssss-combine -Q -t #{pwds.length}") do |stdin, stdout, stderr|
19
- pwds.each{|p| stdin.puts p}
20
- stdin.close
21
- pwd = stderr.read.strip.split.last
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)
22
33
  end
23
- return pwd
24
- end
25
34
 
26
- end
35
+ extend self
36
+ end
27
37
  end
@@ -1,22 +1,26 @@
1
1
  require 'json'
2
- require 'open3'
3
2
 
4
3
  module Helpema
5
- module YouTubeDL
4
+ module YouTubeDL
5
+ extend Helpema
6
+ class << self; attr_accessor :version; end
7
+ YouTubeDL.version = '^202\d\.[01]\d\.[0123]\d$'
6
8
 
7
- def self.json(url, pwd=nil)
8
- Open3.popen2e("youtube-dl -j '#{url}'") do |i, o|
9
- i.puts pwd if pwd
10
- i.close
11
- o.each do |line|
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|
12
15
  begin
13
- yield JSON.parse line
14
- rescue JSON::ParserError
15
- yield line
16
+ data = JSON.parse data
17
+ ensure
18
+ blk.call data
16
19
  end
17
20
  end
18
21
  end
19
- end
22
+ def json(url, &blk) = YouTubeDL._json(url:url, &blk)
20
23
 
21
- end
24
+ extend self
25
+ end
22
26
  end
data/lib/helpema/zbar.rb CHANGED
@@ -1,43 +1,46 @@
1
- require 'timeout'
2
1
  require 'tmpdir'
3
2
 
4
3
  module Helpema
5
- module ZBar
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']
6
9
 
7
- def self.cam(timeout=3)
8
- raw = ''
9
- IO.popen('zbarcam --nodisplay --raw --prescale=800x800', 'r') do |io|
10
+ def snapshot(filename)
11
+ system(*ZBar.screenshot, filename)
12
+ end
13
+
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|
10
20
  begin
11
- Timeout.timeout(timeout) do
12
- raw << io.gets
13
- while q = io.gets
14
- break if q=="\n"
15
- raw << q
16
- end
17
- raw.strip!
18
- end
19
- rescue Timeout::Error
20
- raw = nil
21
- $stderr.puts $!
21
+ pipe.gets.chomp # This is the return value!
22
22
  ensure
23
- Process.kill('INT', io.pid)
23
+ Process.kill('TERM', pipe.pid)
24
24
  end
25
25
  end
26
- raw
27
- 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)
28
34
 
29
- def self.screen
30
- tmpdir = Dir.tmpdir()
31
- screenshot = File.join(tmpdir, "#{$$}.#{Time.now.to_f}.png")
32
- raw = nil
33
- begin
34
- system "gnome-screenshot -f #{screenshot}"
35
- raw = `zbarimg -q --raw #{screenshot}`.strip
36
- ensure
37
- File.unlink screenshot if File.exist? screenshot
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
38
42
  end
39
- raw
40
- end
41
43
 
42
- end
44
+ extend self
45
+ end
43
46
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: helpema
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 3.0.210706
5
5
  platform: ruby
6
6
  authors:
7
7
  - carlosjhr64
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-21 00:00:00.000000000 Z
11
+ date: 2021-07-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
- Some wrappers on the following linux commands: ssss-split, ssss-combine, zbarcam, youtube-dl -j.
14
+ Meant to be an eclectic collection of useful single functions and wrappers.
15
15
 
16
- More later.
16
+ Featured method: `requires "good ~>3.0", "bad ~>2.7", "ugly ~>1.8"`
17
17
  email: carlosjhr64@gmail.com
18
18
  executables: []
19
19
  extensions: []
20
- extra_rdoc_files:
21
- - README.rdoc
20
+ extra_rdoc_files: []
22
21
  files:
23
- - README.rdoc
22
+ - README.md
24
23
  - lib/helpema.rb
24
+ - lib/helpema/helpema.rb
25
25
  - lib/helpema/ssss.rb
26
26
  - lib/helpema/youtubedl.rb
27
27
  - lib/helpema/zbar.rb
@@ -29,10 +29,8 @@ homepage: https://github.com/carlosjhr64/helpema
29
29
  licenses:
30
30
  - MIT
31
31
  metadata: {}
32
- post_install_message:
33
- rdoc_options:
34
- - "--main"
35
- - README.rdoc
32
+ post_install_message:
33
+ rdoc_options: []
36
34
  require_paths:
37
35
  - lib
38
36
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -46,15 +44,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
46
44
  - !ruby/object:Gem::Version
47
45
  version: '0'
48
46
  requirements:
49
- - 'ruby: ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]'
47
+ - 'ruby: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-linux]'
48
+ - 'youtube-dl: 2021.06.06'
50
49
  - 'ssss-split: 0.5'
51
50
  - 'ssss-combine: 0.5'
52
- - 'zbarcam: 0.20'
53
- - 'gnome-screenshot: gnome-screenshot 3.22.0'
54
- rubyforge_project:
55
- rubygems_version: 2.6.13
56
- signing_key:
51
+ - 'zbarcam: 0.23'
52
+ - 'zbarimg: 0.23'
53
+ - 'gnome-screenshot: gnome-screenshot 40.0'
54
+ rubygems_version: 3.2.15
55
+ signing_key:
57
56
  specification_version: 4
58
- summary: 'Some wrappers on the following linux commands: ssss-split, ssss-combine,
59
- zbarcam, youtube-dl -j.'
57
+ summary: Meant to be an eclectic collection of useful single functions and wrappers.
60
58
  test_files: []
data/README.rdoc DELETED
@@ -1,54 +0,0 @@
1
- = helpema
2
-
3
- {<img src="https://badge.fury.io/rb/helpema.svg" alt="Gem Version" />}[http://badge.fury.io/rb/helpema]
4
-
5
- == DESCRIPTION:
6
-
7
- Some wrappers on the following linux commands: ssss-split, ssss-combine, zbarcam, youtube-dl -j.
8
-
9
- More later.
10
-
11
- == SYNOPSIS:
12
-
13
- === Helpema::SSSS.split( secret, threshold, shares)
14
-
15
- === Helpema::SSSS.combine( *shared_secrets )
16
-
17
- === Helpema::ZBar.cam( timeout=3 )
18
-
19
- Reads qrcodes on camera.
20
-
21
- === Helpema::ZBar.screen
22
-
23
- Reads qrcodes on screen.
24
-
25
- === Helpema::YouTubeDL.json( url ){|obj| ... }
26
-
27
- == INSTALL:
28
-
29
- $ sudo gem install helpema
30
-
31
- == LICENSE:
32
-
33
- (The MIT License)
34
-
35
- Copyright (c) 2017 carlosjhr64
36
-
37
- Permission is hereby granted, free of charge, to any person obtaining
38
- a copy of this software and associated documentation files (the
39
- 'Software'), to deal in the Software without restriction, including
40
- without limitation the rights to use, copy, modify, merge, publish,
41
- distribute, sublicense, and/or sell copies of the Software, and to
42
- permit persons to whom the Software is furnished to do so, subject to
43
- the following conditions:
44
-
45
- The above copyright notice and this permission notice shall be
46
- included in all copies or substantial portions of the Software.
47
-
48
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
49
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
50
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
51
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
52
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
53
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
54
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.