docubot 0.5 → 0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,21 +9,22 @@ require 'docubot'
9
9
 
10
10
  USAGE = <<ENDUSAGE
11
11
  Usage:
12
- docubot [-h] [create [-s shell] [-f]] directory [-w writer] [-o output_file]
12
+ docubot [-h] [create [-s shell] [-f]] directory [-w writer] [-o output_file] [-n]
13
13
  ENDUSAGE
14
14
 
15
15
  HELP = <<ENDHELP
16
- -h, --help Show this help.
17
- create Create a starter directory filled with example files;
18
- also copies the template for easy modification, if desired.
19
- -s, --shell The shell to copy from.
20
- Available shells: #{DocuBot::SHELLS.join(', ')}
21
- -f, --force Force create over an existing directory,
22
- deleting any existing files.
23
- -w, --writer The output type to create [Defaults to 'chm']
24
- Available writers: #{DocuBot::Writer::INSTALLED_WRITERS.join(', ')}
25
- -o, --output The file or folder (depending on the writer) to create.
26
- [Default value depends on the writer chosen.]
16
+ -h, --help Show this help.
17
+ create Create a starter directory filled with example files;
18
+ also copies the template for easy modification, if desired.
19
+ -s, --shell The shell to copy from.
20
+ Available shells: #{DocuBot::SHELLS.join(', ')}
21
+ -f, --force Force create over an existing directory,
22
+ deleting any existing files.
23
+ -w, --writer The output type to create [Defaults to 'chm']
24
+ Available writers: #{DocuBot::Writer::INSTALLED_WRITERS.join(', ')}
25
+ -o, --output The file or folder (depending on the writer) to create.
26
+ [Default value depends on the writer chosen.]
27
+ -n, --nopreview Disable automatic preview of .chm.
27
28
 
28
29
  ENDHELP
29
30
 
@@ -44,6 +45,8 @@ ARGV.each{ |arg|
44
45
  next_arg = :writer
45
46
  when '-o','--output'
46
47
  next_arg = :output
48
+ when '-n','--nopreview'
49
+ ARGS[:nopreview] = true
47
50
  else
48
51
  if next_arg
49
52
  ARGS[next_arg] = arg
@@ -20,7 +20,7 @@ module FileUtils
20
20
  end
21
21
 
22
22
  module DocuBot
23
- VERSION = '0.5'
23
+ VERSION = '0.6'
24
24
  DIR = File.expand_path( File.dirname( __FILE__ ) )
25
25
 
26
26
  TEMPLATE_DIR = DIR / 'docubot/templates'
@@ -77,9 +77,13 @@ class DocuBot::CHMWriter < DocuBot::HTMLWriter
77
77
  puts "...%.2fs to clean up temporary files" % (Time.now-lap)
78
78
  lap = Time.now
79
79
 
80
- # Spin a new thread so it doesn't hold up the Ruby process, but sleep long enough for it to get going.
81
- Thread.new{ `hh.exe "#{FileUtils.win_path @chm_path}"` }
82
- sleep 0.1 if Object.const_defined? "Encoding" # This sleep does not help on 1.8.6
80
+ unless ARGS[:nopreview]
81
+ # Spin a new thread so it doesn't hold up the Ruby process, but sleep long enough for it to get going.
82
+ Thread.new{ `hh.exe "#{FileUtils.win_path @chm_path}"` }
83
+ sleep 0.1 if Object.const_defined? "Encoding" # This sleep does not help on 1.8.6
84
+ else
85
+ puts "...Skipping .chm preview"
86
+ end
83
87
  end
84
88
 
85
89
  def write_hhc
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docubot
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.5"
4
+ version: "0.6"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Kistner