lino 2.7.0 → 3.0.0.pre.1
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 +4 -4
- data/Gemfile.lock +2 -2
- data/lib/lino/appliables.rb +2 -2
- data/lib/lino/command_line_builder.rb +5 -5
- data/lib/lino/options.rb +4 -4
- data/lib/lino/utilities.rb +10 -2
- data/lib/lino/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 814ba4c3b5790b29c0bed0ea964441d6f382b7bd6430ae69c5d45871a38065b7
|
4
|
+
data.tar.gz: 815e2d108e1d79f02ce5d0b6e315193d753322f097de7da6cc65d21a84ca63ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae965325ec2dc8fb05611c498da286b816997de2ab0e7730d4b9a8507150308e3aacd43c71880251c98aa3c31b00215e186a9b11a34a45ee1042a857f4f65925
|
7
|
+
data.tar.gz: db20e12bb7e81337519ad34d07342e9136993b364ffe4d14063eec04d145e085c034e1b607cdb622dc3d469e05402aba97cb88690d8b92c06cf26abb417f5521
|
data/Gemfile.lock
CHANGED
data/lib/lino/appliables.rb
CHANGED
@@ -7,13 +7,13 @@ module Lino
|
|
7
7
|
include Lino::Utilities
|
8
8
|
|
9
9
|
def with_appliable(appliable)
|
10
|
-
return self if
|
10
|
+
return self if nil?(appliable)
|
11
11
|
|
12
12
|
appliable.apply(self)
|
13
13
|
end
|
14
14
|
|
15
15
|
def with_appliables(appliables)
|
16
|
-
return self if
|
16
|
+
return self if nil_or_empty?(appliables)
|
17
17
|
|
18
18
|
appliables.inject(self) do |s, appliable|
|
19
19
|
s.with_appliable(appliable)
|
@@ -44,7 +44,7 @@ module Lino
|
|
44
44
|
# rubocop:enable Metrics/ParameterLists
|
45
45
|
|
46
46
|
def with_subcommand(subcommand, &block)
|
47
|
-
return self if
|
47
|
+
return self if nil?(subcommand)
|
48
48
|
|
49
49
|
with(
|
50
50
|
subcommands: @subcommands.add(
|
@@ -56,7 +56,7 @@ module Lino
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def with_subcommands(subcommands, &block)
|
59
|
-
return self if
|
59
|
+
return self if nil_or_empty?(subcommands)
|
60
60
|
|
61
61
|
without_block = subcommands[0...-1]
|
62
62
|
with_block = subcommands.last
|
@@ -91,13 +91,13 @@ module Lino
|
|
91
91
|
end
|
92
92
|
|
93
93
|
def with_argument(argument)
|
94
|
-
return self if
|
94
|
+
return self if nil?(argument)
|
95
95
|
|
96
96
|
with(arguments: @arguments.add({ components: [argument] }))
|
97
97
|
end
|
98
98
|
|
99
99
|
def with_arguments(arguments)
|
100
|
-
return self if
|
100
|
+
return self if nil_or_empty?(arguments)
|
101
101
|
|
102
102
|
arguments.inject(self) { |s, argument| s.with_argument(argument) }
|
103
103
|
end
|
@@ -114,7 +114,7 @@ module Lino
|
|
114
114
|
end
|
115
115
|
|
116
116
|
def with_environment_variables(environment_variables)
|
117
|
-
return self if
|
117
|
+
return self if nil_or_empty?(environment_variables)
|
118
118
|
|
119
119
|
environment_variables.entries.inject(self) do |s, var|
|
120
120
|
s.with_environment_variable(
|
data/lib/lino/options.rb
CHANGED
@@ -13,7 +13,7 @@ module Lino
|
|
13
13
|
quoting: nil,
|
14
14
|
placement: nil
|
15
15
|
)
|
16
|
-
return self if
|
16
|
+
return self if nil?(value)
|
17
17
|
|
18
18
|
with(options: @options.add(
|
19
19
|
{
|
@@ -26,7 +26,7 @@ module Lino
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def with_options(options)
|
29
|
-
return self if
|
29
|
+
return self if nil_or_empty?(options)
|
30
30
|
|
31
31
|
options.entries.inject(self) do |s, entry|
|
32
32
|
s.with_option(
|
@@ -58,13 +58,13 @@ module Lino
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def with_flag(flag)
|
61
|
-
return self if
|
61
|
+
return self if nil?(flag)
|
62
62
|
|
63
63
|
with(options: @options.add({ components: [flag] }))
|
64
64
|
end
|
65
65
|
|
66
66
|
def with_flags(flags)
|
67
|
-
return self if
|
67
|
+
return self if nil_or_empty?(flags)
|
68
68
|
|
69
69
|
flags.inject(self) { |s, flag| s.with_flag(flag) }
|
70
70
|
end
|
data/lib/lino/utilities.rb
CHANGED
@@ -22,8 +22,16 @@ module Lino
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
def
|
26
|
-
value.nil?
|
25
|
+
def nil?(value)
|
26
|
+
value.nil?
|
27
|
+
end
|
28
|
+
|
29
|
+
def empty?(value)
|
30
|
+
value.respond_to?(:empty?) && value.empty?
|
31
|
+
end
|
32
|
+
|
33
|
+
def nil_or_empty?(value)
|
34
|
+
nil?(value) || empty?(value)
|
27
35
|
end
|
28
36
|
|
29
37
|
private
|
data/lib/lino/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lino
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0.pre.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toby Clemson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hamster
|
@@ -244,9 +244,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
244
244
|
version: '2.6'
|
245
245
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
246
246
|
requirements:
|
247
|
-
- - "
|
247
|
+
- - ">"
|
248
248
|
- !ruby/object:Gem::Version
|
249
|
-
version:
|
249
|
+
version: 1.3.1
|
250
250
|
requirements: []
|
251
251
|
rubygems_version: 3.0.1
|
252
252
|
signing_key:
|