clasp-ruby 0.12.1 → 0.12.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/lib/clasp/aliases.rb +6 -4
- data/lib/clasp/cli.rb +3 -2
- data/lib/clasp/version.rb +2 -2
- data/test/scratch/test_aliases.rb +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e5001a6187f428a3cdfe4bc6b01774d0cfd5b94
|
4
|
+
data.tar.gz: efcc8d280ccbf5733a12a7979bc8725f1dd02fd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f032b789fd1b19a34192ff7c1cc0b0324e9c8058ac04f07c10231b31083900c4046c7bd90cd3c3d167024f19baf93cb3064e91ba5ee7c275066667f5ba559301
|
7
|
+
data.tar.gz: 5fc26186f36d65c126320129149d040adfa67422c56e2116230e45d403adc1ea17866f96a45eaa38ae4b19eb5101f35e743bf6c70a553def5e22d6a7c4b927ac
|
data/lib/clasp/aliases.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# Purpose: Alias classes
|
6
6
|
#
|
7
7
|
# Created: 25th October 2014
|
8
|
-
# Updated:
|
8
|
+
# Updated: 7th February 2018
|
9
9
|
#
|
10
10
|
# Home: http://github.com/synesissoftware/CLASP.Ruby
|
11
11
|
#
|
@@ -213,6 +213,7 @@ end
|
|
213
213
|
# * *Options:*
|
214
214
|
# - +:alias+ [::String] An alias, e.g. '-v'
|
215
215
|
# - +:aliases+ [::Array] An array of aliases, e.g. [ '-v', '-verb' ]
|
216
|
+
# Ignored if +:alias+ is specified
|
216
217
|
# - +:extras+ An application-defined object, usually a hash of custom
|
217
218
|
# attributes
|
218
219
|
# - +:help+ [::String] A help string
|
@@ -232,7 +233,7 @@ def CLASP.Flag(name, options = {})
|
|
232
233
|
aliases = [ v ]
|
233
234
|
when :aliases
|
234
235
|
|
235
|
-
aliases = v
|
236
|
+
aliases = v unless aliases
|
236
237
|
when :help
|
237
238
|
|
238
239
|
help = v
|
@@ -264,7 +265,8 @@ end
|
|
264
265
|
#
|
265
266
|
# * *Options:*
|
266
267
|
# - +:alias+ [::String] An alias, e.g. '-v'
|
267
|
-
# - +:aliases+ [::Array] An array of aliases, e.g. [ '-v', '-verb' ]
|
268
|
+
# - +:aliases+ [::Array] An array of aliases, e.g. [ '-v', '-verb' ].
|
269
|
+
# Ignored if +:alias+ is specified
|
268
270
|
# - +:default_value+ The default value for the option
|
269
271
|
# - +:default+ [DEPRECATED] Alternative to +:default_value+
|
270
272
|
# - +:extras+ An application-defined object, usually a hash of custom
|
@@ -302,7 +304,7 @@ def CLASP.Option(name, options = {})
|
|
302
304
|
aliases = [ v ]
|
303
305
|
when :aliases
|
304
306
|
|
305
|
-
aliases = v
|
307
|
+
aliases = v unless aliases
|
306
308
|
when :help
|
307
309
|
|
308
310
|
help = v
|
data/lib/clasp/cli.rb
CHANGED
@@ -5,13 +5,13 @@
|
|
5
5
|
# Purpose: Command-line interface
|
6
6
|
#
|
7
7
|
# Created: 27th July 2015
|
8
|
-
# Updated:
|
8
|
+
# Updated: 7th February 2018
|
9
9
|
#
|
10
10
|
# Home: http://github.com/synesissoftware/CLASP.Ruby
|
11
11
|
#
|
12
12
|
# Author: Matthew Wilson
|
13
13
|
#
|
14
|
-
# Copyright (c) 2015-
|
14
|
+
# Copyright (c) 2015-2018, Matthew Wilson and Synesis Software
|
15
15
|
# All rights reserved.
|
16
16
|
#
|
17
17
|
# Redistribution and use in source and binary forms, with or without
|
@@ -183,6 +183,7 @@ def self.show_usage aliases, options={}
|
|
183
183
|
stream.puts
|
184
184
|
|
185
185
|
unless aliases.empty?
|
186
|
+
|
186
187
|
stream.puts "flags/options:"
|
187
188
|
stream.puts
|
188
189
|
aliases.each do |a|
|
data/lib/clasp/version.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# Purpose: Version for CLASP.Ruby library
|
6
6
|
#
|
7
7
|
# Created: 16th November 2014
|
8
|
-
# Updated:
|
8
|
+
# Updated: 7th February 2018
|
9
9
|
#
|
10
10
|
# Home: http://github.com/synesissoftware/CLASP.Ruby
|
11
11
|
#
|
@@ -51,7 +51,7 @@
|
|
51
51
|
module CLASP
|
52
52
|
|
53
53
|
# Current version of the CLASP.Ruby library
|
54
|
-
VERSION = '0.12.
|
54
|
+
VERSION = '0.12.2'
|
55
55
|
|
56
56
|
private
|
57
57
|
VERSION_PARTS_ = VERSION.split(/[.]/).collect { |n| n.to_i } # :nodoc:
|
@@ -3,7 +3,6 @@
|
|
3
3
|
$:.unshift File.join(File.dirname(__FILE__), '..', '..', 'lib')
|
4
4
|
|
5
5
|
require 'clasp'
|
6
|
-
require 'recls'
|
7
6
|
|
8
7
|
Aliases = [
|
9
8
|
|
@@ -11,9 +10,10 @@ Aliases = [
|
|
11
10
|
CLASP.Flag('--version', alias: '-v', help: 'shows this version and quits'),
|
12
11
|
|
13
12
|
CLASP.Option('--directory', alias: '-d', help: 'a directory within which to process'),
|
14
|
-
CLASP.Option('--patterns', alias: '-p', help: "one or more patterns, separated by '|' or
|
13
|
+
CLASP.Option('--patterns', alias: '-p', help: "one or more patterns against which the entries will be matched, separated by '|' or the platform-specific separator - ':' UNIX, ';' Windows"),
|
15
14
|
|
16
15
|
CLASP.Option('--case-sensitive', alias: '-c', help: 'determines whether case sensitive', values_range: %W{ yes no true false }, default_value: false),
|
16
|
+
CLASP.Option('--case-sensitive=false', alias: '-I'),
|
17
17
|
]
|
18
18
|
|
19
19
|
Arguments = CLASP::Arguments.new(ARGV, Aliases)
|
@@ -21,10 +21,10 @@ Flags = Arguments.flags
|
|
21
21
|
Options = Arguments.options
|
22
22
|
Values = Arguments.values
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
if Flags.include? '--help'
|
25
|
+
|
26
|
+
CLASP.show_usage Aliases, exit: 0
|
27
|
+
end
|
28
28
|
|
29
29
|
Flags.each do |f|
|
30
30
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clasp-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Wilson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
Command-Line Argument Sorting and Parsing library that provides a powerful
|