samovar 2.1.4 → 2.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: 84e0b4fe6de8c1a2bd058706adc48f8ce9f7cb2d8d220961e26afc51ed3207c7
4
- data.tar.gz: 53b58a8e45ee5af68a9584739abdbb2e50da992f9d0aee9647006c5c80f659c4
3
+ metadata.gz: 6e30e7064ff47b5ddb9d3461d291513e310fe7000d96abf00c473447d76c4f17
4
+ data.tar.gz: 3ec1e17b743863c3df573f959450922c9aec4fcedbf4fe8a690657effcc643f6
5
5
  SHA512:
6
- metadata.gz: 883d9e97d08d32477710ce72fcce2c1dcada4b7f8463fed0f0d89bc69dc23a147a8dc7d0133b134efc1f54182db8281f43732b0a5818141b5c46e9125e4986c5
7
- data.tar.gz: df4de4f25f77e14f1af6beb1a44bcf38b39f5566cfe4e990af295da82771a0f945b3f3daba67176bfbbba0ef4fc5b11aa8cf069bdceb94d48f643c3320e23bdc
6
+ metadata.gz: 16adeb378b0451726310d57f76b7223c37a51a43fbf21d1348c3d309b94ae1b99fb943736362c3c66f0b1c651630982f9a5eba5b32bfb8202c0704370e67a6cc
7
+ data.tar.gz: b9bbcfbdc77d330992c47eebfdb10c612d57f140ef0b6e8f97204e3d67d2ccf2f020313cdf54c816122cebb279c82a315db40820d60ef74f41de118c7f5d4873
checksums.yaml.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ vDu���W �$���b�l�� ���2c��Np\��;
2
+ �m�E>o*���hZ1:��wL^gÔ| e�9�!�a�@�����49g���+�{���1��0��"V s�!���?T���}�M��J�;�F����j`�(�#q%4O��ռ_��K����Y�`���x��F�]b��V%UQ:�D�ō8�=��=b>�]ٸ�������6��{tI���T�c�A�{��/�� &�$�x���c{?��ŶLc�<��=B8 �p2Q-��
@@ -1,22 +1,7 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2016-2023, by Samuel Williams.
20
5
 
21
6
  require_relative 'table'
22
7
  require_relative 'options'
@@ -61,6 +46,11 @@ module Samovar
61
46
  end
62
47
 
63
48
  def self.append(row)
49
+ if method_defined?(row.key, false)
50
+ warning "Method for key #{row.key} is already defined!", caller
51
+ # raise ArgumentError, "Method for key #{row.key} is already defined!"
52
+ end
53
+
64
54
  attr_accessor(row.key) if row.respond_to?(:key)
65
55
 
66
56
  self.table << row
@@ -108,13 +98,20 @@ module Samovar
108
98
  end
109
99
  end
110
100
 
111
- def initialize(input = nil, name: File.basename($0), parent: nil)
101
+ def initialize(input = nil, name: File.basename($0), parent: nil, output: nil)
112
102
  @name = name
113
103
  @parent = parent
104
+ @output = output
114
105
 
115
106
  parse(input) if input
116
107
  end
117
108
 
109
+ attr :output
110
+
111
+ def output
112
+ @output || $stdout
113
+ end
114
+
118
115
  def to_s
119
116
  self.class.name
120
117
  end
@@ -136,7 +133,7 @@ module Samovar
136
133
  end
137
134
  end
138
135
 
139
- def print_usage(output: $stderr, formatter: Output::UsageFormatter, &block)
136
+ def print_usage(output: self.output, formatter: Output::UsageFormatter, &block)
140
137
  rows = Output::Rows.new
141
138
 
142
139
  self.class.usage(rows, @name)
data/lib/samovar/error.rb CHANGED
@@ -1,22 +1,7 @@
1
- # Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2019-2023, by Samuel Williams.
20
5
 
21
6
  module Samovar
22
7
  class Error < StandardError
@@ -1,22 +1,7 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2017-2023, by Samuel Williams.
20
5
 
21
6
  module Samovar
22
7
  class Failure < RuntimeError
data/lib/samovar/flags.rb CHANGED
@@ -1,29 +1,14 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2016-2024, by Samuel Williams.
20
5
 
21
6
  module Samovar
22
7
  class Flags
23
8
  def initialize(text)
24
9
  @text = text
25
10
 
26
- @ordered = text.split(/\s+\|\s+/).map{|part| Flag.new(part)}
11
+ @ordered = text.split(/\s+\|\s+/).map{|part| Flag.parse(part)}
27
12
  end
28
13
 
29
14
  def each(&block)
@@ -36,7 +21,7 @@ module Samovar
36
21
 
37
22
  # Whether or not this flag should have a true/false value if not specified otherwise.
38
23
  def boolean?
39
- @ordered.count == 1 and @ordered.first.value.nil?
24
+ @ordered.count == 1 and @ordered.first.boolean?
40
25
  end
41
26
 
42
27
  def count
@@ -44,12 +29,13 @@ module Samovar
44
29
  end
45
30
 
46
31
  def to_s
47
- '[' + @ordered.join(' | ') + ']'
32
+ "[#{@ordered.join(' | ')}]"
48
33
  end
49
34
 
50
35
  def parse(input)
51
36
  @ordered.each do |flag|
52
- if result = flag.parse(input)
37
+ result = flag.parse(input)
38
+ if result != nil
53
39
  return result
54
40
  end
55
41
  end
@@ -59,45 +45,93 @@ module Samovar
59
45
  end
60
46
 
61
47
  class Flag
62
- def initialize(text)
63
- @text = text
64
-
48
+ def self.parse(text)
65
49
  if text =~ /(.*?)\s(\<.*?\>)/
66
- @prefix = $1
67
- @value = $2
50
+ ValueFlag.new(text, $1, $2)
51
+ elsif text =~ /--\[no\]-(.*?)$/
52
+ BooleanFlag.new(text, "--#{$1}")
68
53
  else
69
- @prefix = @text
70
- @value = nil
54
+ ValueFlag.new(text, text, nil)
71
55
  end
72
-
73
- *@alternatives, @prefix = @prefix.split('/')
56
+ end
57
+
58
+ def initialize(text, prefix, alternatives = nil)
59
+ @text = text
60
+ @prefix = prefix
61
+ @alternatives = alternatives
74
62
  end
75
63
 
76
64
  attr :text
77
65
  attr :prefix
78
66
  attr :alternatives
79
- attr :value
80
67
 
81
68
  def to_s
82
69
  @text
83
70
  end
84
71
 
85
- def prefix?(token)
86
- @prefix == token or @alternatives.include?(token)
87
- end
88
-
89
72
  def key
90
73
  @key ||= @prefix.sub(/^-*/, '').gsub('-', '_').to_sym
91
74
  end
92
75
 
76
+ def boolean?
77
+ false
78
+ end
79
+ end
80
+
81
+ class ValueFlag < Flag
82
+ def initialize(text, prefix, value)
83
+ super(text, prefix)
84
+
85
+ @value = value
86
+
87
+ *@alternatives, @prefix = @prefix.split('/')
88
+ end
89
+
90
+ attr :alternatives
91
+ attr :value
92
+
93
+ def boolean?
94
+ @value.nil?
95
+ end
96
+
97
+ def prefix?(token)
98
+ @prefix == token or @alternatives.include?(token)
99
+ end
100
+
93
101
  def parse(input)
94
102
  if prefix?(input.first)
95
103
  if @value
96
- input.shift(2).last
104
+ return input.shift(2).last
97
105
  else
98
- input.shift; key
106
+ input.shift
107
+ return key
99
108
  end
100
109
  end
101
110
  end
102
111
  end
112
+
113
+ class BooleanFlag < Flag
114
+ def initialize(text, prefix, value = nil)
115
+ super(text, prefix)
116
+
117
+ @value = value
118
+
119
+ @negated = @prefix.sub(/^--/, '--no-')
120
+ @alternatives = [@negated]
121
+ end
122
+
123
+ def prefix?(token)
124
+ @prefix == token or @negated == token
125
+ end
126
+
127
+ def parse(input)
128
+ if input.first == @prefix
129
+ input.shift
130
+ return true
131
+ elsif input.first == @negated
132
+ input.shift
133
+ return false
134
+ end
135
+ end
136
+ end
103
137
  end
data/lib/samovar/many.rb CHANGED
@@ -1,22 +1,7 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2016-2023, by Samuel Williams.
20
5
 
21
6
  module Samovar
22
7
  class Many
@@ -1,22 +1,7 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2016-2023, by Samuel Williams.
20
5
 
21
6
  module Samovar
22
7
  class Nested
data/lib/samovar/one.rb CHANGED
@@ -1,22 +1,7 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2016-2023, by Samuel Williams.
20
5
 
21
6
  module Samovar
22
7
  class One
@@ -1,22 +1,7 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2019-2024, by Samuel Williams.
20
5
 
21
6
  require_relative 'flags'
22
7
 
@@ -81,7 +66,8 @@ module Samovar
81
66
  end
82
67
 
83
68
  def parse(input, parent = nil, default = nil)
84
- if result = @flags.parse(input)
69
+ result = @flags.parse(input)
70
+ if result != nil
85
71
  @value.nil? ? coerce(result) : @value
86
72
  elsif default ||= @default
87
73
  return default
@@ -1,22 +1,7 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2016-2024, by Samuel Williams.
20
5
 
21
6
  require_relative 'option'
22
7
 
@@ -105,7 +90,9 @@ module Samovar
105
90
  values = (default || @defaults).dup
106
91
 
107
92
  while option = @keyed[input.first]
108
- if result = option.parse(input)
93
+ prefix = input.first
94
+ result = option.parse(input)
95
+ if result != nil
109
96
  values[option.key] = result
110
97
  end
111
98
  end
@@ -1,22 +1,7 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2016-2023, by Samuel Williams.
20
5
 
21
6
  module Samovar
22
7
  module Output
@@ -1,22 +1,7 @@
1
- # Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2019-2023, by Samuel Williams.
20
5
 
21
6
  module Samovar
22
7
  module Output
@@ -1,22 +1,7 @@
1
- # Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2019-2023, by Samuel Williams.
20
5
 
21
6
  module Samovar
22
7
  module Output
@@ -1,22 +1,7 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2019-2023, by Samuel Williams.
20
5
 
21
6
  require_relative 'header'
22
7
  require_relative 'columns'
@@ -1,22 +1,7 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2019-2023, by Samuel Williams.
20
5
 
21
6
  require 'mapping/model'
22
7
  require 'console/terminal'
@@ -1,21 +1,6 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2016-2023, by Samuel Williams.
20
5
 
21
6
  require_relative 'output/usage_formatter'