rexe 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +10 -9
- data/exe/rexe +15 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a941b8dc64640ce710ebf30d3f42ed087738b0fa568b57e9009aa0eb4949f36
|
4
|
+
data.tar.gz: b8f905cd6f2eace78eb3b17a1bb5a3d90b1223416608049f68e014d69ed4ab07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5d7379fade7a80ac2659d7ea6da584e2f28366552cb94e95f31fc4c692a6ac0524a72838aa80608854ebc1f3619b4a04976c45de409a5f8a2cf9abec9495958
|
7
|
+
data.tar.gz: '09a15996ad72e8c72c997ee24495727affcc519f09d695dcea6ae73797decf5891681de5820206d77999154b1824911c117cedab617b1ce3c569ce5209329321'
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,18 @@
|
|
1
1
|
## rexe -- Ruby Command Line Executor
|
2
2
|
|
3
3
|
|
4
|
+
### v0.6.1
|
5
|
+
|
6
|
+
* Improve handling of nonexistent load files (-l, -u options).
|
7
|
+
|
8
|
+
|
9
|
+
### v0.6.0
|
10
|
+
|
11
|
+
* Change default input mode from :string to :no_input.
|
12
|
+
* Improve readme.
|
13
|
+
* Add post install message warning about change of default input mode.
|
14
|
+
|
15
|
+
|
4
16
|
### v0.5.0
|
5
17
|
|
6
18
|
* Add '!' to require and load command options to clear respective file lists.
|
data/README.md
CHANGED
@@ -19,34 +19,35 @@ chmod +x rexe
|
|
19
19
|
|
20
20
|
## Usage
|
21
21
|
|
22
|
-
rexe is
|
22
|
+
rexe is an _executor_, meaning it can execute Ruby without either standard input or output,
|
23
|
+
but it is also a _filter_ in that it can implicitly consume standard input and emit standard output.
|
23
24
|
|
24
25
|
### Help Text
|
25
26
|
|
26
27
|
As a summary, here is the help text printed out by the application:
|
27
28
|
|
28
29
|
```
|
29
|
-
rexe -- Ruby Command Line Filter/Executor -- v0.6.
|
30
|
+
rexe -- Ruby Command Line Filter/Executor -- v0.6.1 -- https://github.com/keithrbennett/rexe
|
30
31
|
|
31
32
|
Executes Ruby code on the command line, optionally taking standard input and writing to standard output.
|
32
33
|
|
33
34
|
Options:
|
34
35
|
|
35
|
-
-h, --help
|
36
|
-
-l, --load RUBY_FILE(S)
|
37
|
-
-u, --load-up RUBY_FILE(S)
|
38
|
-
-m, --mode MODE
|
36
|
+
-h, --help Print help and exit
|
37
|
+
-l, --load RUBY_FILE(S) Ruby file(s) to load, comma separated, or ! to clear
|
38
|
+
-u, --load-up RUBY_FILE(S) Ruby file(s) to load, searching up tree, comma separated, or ! to clear
|
39
|
+
-m, --mode MODE Mode with which to handle input (i.e. what `self` will be in the code):
|
39
40
|
-ms for each line to be handled separately as a string
|
40
41
|
-me for an enumerator of lines (least memory consumption for big data)
|
41
42
|
-mb for 1 big string (all lines combined into single multiline string)
|
42
43
|
-mn to execute the specified Ruby code on no input at all (default)
|
43
|
-
-r, --require REQUIRES
|
44
|
-
-v, --[no-]verbose
|
44
|
+
-r, --require REQUIRES Gems and built-in libraries to require, comma separated, or ! to clear
|
45
|
+
-v, --[no-]verbose verbose mode (logs to stderr); to disable, short options: -v n, -v false
|
45
46
|
|
46
47
|
If there is an .rexerc file in your home directory, it will be run as Ruby code
|
47
48
|
before processing the input.
|
48
49
|
|
49
|
-
If there is
|
50
|
+
If there is a REXE_OPTIONS environment variable, its content will be prepended to the command line
|
50
51
|
so that you can specify options implicitly (e.g. `export REXE_OPTIONS="-r awesome_print,yaml"`)
|
51
52
|
```
|
52
53
|
|
data/exe/rexe
CHANGED
@@ -9,7 +9,7 @@ require 'shellwords'
|
|
9
9
|
|
10
10
|
class Rexe < Struct.new(:input_mode, :loads, :requires, :verbose)
|
11
11
|
|
12
|
-
VERSION = '0.6.
|
12
|
+
VERSION = '0.6.1'
|
13
13
|
|
14
14
|
def initialize
|
15
15
|
self.input_mode = :no_input
|
@@ -28,16 +28,16 @@ class Rexe < Struct.new(:input_mode, :loads, :requires, :verbose)
|
|
28
28
|
|
29
29
|
Options:
|
30
30
|
|
31
|
-
-h, --help
|
32
|
-
-l, --load RUBY_FILE(S)
|
33
|
-
-u, --load-up RUBY_FILE(S)
|
34
|
-
-m, --mode MODE
|
31
|
+
-h, --help Print help and exit
|
32
|
+
-l, --load RUBY_FILE(S) Ruby file(s) to load, comma separated, or ! to clear
|
33
|
+
-u, --load-up RUBY_FILE(S) Ruby file(s) to load, searching up tree, comma separated, or ! to clear
|
34
|
+
-m, --mode MODE Mode with which to handle input (i.e. what `self` will be in the code):
|
35
35
|
-ms for each line to be handled separately as a string
|
36
36
|
-me for an enumerator of lines (least memory consumption for big data)
|
37
37
|
-mb for 1 big string (all lines combined into single multiline string)
|
38
38
|
-mn to execute the specified Ruby code on no input at all (default)
|
39
|
-
-r, --require REQUIRES
|
40
|
-
-v, --[no-]verbose
|
39
|
+
-r, --require REQUIRES Gems and built-in libraries to require, comma separated, or ! to clear
|
40
|
+
-v, --[no-]verbose verbose mode (logs to stderr); to disable, short options: -v n, -v false
|
41
41
|
|
42
42
|
If there is an .rexerc file in your home directory, it will be run as Ruby code
|
43
43
|
before processing the input.
|
@@ -59,6 +59,7 @@ class Rexe < Struct.new(:input_mode, :loads, :requires, :verbose)
|
|
59
59
|
|
60
60
|
|
61
61
|
def parse_command_line
|
62
|
+
|
62
63
|
prepend_environment_options
|
63
64
|
|
64
65
|
OptionParser.new do |parser|
|
@@ -72,7 +73,12 @@ class Rexe < Struct.new(:input_mode, :loads, :requires, :verbose)
|
|
72
73
|
if v == '!'
|
73
74
|
self.loads.clear
|
74
75
|
else
|
75
|
-
v.split(',').map(&:strip)
|
76
|
+
loadfiles = v.split(',').map(&:strip)
|
77
|
+
existent, nonexistent = loadfiles.partition { |filespec| File.exists?(filespec) }
|
78
|
+
if nonexistent.any?
|
79
|
+
log_if_verbose("\nDid not find the following files to load: #{nonexistent.to_s}\n\n")
|
80
|
+
end
|
81
|
+
existent.each { |filespec| self.loads << filespec }
|
76
82
|
end
|
77
83
|
end
|
78
84
|
|
@@ -86,7 +92,7 @@ class Rexe < Struct.new(:input_mode, :loads, :requires, :verbose)
|
|
86
92
|
if found_file
|
87
93
|
self.loads << found_file
|
88
94
|
else
|
89
|
-
log_if_verbose("
|
95
|
+
log_if_verbose("\nDid not find load file '#{filespec}' in this directory or higher.\n\n")
|
90
96
|
end
|
91
97
|
end
|
92
98
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rexe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keith Bennett
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|