base_app 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/base_app.rb +5 -5
- metadata +2 -2
data/lib/base_app.rb
CHANGED
@@ -11,7 +11,7 @@ class BaseApp
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def command_line_arguments
|
14
|
-
[['
|
14
|
+
[['v','verbose','Be more verbose']]
|
15
15
|
end
|
16
16
|
|
17
17
|
def construct_opts
|
@@ -49,14 +49,14 @@ class BaseApp
|
|
49
49
|
app = self.new
|
50
50
|
app.parse_command_line_options
|
51
51
|
max_width = app.command_line_arguments.map {|x| x[1].length}.max
|
52
|
-
|
53
|
-
puts "#$0 Parameters:"
|
52
|
+
if app.verbose
|
53
|
+
$stderr.puts "#$0 Parameters:"
|
54
54
|
app.command_line_arguments.each do |opt_spec|
|
55
55
|
short, arg, descr = opt_spec
|
56
56
|
option = arg.gsub(/=$/,'').gsub('-','_')
|
57
|
-
printf( " %*s : %s\n", max_width, arg.gsub('=',''), app.send(option.to_sym))
|
57
|
+
$stderr.printf( " %*s : %s\n", max_width, arg.gsub('=',''), app.send(option.to_sym))
|
58
58
|
end
|
59
|
-
puts ""
|
59
|
+
$stderr.puts ""
|
60
60
|
end
|
61
61
|
app.run
|
62
62
|
exit app.status
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: base_app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Burton
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2010-01-
|
13
|
+
date: 2010-01-13 00:00:00 -05:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|