main 6.2.2 → 6.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/Rakefile +0 -8
- data/lib/main/cast.rb +9 -9
- data/lib/main/daemon.rb +1 -1
- data/lib/main/mode.rb +0 -1
- data/lib/main/parameter.rb +1 -3
- data/lib/main/program/class_methods.rb +15 -3
- data/lib/main/program/instance_methods.rb +9 -16
- data/lib/main/test.rb +4 -4
- data/lib/main/usage.rb +17 -18
- data/lib/main/util.rb +1 -1
- data/lib/main.rb +5 -6
- data/main.gemspec +5 -7
- data/test/main_test.rb +6 -15
- metadata +40 -43
- data/a.rb +0 -28
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NzQ0ZDRkYzc1MDVlMjAwMGRkYzUxNGU0Y2I1MmRhNzJjYzlkNjY1NQ==
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7b6289d780438645efdd78c3c1dd205d93af94185ee591e7abbccd7f9092637f
|
4
|
+
data.tar.gz: 566196b12fb4268421df5f0a87ed1fdafb46424688b62bfedae86f477bb8a610
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
YzhlMDRkZTMyY2EwZTcwN2Q4YmU1NmQ1MGRlZTU3MGUxNDkwMDc4MTM5M2Ix
|
11
|
-
ZTg3OTdjMWE0YmZmYzA3YjlkNzI5ZWJmNTRhYTNhZWYwMTkyYzY=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
OTVjZjcwODE3ODIyODk5Yzk4NzQxYTc4Zjk4MTVhNTY3MjFlMTVjMzA2MTBi
|
14
|
-
MzE2YzI3NzRkM2IyN2ZkNGIzNzE2NjI2OWUzZmQ4ZDY2MzdkODBiYWMwZTcx
|
15
|
-
ZTU5YmE2ZGM0MzI1YTgyNzNiMGMyMzBlZTNjNjQ5ZmEzMTZiNjk=
|
6
|
+
metadata.gz: dcf296c3b1d49b6f4c001ac582d108cda0a12547827ef63c3310ff52342fca6c4b9c73556c19e68e7933cc688c74fd83cae3631f1b0fa3d576a1aabbd6f1205c
|
7
|
+
data.tar.gz: e064f2590b78ac9a900716f09771254599084d307356d5c8ffca51acf69790f62068d561bb3d98d7210b71737d896b47d7f30392585212a295ac2d3c13aa58c2
|
data/Rakefile
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
This.rubyforge_project = 'codeforpeople'
|
2
1
|
This.author = "Ara T. Howard"
|
3
2
|
This.email = "ara.t.howard@gmail.com"
|
4
3
|
This.homepage = "https://github.com/ahoward/#{ This.lib }"
|
@@ -145,7 +144,6 @@ task :gemspec do
|
|
145
144
|
|
146
145
|
spec.extensions.push(*<%= extensions.inspect %>)
|
147
146
|
|
148
|
-
spec.rubyforge_project = <%= This.rubyforge_project.inspect %>
|
149
147
|
spec.author = <%= This.author.inspect %>
|
150
148
|
spec.email = <%= This.email.inspect %>
|
151
149
|
spec.homepage = <%= This.homepage.inspect %>
|
@@ -230,12 +228,6 @@ task :release => [:clean, :gemspec, :gem] do
|
|
230
228
|
puts
|
231
229
|
system(cmd)
|
232
230
|
abort("cmd(#{ cmd }) failed with (#{ $?.inspect })") unless $?.exitstatus.zero?
|
233
|
-
|
234
|
-
cmd = "rubyforge login && rubyforge add_release #{ This.rubyforge_project } #{ This.lib } #{ This.version } #{ This.gem }"
|
235
|
-
puts cmd
|
236
|
-
puts
|
237
|
-
system(cmd)
|
238
|
-
abort("cmd(#{ cmd }) failed with (#{ $?.inspect })") unless $?.exitstatus.zero?
|
239
231
|
end
|
240
232
|
|
241
233
|
|
data/lib/main/cast.rb
CHANGED
@@ -7,10 +7,15 @@ module Main
|
|
7
7
|
|
8
8
|
List = []
|
9
9
|
|
10
|
-
def
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
def Cast.cast(*args, &block)
|
11
|
+
if args.first && block
|
12
|
+
method = args.shift
|
13
|
+
define_method(method, &block)
|
14
|
+
export(method)
|
15
|
+
List << (method.to_s)
|
16
|
+
else
|
17
|
+
Cast.send(*args)
|
18
|
+
end
|
14
19
|
end
|
15
20
|
|
16
21
|
cast :boolean do |obj|
|
@@ -152,12 +157,7 @@ module Main
|
|
152
157
|
m
|
153
158
|
raise ArgumentError, "ambiguous cast: #{ sym.inspect } (#{ List.join ',' })" unless
|
154
159
|
candidates.empty? or m.to_s == sym.to_s
|
155
|
-
this = self
|
156
160
|
lambda{|obj| method(m).call obj}
|
157
161
|
end
|
158
|
-
|
159
|
-
def Cast.cast(which, *args, &block)
|
160
|
-
Cast.send(which, *args, &block)
|
161
|
-
end
|
162
162
|
end
|
163
163
|
end
|
data/lib/main/daemon.rb
CHANGED
data/lib/main/mode.rb
CHANGED
data/lib/main/parameter.rb
CHANGED
@@ -240,8 +240,6 @@ module Main
|
|
240
240
|
self
|
241
241
|
end
|
242
242
|
|
243
|
-
this = self
|
244
|
-
|
245
243
|
%w[ before instead after ].each do |which|
|
246
244
|
getter = "error_handler_#{ which }"
|
247
245
|
query = "error_handler_#{ which }?"
|
@@ -462,7 +460,7 @@ module Main
|
|
462
460
|
i += 1
|
463
461
|
b = argv[idx + 1]
|
464
462
|
s = "#{ a }#{ b }"
|
465
|
-
m, key, *
|
463
|
+
m, key, * = kre.match(s).to_a
|
466
464
|
if m
|
467
465
|
replacements[i] ||= a.gsub %r/^\s*#{ key }/, opt
|
468
466
|
next
|
@@ -71,6 +71,7 @@ module Main
|
|
71
71
|
define_method(:run, &block) if block
|
72
72
|
wrap_run!
|
73
73
|
end
|
74
|
+
|
74
75
|
program
|
75
76
|
end
|
76
77
|
|
@@ -78,6 +79,9 @@ module Main
|
|
78
79
|
|
79
80
|
def new()
|
80
81
|
instance = allocate
|
82
|
+
|
83
|
+
setup_finalizers(instance)
|
84
|
+
|
81
85
|
instance.instance_eval do
|
82
86
|
pre_initialize()
|
83
87
|
before_initialize()
|
@@ -86,9 +90,18 @@ module Main
|
|
86
90
|
after_initialize()
|
87
91
|
post_initialize()
|
88
92
|
end
|
93
|
+
|
89
94
|
instance
|
90
95
|
end
|
91
96
|
|
97
|
+
def setup_finalizers(instance)
|
98
|
+
instance.finalizers = (finalizers = [])
|
99
|
+
|
100
|
+
ObjectSpace.define_finalizer(instance) do
|
101
|
+
while((f = finalizers.pop)); f.call; end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
92
105
|
def params
|
93
106
|
parameters
|
94
107
|
end
|
@@ -107,7 +120,6 @@ module Main
|
|
107
120
|
#
|
108
121
|
def dynamically_extend_via_commandline_modes!
|
109
122
|
self.breadth_first_modes = modes.dup
|
110
|
-
size = modes.size
|
111
123
|
|
112
124
|
loop do
|
113
125
|
modes.each do |mode|
|
@@ -185,7 +197,7 @@ module Main
|
|
185
197
|
def usage(*args, &block)
|
186
198
|
usage! unless defined? @usage
|
187
199
|
return @usage if args.empty? and block.nil?
|
188
|
-
key, value, *
|
200
|
+
key, value, * = args
|
189
201
|
value = block.call if block
|
190
202
|
@usage[key.to_s] = value.to_s
|
191
203
|
end
|
@@ -367,7 +379,7 @@ module Main
|
|
367
379
|
else
|
368
380
|
[]
|
369
381
|
end
|
370
|
-
|
382
|
+
lines.shift if lines.first.to_s =~ /^---/
|
371
383
|
require 'fileutils' unless defined?(FileUtils)
|
372
384
|
FileUtils.mkdir_p(File.dirname(config_path))
|
373
385
|
open(config_path, 'w') do |fd|
|
@@ -12,8 +12,8 @@ module Main
|
|
12
12
|
fattr('stderr'){ main.stderr }
|
13
13
|
fattr('logger'){ main.logger }
|
14
14
|
fattr('script'){ main.script }
|
15
|
-
fattr('params')
|
16
|
-
fattr('finalizers')
|
15
|
+
fattr('params'){ Parameter::Table.new }
|
16
|
+
fattr('finalizers'){ [] }
|
17
17
|
|
18
18
|
%w(
|
19
19
|
program name synopsis description author version
|
@@ -51,16 +51,11 @@ module Main
|
|
51
51
|
def post_initialize() :hook end
|
52
52
|
|
53
53
|
def setup_finalizers
|
54
|
-
|
55
|
-
finalizers = @finalizers
|
56
|
-
ObjectSpace.define_finalizer(self) do
|
57
|
-
while((f = finalizers.pop)); f.call; end
|
58
|
-
end
|
54
|
+
self.class.setup_finalizers(self)
|
59
55
|
end
|
60
56
|
|
61
57
|
def finalize
|
62
|
-
|
63
|
-
while((f = @finalizers.pop)); f.call; end
|
58
|
+
while((f = finalizers.pop)); f.call; end
|
64
59
|
end
|
65
60
|
|
66
61
|
def setup_io_redirection
|
@@ -92,10 +87,9 @@ module Main
|
|
92
87
|
end
|
93
88
|
|
94
89
|
def setup_io_restoration
|
95
|
-
@finalizers ||= []
|
96
90
|
[STDIN, STDOUT, STDERR].each do |io|
|
97
91
|
dup = io.dup
|
98
|
-
|
92
|
+
finalizers.push(
|
99
93
|
lambda do
|
100
94
|
io.reopen(dup)
|
101
95
|
end
|
@@ -111,7 +105,7 @@ module Main
|
|
111
105
|
io
|
112
106
|
else
|
113
107
|
fd = open(io.to_s, 'r+')
|
114
|
-
|
108
|
+
finalizers.push(lambda{ fd.close })
|
115
109
|
fd
|
116
110
|
end
|
117
111
|
begin
|
@@ -132,7 +126,7 @@ module Main
|
|
132
126
|
io
|
133
127
|
else
|
134
128
|
fd = open(io.to_s, 'w+')
|
135
|
-
|
129
|
+
finalizers.push(lambda{ fd.close })
|
136
130
|
fd
|
137
131
|
end
|
138
132
|
begin
|
@@ -153,7 +147,7 @@ module Main
|
|
153
147
|
io
|
154
148
|
else
|
155
149
|
fd = open(io.to_s, 'w+')
|
156
|
-
|
150
|
+
finalizers.push(lambda{ fd.close })
|
157
151
|
fd
|
158
152
|
end
|
159
153
|
begin
|
@@ -173,8 +167,7 @@ module Main
|
|
173
167
|
before_parse_parameters
|
174
168
|
|
175
169
|
self.class.parameters.parse(self)
|
176
|
-
|
177
|
-
self.class.parameters.each{|p| @params[p.name.to_s] = p}
|
170
|
+
self.class.parameters.each{|p| params[p.name.to_s] = p}
|
178
171
|
|
179
172
|
after_parse_parameters
|
180
173
|
post_parse_parameters
|
data/lib/main/test.rb
CHANGED
@@ -11,10 +11,10 @@ module Main
|
|
11
11
|
|
12
12
|
argv = options[:argv]
|
13
13
|
env = options[:env]
|
14
|
-
logger = options[:logger]
|
15
|
-
stdin = options[:stdin]
|
16
|
-
stdout = options[:stdout]
|
17
|
-
stderr = options[:stderr]
|
14
|
+
#logger = options[:logger]
|
15
|
+
#stdin = options[:stdin]
|
16
|
+
#stdout = options[:stdout]
|
17
|
+
#stderr = options[:stderr]
|
18
18
|
|
19
19
|
Main.push_ios!
|
20
20
|
|
data/lib/main/usage.rb
CHANGED
@@ -142,27 +142,26 @@ module Main
|
|
142
142
|
|
143
143
|
parameters = arguments + keywords + options + environment
|
144
144
|
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
145
|
+
parameters.map do |p|
|
146
|
+
ps = ''
|
147
|
+
ps << Util.columnize("#{ p.synopsis }", :indent => 2, :width => 78)
|
148
|
+
#ps << Util.columnize("* #{ p.synopsis }", :indent => 2, :width => 78)
|
149
|
+
#ps << "\n"
|
150
|
+
if p.description?
|
151
|
+
ps << "\n"
|
152
|
+
ps << Util.columnize("#{ p.description }", :indent => 6, :width => 78)
|
153
|
+
#ps << Util.columnize(p.description, :indent => 6, :width => 78)
|
150
154
|
#ps << "\n"
|
151
|
-
|
155
|
+
end
|
156
|
+
#ps << "\n"
|
157
|
+
unless(p.examples.nil? or p.examples.empty?)
|
158
|
+
p.examples.each do |example|
|
152
159
|
ps << "\n"
|
153
|
-
ps << Util.columnize("#{
|
154
|
-
#ps << Util.columnize(p.description, :indent => 6, :width => 78)
|
155
|
-
#ps << "\n"
|
160
|
+
ps << Util.columnize("#{ example }", :indent => 8, :width => 78)
|
156
161
|
end
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
ps << "\n"
|
161
|
-
ps << Util.columnize("#{ example }", :indent => 8, :width => 78)
|
162
|
-
end
|
163
|
-
end
|
164
|
-
ps
|
165
|
-
end.join("\n")
|
162
|
+
end
|
163
|
+
ps
|
164
|
+
end.join("\n")
|
166
165
|
end
|
167
166
|
|
168
167
|
def author_section
|
data/lib/main/util.rb
CHANGED
@@ -44,7 +44,7 @@ module Main
|
|
44
44
|
def columnize buf, opts = {}
|
45
45
|
width = Util.getopt 'width', opts, 80
|
46
46
|
indent = Util.getopt 'indent', opts
|
47
|
-
indent =
|
47
|
+
indent = Numeric === indent ? (' ' * indent.to_i) : "#{ indent }"
|
48
48
|
column = []
|
49
49
|
words = buf.split %r/\s+/o
|
50
50
|
row = "#{ indent }"
|
data/lib/main.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Main
|
2
2
|
# top level constants
|
3
3
|
#
|
4
|
-
Main::VERSION = '6.
|
4
|
+
Main::VERSION = '6.3.0' unless
|
5
5
|
defined? Main::VERSION
|
6
6
|
def Main.version() Main::VERSION end
|
7
7
|
|
@@ -11,7 +11,6 @@ module Main
|
|
11
11
|
|
12
12
|
Main::LIBDIR = File.join(File.dirname(File.expand_path(__FILE__)), self.name.downcase, '') unless
|
13
13
|
defined? Main::LIBDIR
|
14
|
-
def self.libdir() Main::LIBDIR end
|
15
14
|
|
16
15
|
Main::EXIT_SUCCESS = 0 unless defined? Main::EXIT_SUCCESS
|
17
16
|
Main::EXIT_FAILURE = 1 unless defined? Main::EXIT_FAILURE
|
@@ -22,10 +21,10 @@ module Main
|
|
22
21
|
#
|
23
22
|
def Main.dependencies
|
24
23
|
{
|
25
|
-
'chronic' => [ 'chronic', '~> 0.
|
26
|
-
'fattr' => [ 'fattr', '~> 2.
|
27
|
-
'arrayfields' => [ 'arrayfields', '~> 4.
|
28
|
-
'map' => [ 'map', '~> 6.
|
24
|
+
'chronic' => [ 'chronic', '~> 0.10', '>= 0.10.2' ] ,
|
25
|
+
'fattr' => [ 'fattr', '~> 2.4', '>= 2.4.0' ] ,
|
26
|
+
'arrayfields' => [ 'arrayfields', '~> 4.9', '>= 4.9.2' ] ,
|
27
|
+
'map' => [ 'map', '~> 6.6', '>= 6.6.0' ] ,
|
29
28
|
}
|
30
29
|
end
|
31
30
|
|
data/main.gemspec
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
Gem::Specification::new do |spec|
|
5
5
|
spec.name = "main"
|
6
|
-
spec.version = "6.
|
6
|
+
spec.version = "6.3.0"
|
7
7
|
spec.platform = Gem::Platform::RUBY
|
8
8
|
spec.summary = "main"
|
9
9
|
spec.description = "a class factory and dsl for generating command line programs real quick"
|
@@ -14,7 +14,6 @@ Gem::Specification::new do |spec|
|
|
14
14
|
"README.erb",
|
15
15
|
"Rakefile",
|
16
16
|
"TODO",
|
17
|
-
"a.rb",
|
18
17
|
"lib",
|
19
18
|
"lib/main",
|
20
19
|
"lib/main.rb",
|
@@ -56,18 +55,17 @@ Gem::Specification::new do |spec|
|
|
56
55
|
spec.test_files = nil
|
57
56
|
|
58
57
|
|
59
|
-
spec.add_dependency(*["chronic", "~> 0.
|
58
|
+
spec.add_dependency(*["chronic", "~> 0.10", ">= 0.10.2"])
|
60
59
|
|
61
|
-
spec.add_dependency(*["fattr", "~> 2.
|
60
|
+
spec.add_dependency(*["fattr", "~> 2.4", ">= 2.4.0"])
|
62
61
|
|
63
|
-
spec.add_dependency(*["arrayfields", "~> 4.
|
62
|
+
spec.add_dependency(*["arrayfields", "~> 4.9", ">= 4.9.2"])
|
64
63
|
|
65
|
-
spec.add_dependency(*["map", "~> 6.
|
64
|
+
spec.add_dependency(*["map", "~> 6.6", ">= 6.6.0"])
|
66
65
|
|
67
66
|
|
68
67
|
spec.extensions.push(*[])
|
69
68
|
|
70
|
-
spec.rubyforge_project = "codeforpeople"
|
71
69
|
spec.author = "Ara T. Howard"
|
72
70
|
spec.email = "ara.t.howard@gmail.com"
|
73
71
|
spec.homepage = "https://github.com/ahoward/main"
|
data/test/main_test.rb
CHANGED
@@ -117,7 +117,6 @@ class T < Test::Unit::TestCase
|
|
117
117
|
# parameter parsing
|
118
118
|
#
|
119
119
|
def test_0080
|
120
|
-
p = nil
|
121
120
|
assert_raises(Main::Parameter::NotGiven){
|
122
121
|
main(){
|
123
122
|
argument 'foo'
|
@@ -129,7 +128,6 @@ class T < Test::Unit::TestCase
|
|
129
128
|
p = nil
|
130
129
|
m = nil
|
131
130
|
argv = %w[ 42 ]
|
132
|
-
given = nil
|
133
131
|
assert_nothing_raised{
|
134
132
|
main(argv.dup){
|
135
133
|
argument 'foo'
|
@@ -144,7 +142,6 @@ class T < Test::Unit::TestCase
|
|
144
142
|
def test_0100
|
145
143
|
p = nil
|
146
144
|
argv = %w[]
|
147
|
-
given = nil
|
148
145
|
assert_nothing_raised{
|
149
146
|
main(argv){
|
150
147
|
p = argument('foo'){ optional }
|
@@ -160,7 +157,6 @@ class T < Test::Unit::TestCase
|
|
160
157
|
def test_0101
|
161
158
|
p = nil
|
162
159
|
argv = %w[]
|
163
|
-
given = nil
|
164
160
|
assert_nothing_raised{
|
165
161
|
main(argv){
|
166
162
|
p = argument('foo'){ required false }
|
@@ -492,12 +488,12 @@ class T < Test::Unit::TestCase
|
|
492
488
|
#
|
493
489
|
def test_0280
|
494
490
|
assert_nothing_raised{
|
495
|
-
|
491
|
+
Main::Usage.new
|
496
492
|
}
|
497
493
|
end
|
498
494
|
def test_0290
|
499
495
|
assert_nothing_raised{
|
500
|
-
|
496
|
+
Main::Usage.default(Main.factory)
|
501
497
|
}
|
502
498
|
end
|
503
499
|
def test_0300
|
@@ -733,32 +729,29 @@ class T < Test::Unit::TestCase
|
|
733
729
|
assert m.param['zero_or_more'].values == argv
|
734
730
|
end
|
735
731
|
def test_0450
|
736
|
-
m = nil
|
737
732
|
argv = %w()
|
738
733
|
assert_raises(Main::Parameter::NotGiven){
|
739
734
|
main(argv.dup) {
|
740
735
|
argument('one_or_more'){ arity(-2) }
|
741
|
-
run{
|
736
|
+
run{ self }
|
742
737
|
}
|
743
738
|
}
|
744
739
|
end
|
745
740
|
def test_0460
|
746
|
-
m = nil
|
747
741
|
argv = %w( a )
|
748
742
|
assert_raises(Main::Parameter::Arity){
|
749
743
|
main(argv.dup) {
|
750
744
|
argument('two_or_more'){ arity(-3) }
|
751
|
-
run{
|
745
|
+
run{ self }
|
752
746
|
}
|
753
747
|
}
|
754
748
|
end
|
755
749
|
def test_0470
|
756
|
-
m = nil
|
757
750
|
argv = %w( a )
|
758
751
|
assert_raises(Main::Parameter::Arity){
|
759
752
|
main(argv.dup) {
|
760
753
|
argument('two_or_more'){ arity(-4) }
|
761
|
-
run{
|
754
|
+
run{ self }
|
762
755
|
}
|
763
756
|
}
|
764
757
|
end
|
@@ -830,12 +823,11 @@ class T < Test::Unit::TestCase
|
|
830
823
|
#
|
831
824
|
def test_0500
|
832
825
|
name = 'arity_zero_paramter_attr'
|
833
|
-
m = nil
|
834
826
|
argv = %w( )
|
835
827
|
assert_raises(Main::Parameter::Arity){
|
836
828
|
main(argv.dup) {
|
837
829
|
argument(name){ arity 0 }
|
838
|
-
run{
|
830
|
+
run{ self }
|
839
831
|
}
|
840
832
|
}
|
841
833
|
end
|
@@ -897,7 +889,6 @@ class T < Test::Unit::TestCase
|
|
897
889
|
end
|
898
890
|
|
899
891
|
def test_0550
|
900
|
-
name = 'mode_argument_with_help_parameter_outputs_help'
|
901
892
|
p = nil
|
902
893
|
argv = %w( foo help )
|
903
894
|
assert_nothing_raised{
|
metadata
CHANGED
@@ -1,95 +1,95 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: main
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ara T. Howard
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chronic
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
20
|
-
- -
|
19
|
+
version: '0.10'
|
20
|
+
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.
|
22
|
+
version: 0.10.2
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- - ~>
|
27
|
+
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '0.
|
30
|
-
- -
|
29
|
+
version: '0.10'
|
30
|
+
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.
|
32
|
+
version: 0.10.2
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: fattr
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - ~>
|
37
|
+
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '2.
|
40
|
-
- -
|
39
|
+
version: '2.4'
|
40
|
+
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 2.
|
42
|
+
version: 2.4.0
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- - ~>
|
47
|
+
- - "~>"
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: '2.
|
50
|
-
- -
|
49
|
+
version: '2.4'
|
50
|
+
- - ">="
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: 2.
|
52
|
+
version: 2.4.0
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: arrayfields
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
|
-
- - ~>
|
57
|
+
- - "~>"
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: '4.
|
60
|
-
- -
|
59
|
+
version: '4.9'
|
60
|
+
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 4.
|
62
|
+
version: 4.9.2
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- - ~>
|
67
|
+
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '4.
|
70
|
-
- -
|
69
|
+
version: '4.9'
|
70
|
+
- - ">="
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version: 4.
|
72
|
+
version: 4.9.2
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: map
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
76
76
|
requirements:
|
77
|
-
- - ~>
|
77
|
+
- - "~>"
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
version: '6.
|
80
|
-
- -
|
79
|
+
version: '6.6'
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 6.
|
82
|
+
version: 6.6.0
|
83
83
|
type: :runtime
|
84
84
|
prerelease: false
|
85
85
|
version_requirements: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - ~>
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '6.
|
90
|
-
- -
|
89
|
+
version: '6.6'
|
90
|
+
- - ">="
|
91
91
|
- !ruby/object:Gem::Version
|
92
|
-
version: 6.
|
92
|
+
version: 6.6.0
|
93
93
|
description: a class factory and dsl for generating command line programs real quick
|
94
94
|
email: ara.t.howard@gmail.com
|
95
95
|
executables: []
|
@@ -100,7 +100,6 @@ files:
|
|
100
100
|
- README.erb
|
101
101
|
- Rakefile
|
102
102
|
- TODO
|
103
|
-
- a.rb
|
104
103
|
- lib/main.rb
|
105
104
|
- lib/main/cast.rb
|
106
105
|
- lib/main/daemon.rb
|
@@ -133,25 +132,23 @@ homepage: https://github.com/ahoward/main
|
|
133
132
|
licenses:
|
134
133
|
- Ruby
|
135
134
|
metadata: {}
|
136
|
-
post_install_message:
|
135
|
+
post_install_message:
|
137
136
|
rdoc_options: []
|
138
137
|
require_paths:
|
139
138
|
- lib
|
140
139
|
required_ruby_version: !ruby/object:Gem::Requirement
|
141
140
|
requirements:
|
142
|
-
- -
|
141
|
+
- - ">="
|
143
142
|
- !ruby/object:Gem::Version
|
144
143
|
version: '0'
|
145
144
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
145
|
requirements:
|
147
|
-
- -
|
146
|
+
- - ">="
|
148
147
|
- !ruby/object:Gem::Version
|
149
148
|
version: '0'
|
150
149
|
requirements: []
|
151
|
-
|
152
|
-
|
153
|
-
signing_key:
|
150
|
+
rubygems_version: 3.3.7
|
151
|
+
signing_key:
|
154
152
|
specification_version: 4
|
155
153
|
summary: main
|
156
154
|
test_files: []
|
157
|
-
has_rdoc:
|
data/a.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
require_relative './lib/main.rb'
|
2
|
-
|
3
|
-
Main{
|
4
|
-
daemonizes!
|
5
|
-
|
6
|
-
def run
|
7
|
-
i = 0
|
8
|
-
|
9
|
-
loop do
|
10
|
-
p argv
|
11
|
-
p i
|
12
|
-
sleep(3 + rand)
|
13
|
-
i += 1
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
}
|
22
|
-
|
23
|
-
|
24
|
-
__END__
|
25
|
-
|
26
|
-
|
27
|
-
a.rb daemon start
|
28
|
-
a.rb daemon stop
|