appl 1.15 → 1.17

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appl.rb +9 -3
  3. data/lib/applfan.rb +5 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56c30027cafdb226bc4406d7e61c635a851ebdd6803db91619f7304ba8cb6aa6
4
- data.tar.gz: ed5ff7e4c34536b77c992825ae62c5bcce3bb2c0ab279af23dadca6126e40eed
3
+ metadata.gz: 9d084ceaba0454719bfc3014fee88ca28e7ecdf62909a2909c8bdc46289cd0b1
4
+ data.tar.gz: 8cc3725ecfe7f6326cf3f6643a9d26ac4f134e2bedf4e49a2de7163dc80fcd62
5
5
  SHA512:
6
- metadata.gz: ca350b770a585c31c2d0f5f0cc3f49d9a284632cc59acb8acbaa5258660587bae444a299bd97057a3a734383b98c8cca702dc4c01da38c8c0469704311fe4ccb
7
- data.tar.gz: e1e5e52163995309fbe55621e816265477889996466a3c74f6efd50e07f88b7fd07d0f048a309b193f3c0606769250534c3c846824c0f8f5153eca673eb999b8
6
+ metadata.gz: 52070e42aa20856c1e25e1ac4ee3cc650258c256088396ce8ff325dc942dcd1b831dab5d905dbcc577a6217d0270973caa04de91f314ed71938614bea913d82b
7
+ data.tar.gz: ed06bcee4d2b1ce6f825bcade230e976123760ba3bddf9dc84e4544221ff518ffb2cadd63bd2b8cab5d8358fd574700fe8ed462483807b452c09d2e3f7198e45
data/lib/appl.rb CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  class Application
7
7
 
8
- APPL_VERSION = "1.15".freeze
8
+ APPL_VERSION = "1.17".freeze
9
9
 
10
10
  OPTIONS_ENV = nil
11
11
 
@@ -71,9 +71,11 @@ class Application
71
71
 
72
72
  def execute
73
73
  r = run
74
- r = 0 unless Integer === r
75
74
  warn_unprocessed
76
- r
75
+ case r
76
+ when Integer then r & 0xff
77
+ else 0
78
+ end
77
79
  rescue SignalException
78
80
  raise if @debug
79
81
  self.class.show_message $!.inspect
@@ -86,6 +88,10 @@ class Application
86
88
 
87
89
  class <<self
88
90
 
91
+ def is_cmd?
92
+ const_defined? :NAME
93
+ end
94
+
89
95
  def run args = nil
90
96
  e = execute args
91
97
  exit e
data/lib/applfan.rb CHANGED
@@ -20,7 +20,10 @@ class ApplicationFan < Application
20
20
  attr_accessor :commands
21
21
 
22
22
  def find_command name
23
- @commands.find { |c| c::NAME == name or c::ALIASES.include? name }
23
+ @commands.find { |c|
24
+ next unless c.is_cmd?
25
+ c::NAME == name or c::ALIASES.include? name
26
+ }
24
27
  end
25
28
 
26
29
 
@@ -33,6 +36,7 @@ class ApplicationFan < Application
33
36
  puts self::AVAILCMDS
34
37
  puts
35
38
  @commands.each { |c|
39
+ next unless c.is_cmd?
36
40
  puts " %-*s %s" % [ self::W_CMDS, c.all_names, c::SUMMARY]
37
41
  }
38
42
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appl
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.15'
4
+ version: '1.17'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bertram Scharpf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-31 00:00:00.000000000 Z
11
+ date: 2024-02-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  A base class for command line applications doing options parsing
@@ -42,7 +42,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
42
42
  version: '0'
43
43
  requirements:
44
44
  - Just Ruby
45
- rubygems_version: 3.0.8
45
+ rubygems_version: 3.5.5
46
46
  signing_key:
47
47
  specification_version: 4
48
48
  summary: Easy option parsing