lino 1.8.0.pre.1 → 1.8.0.pre.2
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/CODE_OF_CONDUCT.md +1 -1
- data/Gemfile.lock +1 -1
- data/README.md +27 -11
- data/lib/lino/command_line_builder.rb +2 -2
- data/lib/lino/subcommand_builder.rb +2 -2
- data/lib/lino/{option_flag_mixin.rb → switches.rb} +1 -5
- data/lib/lino/utilities.rb +4 -0
- data/lib/lino/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d080aeff7401e2706a8d09877bb45f3b4f607289f9a422fe6e7cb8ae56f64a0c
|
4
|
+
data.tar.gz: 9b2b787947844e9af983a1e6f5eda10beb5dc9e13068dde2eb889dca429c89aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '04596746b3bcee1f1d18ace01c68953cdac43070492f28bb262aee74b2ad21e8a8fdeb0ebb628ff7ebe1d61ac66ed4afa1e7aeb830556bd4175ac6206fd4f88b'
|
7
|
+
data.tar.gz: 496bf9bf680bb92c192670fb3a251fc2adeb80194baa558e3b4d76da6b9b366fa363111c0bfbe9137f851d638a85728f6b2f7bdfed05c5b27a926ee883b0e581
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
|
|
55
55
|
## Enforcement
|
56
56
|
|
57
57
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
reported by contacting the project team at
|
58
|
+
reported by contacting the project team at maintainers@infrablocks.io. All
|
59
59
|
complaints will be reviewed and investigated and will result in a response that
|
60
60
|
is deemed necessary and appropriate to the circumstances. The project team is
|
61
61
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -40,7 +40,8 @@ command_line.execute
|
|
40
40
|
|
41
41
|
### `Lino::CommandLineBuilder`
|
42
42
|
|
43
|
-
The `CommandLineBuilder` allows a number of different styles of commands to be
|
43
|
+
The `CommandLineBuilder` allows a number of different styles of commands to be
|
44
|
+
built:
|
44
45
|
|
45
46
|
```ruby
|
46
47
|
# commands with flags
|
@@ -61,7 +62,7 @@ Lino::CommandLineBuilder.for_command('gpg')
|
|
61
62
|
|
62
63
|
# => gpg --recipient tobyclemson@gmail.com --sign ./doc.txt
|
63
64
|
|
64
|
-
# commands with an option repeated multiple times
|
65
|
+
# commands with an option repeated multiple times
|
65
66
|
Lino::CommandLineBuilder.for_command('example.sh')
|
66
67
|
.with_repeated_option('--opt', ['file1.txt', nil, '', 'file2.txt'])
|
67
68
|
.build
|
@@ -78,7 +79,7 @@ Lino::CommandLineBuilder.for_command('diff')
|
|
78
79
|
|
79
80
|
# => diff ./file1.txt ./file2.txt
|
80
81
|
|
81
|
-
# commands with an array of arguments
|
82
|
+
# commands with an array of arguments
|
82
83
|
Lino::CommandLineBuilder.for_command('diff')
|
83
84
|
.with_arguments(['./file1.txt', nil, '', './file2.txt'])
|
84
85
|
.build
|
@@ -147,7 +148,8 @@ command_line.execute
|
|
147
148
|
# => <contents of / directory>
|
148
149
|
```
|
149
150
|
|
150
|
-
By default, the standard input stream is empty and the process writes to the
|
151
|
+
By default, the standard input stream is empty and the process writes to the
|
152
|
+
standard output and error streams.
|
151
153
|
|
152
154
|
To populate standard input:
|
153
155
|
|
@@ -155,7 +157,8 @@ To populate standard input:
|
|
155
157
|
command_line.execute(stdin: 'something to be passed to standard input')
|
156
158
|
```
|
157
159
|
|
158
|
-
The `stdin` option supports any object that responds to `each`, `read` or
|
160
|
+
The `stdin` option supports any object that responds to `each`, `read` or
|
161
|
+
`to_s`.
|
159
162
|
|
160
163
|
To provide custom streams for standard output or standard error:
|
161
164
|
|
@@ -174,16 +177,29 @@ The `stdout` and `stderr` options support any object that responds to `<<`.
|
|
174
177
|
|
175
178
|
## Development
|
176
179
|
|
177
|
-
|
180
|
+
To install dependencies and run the build, run the pre-commit build:
|
178
181
|
|
179
|
-
|
182
|
+
```shell script
|
183
|
+
./go
|
184
|
+
```
|
180
185
|
|
181
|
-
|
186
|
+
Tou can also run only the specs:
|
182
187
|
|
183
|
-
|
188
|
+
```shell script
|
189
|
+
./go spec
|
190
|
+
```
|
184
191
|
|
192
|
+
You can also run `bin/console` for an interactive prompt that will allow you to
|
193
|
+
experiment.
|
185
194
|
|
186
|
-
##
|
195
|
+
## Contributing
|
196
|
+
|
197
|
+
Bug reports and pull requests are welcome on GitHub at
|
198
|
+
https://github.com/infrablocks/lino. This project is intended to be a safe,
|
199
|
+
welcoming space for collaboration, and contributors are expected to adhere to
|
200
|
+
the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
187
201
|
|
188
|
-
|
202
|
+
## License
|
189
203
|
|
204
|
+
The gem is available as open source under the terms of the
|
205
|
+
[MIT License](http://opensource.org/licenses/MIT).
|
@@ -2,12 +2,12 @@ require 'hamster'
|
|
2
2
|
require_relative 'utilities'
|
3
3
|
require_relative 'command_line'
|
4
4
|
require_relative 'subcommand_builder'
|
5
|
-
require_relative '
|
5
|
+
require_relative 'switches'
|
6
6
|
|
7
7
|
module Lino
|
8
8
|
class CommandLineBuilder
|
9
9
|
include Lino::Utilities
|
10
|
-
include Lino::
|
10
|
+
include Lino::Switches
|
11
11
|
|
12
12
|
class <<self
|
13
13
|
def for_command(command)
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'hamster'
|
2
2
|
require_relative 'utilities'
|
3
|
-
require_relative '
|
3
|
+
require_relative 'switches'
|
4
4
|
|
5
5
|
module Lino
|
6
6
|
class SubcommandBuilder
|
7
7
|
include Lino::Utilities
|
8
|
-
include Lino::
|
8
|
+
include Lino::Switches
|
9
9
|
|
10
10
|
class <<self
|
11
11
|
def for_subcommand(subcommand)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Lino
|
2
|
-
module
|
2
|
+
module Switches
|
3
3
|
def with_option(switch, value, separator: nil, quoting: nil)
|
4
4
|
with(switches: add_option(switch, value, separator, quoting))
|
5
5
|
end
|
@@ -28,9 +28,5 @@ module Lino
|
|
28
28
|
}
|
29
29
|
)
|
30
30
|
end
|
31
|
-
|
32
|
-
def missing?(value)
|
33
|
-
value.nil? || (value.respond_to?(:empty?) && value.empty?)
|
34
|
-
end
|
35
31
|
end
|
36
32
|
end
|
data/lib/lino/utilities.rb
CHANGED
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: 1.8.0.pre.
|
4
|
+
version: 1.8.0.pre.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toby Clemson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hamster
|
@@ -182,8 +182,8 @@ files:
|
|
182
182
|
- lib/lino.rb
|
183
183
|
- lib/lino/command_line.rb
|
184
184
|
- lib/lino/command_line_builder.rb
|
185
|
-
- lib/lino/option_flag_mixin.rb
|
186
185
|
- lib/lino/subcommand_builder.rb
|
186
|
+
- lib/lino/switches.rb
|
187
187
|
- lib/lino/utilities.rb
|
188
188
|
- lib/lino/version.rb
|
189
189
|
homepage: https://github.com/infrablocks/lino
|