convoy 1.0.0 → 1.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62e64e31cb32b012e592465bee8d1447f7a996b4
4
- data.tar.gz: 0787f79d59ffa58a26d8a6f51cfb5aa84e67146f
3
+ metadata.gz: dce20ef0475a98ad8e3db17accdd52cf40df9402
4
+ data.tar.gz: f2cc919519e7b9ced080175d7630713536c5feac
5
5
  SHA512:
6
- metadata.gz: 8ee90b28c6f9775eb877047900a510cc74da752b7ad014f617e7bb8057eb5cf94a2f8ce0e16a2cf0c599b09d4c846eecf918197c0749a6f7751f30e9b089edac
7
- data.tar.gz: a58865ac6fe810286734579e6b179cb1c3132f34856c8cf678f947a905508bd7389529eabc6f551687f5f894db76b18b71c89d6b0e59ea15d357f5656794f4b5
6
+ metadata.gz: daa739a479de1c0685623e4686d6f4422a23ee1981de993d29bf5880f222ab70211d22bf80dba6ef1b5c865bf479eb577d06573433cd225b92facd9c7bb5dcc9
7
+ data.tar.gz: dcac8c553f276f5f623b3f68fc943c78a5a92b9a8118a29d78e2e8bdf28d748f739210a69216da78107acb826c0820961a0687726a5833a557c9dd7a653811ba
data/convoy.gemspec CHANGED
@@ -4,7 +4,7 @@ require 'date'
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'convoy'
7
- s.version = '1.0.0'
7
+ s.version = '1.1.0'
8
8
  s.date = Date.today.to_s
9
9
  s.summary = %q{A library that makes building command line apps in ruby so easy, you'll feel like an expert is guiding you through it}
10
10
  s.description = %q{Writing even complex command-line apps should be quick, easy and fun. Convoy takes the excellent Trollop option parser and adds a whole bunch of awesome features to produce a library you will always want to turn to when a 'quick script' is in order.}
data/lib/convoy/app.rb CHANGED
@@ -121,7 +121,7 @@ module Convoy
121
121
 
122
122
  def print_convoy_error_message(e)
123
123
  print_stacktrace(e)
124
- error_logger.warn {"\n \x1B[48;5;196m ERROR \x1B[0m An internal Convoy error occurred.\n\n You should probably report it to \x1B[38;5;222mAlbert Rannetsperger\x1B[0m or create an issue on his \x1B[38;5;222mGitHub\x1B[0m page (https://github.com/alb3rtuk).\n Make sure to include the stacktrace above (although it probably won't be very helpful).bp\n\n"}
124
+ error_logger.warn {"\n \x1B[48;5;196m ERROR \x1B[0m An internal Convoy error occurred.\n\n You should probably report it to \x1B[38;5;222mAlbert Rannetsperger\x1B[0m or create an issue on his \x1B[38;5;222mGitHub\x1B[0m page (https://github.com/alb3rtuk).\n Make sure to include the stacktrace above (although the way Ruby works, it probably won't be very helpful).\n"}
125
125
  end
126
126
  end
127
127
  end
@@ -12,18 +12,21 @@ module Convoy
12
12
  options = Options.new(parser, setup, context)
13
13
  commands = Commands.new(setup, context)
14
14
  current_command = Commands.command_for(setup, context)
15
- system('clear')
15
+ # Uncomment the following line if you want the screen
16
+ # to be cleared before the --help messages show.
17
+ #
18
+ # system('clear')
16
19
  puts
17
20
  StreamOutputFormatter.new($stdout, :max_output_width => Terminal.width) do |f|
18
21
  if setup.summary_for != '' && !setup.summary_for.nil?
19
22
  f.puts setup.summary_for, :newlines => 2
20
23
  end
21
- if (setup.description_for != '' && !setup.description_for.nil?) && current_command.summary == setup.summary_for
22
- f.indent(4) do |f_inner|
23
- f_inner.puts setup.description_for, :newlines => 2
24
- end
25
- end
26
- # name_help(current_command, f)
24
+ # if (setup.description_for != '' && !setup.description_for.nil?) && current_command.summary == setup.summary_for
25
+ # f.indent(4) do |f_inner|
26
+ # f_inner.puts setup.description_for, :newlines => 2
27
+ # end
28
+ # end
29
+ name_help(current_command, f)
27
30
  usage_help(current_command, f)
28
31
  version_help(current_command, f)
29
32
  commands_help(commands, f)
@@ -34,13 +37,15 @@ module Convoy
34
37
  private
35
38
 
36
39
  def name_help(current_command, f)
37
- f.puts "\x1B[38;5;84mNAME\x1B[0m"
38
- f.indent(4) do |f|
39
- f.grid(:columns => 3) do |t|
40
- t.row current_command.script_name, '-', setup.summary_for(context)
40
+ # f.puts "\x1B[38;5;84mNAME\x1B[0m"
41
+ if setup.description_for(context) != ''
42
+ f.indent(4) do |f|
43
+ # f.grid(:columns => 3) do |t|
44
+ # t.row current_command.script_name, '-', setup.summary_for(context)
45
+ # end
46
+ # f.newline
47
+ f.puts(setup.description_for(context), :newlines => 2)
41
48
  end
42
- f.newline
43
- f.puts(setup.description_for(context), :newlines => 2) if setup.description_for(context)
44
49
  end
45
50
  end
46
51
 
@@ -358,7 +358,7 @@ module Trollop
358
358
  @long[$1] || @long["no-#{$1}"]
359
359
  else
360
360
  # raise CommandlineError, "invalid argument syntax: '#{arg}'"
361
- puts "\n \x1B[48;5;196m ERROR \x1B[0m \xe2\x80\x94 Invalid argument syntax: \x1B[38;5;123m#{arg}\x1B[0m\n\n"
361
+ puts "\n \x1B[48;5;196m ERROR \x1B[0m \xe2\x80\x94 Invalid argument syntax: #{arg}\n\n"
362
362
  exit
363
363
  end
364
364
 
@@ -366,13 +366,13 @@ module Trollop
366
366
 
367
367
  # raise CommandlineError, "unknown argument '#{arg}'" unless sym
368
368
  unless sym
369
- puts "\n \x1B[48;5;196m ERROR \x1B[0m \xe2\x80\x94 Unknown flag: \x1B[38;5;123m#{arg}\x1B[0m\n\n"
369
+ puts "\n \x1B[48;5;196m ERROR \x1B[0m \xe2\x80\x94 Unknown flag: #{arg}\n\n"
370
370
  exit
371
371
  end
372
372
 
373
373
  if given_args.include?(sym) && !@specs[sym][:multi]
374
374
  # raise CommandlineError, "option '#{arg}' specified multiple times"
375
- puts "\n \x1B[48;5;196m ERROR \x1B[0m \xe2\x80\x94 Flag specified multiple times: \x1B[38;5;123m#{arg}\x1B[0m\n\n"
375
+ puts "\n \x1B[48;5;196m ERROR \x1B[0m \xe2\x80\x94 Flag specified multiple times: #{arg}\n\n"
376
376
  exit
377
377
  end
378
378
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: convoy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Albert Rannetsperger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-08 00:00:00.000000000 Z
11
+ date: 2015-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nesty