lino 4.0.0 → 4.1.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: 2345fde1348f94927b9f8790c0a3d77a28b1bd0829eaa408249ef1b9ad06a9b1
4
- data.tar.gz: 2ed278cbe9a30e2df451ccfa78bf592a2ceb6654bb70d1d37f4a3625aae37371
3
+ metadata.gz: 23de6ab0121ced598488bef047deb1546c6d2a9ed9a41d76eda25c1bbf6feeb2
4
+ data.tar.gz: 724b315f6dec3a1eda3db21ab408571322f44a1b5fb9f88df017ef7cc989e52c
5
5
  SHA512:
6
- metadata.gz: 256de30d81d5bd07e9047878c3ed4691d2052997425c95d7a33bdba5cbf402cf3fcd5356945882fb5e8cbd85346e322a36c44c995ff32392c52435163314aac8
7
- data.tar.gz: 4fdee42f644db2994a90d0de0465f8d04df02eac2be62f08d755b272dc75278f4894a7772f169935f8a7fc7e9c429466e86980491700e858cc014fe8f5ac9dce
6
+ metadata.gz: 746e63f79a3a0325f3dcfe68aaf1fe000ada9dc15f2a05b9e1459e711890e062fab1acabc5f027e60e84289cf0eee962b3318c5609ff2ee51d762cd867e8e08b
7
+ data.tar.gz: fc6feaaf6b0fcb3cb88146ca3bf5100a99b1a4fcd7ff60e57d83dd716d6da79fd7ac217310535ce293d13bc3f7e8b370180a7bcece13eb6659c1a39eea36de63
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lino (4.0.0)
4
+ lino (4.1.0.pre.1)
5
5
  childprocess (~> 5.0.0)
6
6
  hamster (~> 3.0)
7
7
  open4 (~> 1.3)
@@ -107,11 +107,11 @@ GEM
107
107
  colored2 (~> 3.1)
108
108
  git (~> 1.13, >= 1.13.2)
109
109
  rake_factory (= 0.32.0.pre.2)
110
- rake_git_crypt (0.1.0.pre.30)
110
+ rake_git_crypt (0.1.0.pre.32)
111
111
  colored2 (~> 3.1)
112
112
  rake_factory (= 0.32.0.pre.2)
113
- ruby_git_crypt (= 0.1.0.pre.6)
114
- ruby_gpg2 (= 0.11.0.pre.5)
113
+ ruby_git_crypt (= 0.1.0.pre.8)
114
+ ruby_gpg2 (= 0.11.0.pre.6)
115
115
  rake_github (0.13.0)
116
116
  colored2 (~> 3.1)
117
117
  octokit (>= 4.16, < 9.0)
@@ -162,11 +162,11 @@ GEM
162
162
  rubocop-rspec (3.0.3)
163
163
  rubocop (~> 1.61)
164
164
  ruby-progressbar (1.13.0)
165
- ruby_git_crypt (0.1.0.pre.6)
165
+ ruby_git_crypt (0.1.0.pre.8)
166
166
  immutable-struct (~> 2.4)
167
- lino (= 3.2.0.pre.10)
168
- ruby_gpg2 (0.11.0.pre.5)
169
- lino (= 3.2.0.pre.10)
167
+ lino (>= 3.1)
168
+ ruby_gpg2 (0.11.0.pre.6)
169
+ lino (>= 3.1)
170
170
  sawyer (0.9.2)
171
171
  addressable (>= 2.3.5)
172
172
  faraday (>= 0.17.3, < 3)
@@ -37,8 +37,10 @@ module Lino
37
37
  Model::CommandLine.new(
38
38
  @command,
39
39
  state.merge(
40
- options: build_options,
41
- subcommands: build_subcommands
40
+ options: build_options(@option_separator, @option_quoting,
41
+ @option_placement),
42
+ subcommands: build_subcommands(@option_separator, @option_quoting,
43
+ @option_placement)
42
44
  )
43
45
  )
44
46
  end
@@ -91,25 +91,33 @@ module Lino
91
91
  super.merge(options: @options)
92
92
  end
93
93
 
94
- def build_options
94
+ def build_options(option_separator, option_quoting, option_placement)
95
95
  @options.map do |data|
96
- data[:type] == :option ? build_option(data) : build_flag(data)
96
+ if data[:type] == :option
97
+ build_option(
98
+ data, option_separator, option_quoting, option_placement
99
+ )
100
+ else
101
+ build_flag(data, option_placement)
102
+ end
97
103
  end
98
104
  end
99
105
 
100
- def build_option(option_data)
106
+ def build_option(
107
+ option_data, option_separator, option_quoting, option_placement
108
+ )
101
109
  Model::Option.new(
102
110
  *option_data[:components],
103
- separator: option_data[:separator] || @option_separator,
104
- quoting: option_data[:quoting] || @option_quoting,
105
- placement: option_data[:placement] || @option_placement
111
+ separator: option_data[:separator] || option_separator,
112
+ quoting: option_data[:quoting] || option_quoting,
113
+ placement: option_data[:placement] || option_placement
106
114
  )
107
115
  end
108
116
 
109
- def build_flag(flag_data)
117
+ def build_flag(flag_data, option_placement)
110
118
  Model::Flag.new(
111
119
  *flag_data[:components],
112
- placement: flag_data[:placement] || @option_placement
120
+ placement: flag_data[:placement] || option_placement
113
121
  )
114
122
  end
115
123
  end
@@ -43,8 +43,12 @@ module Lino
43
43
  super.merge(subcommands: @subcommands)
44
44
  end
45
45
 
46
- def build_subcommands
47
- @subcommands.map(&:build)
46
+ def build_subcommands(
47
+ option_separator, option_quoting, option_placement
48
+ )
49
+ @subcommands.map do |s|
50
+ s.build(option_separator, option_quoting, option_placement)
51
+ end
48
52
  end
49
53
  end
50
54
  end
@@ -23,10 +23,14 @@ module Lino
23
23
  @options = Hamster::Vector.new(state[:options] || [])
24
24
  end
25
25
 
26
- def build
26
+ def build(option_separator, option_quoting, option_placement)
27
27
  Model::Subcommand.new(
28
28
  @subcommand,
29
- options: build_options
29
+ options: build_options(
30
+ option_separator,
31
+ option_quoting,
32
+ option_placement
33
+ )
30
34
  )
31
35
  end
32
36
 
data/lib/lino/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lino
4
- VERSION = '4.0.0'
4
+ VERSION = '4.1.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: 4.0.0
4
+ version: 4.1.0.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - InfraBlocks Maintainers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-14 00:00:00.000000000 Z
11
+ date: 2024-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: childprocess
@@ -336,9 +336,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
336
336
  version: '3.1'
337
337
  required_rubygems_version: !ruby/object:Gem::Requirement
338
338
  requirements:
339
- - - ">="
339
+ - - ">"
340
340
  - !ruby/object:Gem::Version
341
- version: '0'
341
+ version: 1.3.1
342
342
  requirements: []
343
343
  rubygems_version: 3.3.7
344
344
  signing_key: