lino 2.7.0 → 3.0.0.pre.1

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: e4b109a8ae09376329a0fdff6af6078db19612b7eb49d43fbeeda260f10a83e9
4
- data.tar.gz: dd0d947045f8735e136feaad7ca6ef7b0534426c66252bc3d12beea47cda2e55
3
+ metadata.gz: 814ba4c3b5790b29c0bed0ea964441d6f382b7bd6430ae69c5d45871a38065b7
4
+ data.tar.gz: 815e2d108e1d79f02ce5d0b6e315193d753322f097de7da6cc65d21a84ca63ef
5
5
  SHA512:
6
- metadata.gz: 205e636f92af2a243e90fa4084376a21c6e4480de1f12f8fff053fa2397da1d26824a56f626d94037cb61c0e608d240402cd53b12631e74b962aa44d86fe8f09
7
- data.tar.gz: eaee4aa51f2437dc887bc0652a8c26edcdeb4f4bcd86c2cdfa59c092473eb4c60198d68317d4940ca5ecc766b449bb6c16c9cf981dad273354737db6c4a40ff9
6
+ metadata.gz: ae965325ec2dc8fb05611c498da286b816997de2ab0e7730d4b9a8507150308e3aacd43c71880251c98aa3c31b00215e186a9b11a34a45ee1042a857f4f65925
7
+ data.tar.gz: db20e12bb7e81337519ad34d07342e9136993b364ffe4d14063eec04d145e085c034e1b607cdb622dc3d469e05402aba97cb88690d8b92c06cf26abb417f5521
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lino (2.7.0)
4
+ lino (3.0.0.pre.1)
5
5
  hamster (~> 3.0)
6
6
  open4 (~> 1.3)
7
7
 
@@ -137,4 +137,4 @@ DEPENDENCIES
137
137
  simplecov (~> 0.16)
138
138
 
139
139
  BUNDLED WITH
140
- 2.2.16
140
+ 2.2.17
@@ -7,13 +7,13 @@ module Lino
7
7
  include Lino::Utilities
8
8
 
9
9
  def with_appliable(appliable)
10
- return self if missing?(appliable)
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 missing?(appliables)
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 missing?(subcommand)
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 missing?(subcommands)
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 missing?(argument)
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 missing?(arguments)
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 missing?(environment_variables)
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 missing?(value)
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 missing?(options)
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 missing?(flag)
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 missing?(flags)
67
+ return self if nil_or_empty?(flags)
68
68
 
69
69
  flags.inject(self) { |s, flag| s.with_flag(flag) }
70
70
  end
@@ -22,8 +22,16 @@ module Lino
22
22
  end
23
23
  end
24
24
 
25
- def missing?(value)
26
- value.nil? || (value.respond_to?(:empty?) && value.empty?)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lino
4
- VERSION = '2.7.0'
4
+ VERSION = '3.0.0.pre.1'
5
5
  end
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: 2.7.0
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-01 00:00:00.000000000 Z
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: '0'
249
+ version: 1.3.1
250
250
  requirements: []
251
251
  rubygems_version: 3.0.1
252
252
  signing_key: