Module: NanDoc::Config
Defined Under Namespace
Modules: Accessors
Instance Attribute Summary collapse
-
#orphan_surrogate_filename ⇒ Object
Returns the value of attribute orphan_surrogate_filename.
-
#proto_path ⇒ Object
Returns the value of attribute proto_path.
Instance Method Summary collapse
-
#colorize? ⇒ Boolean
Whether to output cli output in color.
-
#diff_stylesheet ⇒ Object
everybody wants to look like git.
-
#file_utils ⇒ Object
some FileUtils actions are wrapped with this proxy to allow formatting and customizations from the typical FileUtils actions, to indent and colorize the notice stream sorta like nanoc does.
- #option_prefix ⇒ Object
-
#option_prefix_colorized ⇒ Object
Give some visual distinction of what options for a given command are a nanDoc hack.
- #option_prefix_no_color ⇒ Object
Instance Attribute Details
#orphan_surrogate_filename ⇒ Object
Returns the value of attribute orphan_surrogate_filename.
70 71 72 |
# File 'lib/nandoc/core/config.rb', line 70 def orphan_surrogate_filename @orphan_surrogate_filename end |
#proto_path ⇒ Object
Returns the value of attribute proto_path.
78 79 80 |
# File 'lib/nandoc/core/config.rb', line 78 def proto_path @proto_path end |
Instance Method Details
#colorize? ⇒ Boolean
in the future make this smarter. i don’t like now nanoc handles color
Whether to output cli output in color. Without color probably doesn’t work (a command line argument?) There should be an autodetect, and/or set last setting in sticky json file; or however it is it is done.
14 15 16 |
# File 'lib/nandoc/core/config.rb', line 14 def colorize? true end |
#diff_stylesheet ⇒ Object
everybody wants to look like git
21 22 23 24 25 26 27 28 |
# File 'lib/nandoc/core/config.rb', line 21 def diff_stylesheet @diff_stylesheet ||= { :header => [:bold, :yellow], :add => [:bold, :green], :remove => [:bold, :red], :range => [:bold, :magenta] } end |
#file_utils ⇒ Object
some FileUtils actions are wrapped with this proxy to allow formatting and customizations from the typical FileUtils actions, to indent and colorize the notice stream sorta like nanoc does
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/nandoc/core/config.rb', line 36 def file_utils @file_utils ||= begin Treebis::FileUtilsProxy.new do |fu| fu.pretty! fu.color?{ NanDoc::Config.colorize? } fu.prefix = ' ' * 6 # like nanoc fu.ui = proc{ $stdout } # it's normally $stderr, it needs to be reference-like # so that capture3 will work! end end end |
#option_prefix ⇒ Object
61 62 63 64 65 |
# File 'lib/nandoc/core/config.rb', line 61 def option_prefix colorize? ? option_prefix_colorized : option_prefix_no_color end |
#option_prefix_colorized ⇒ Object
Give some visual distinction of what options for a given command are a nanDoc hack
53 54 55 |
# File 'lib/nandoc/core/config.rb', line 53 def option_prefix_colorized "(\e[35mnanDoc\e[0m) " end |
#option_prefix_no_color ⇒ Object
57 58 59 |
# File 'lib/nandoc/core/config.rb', line 57 def option_prefix_no_color '(nanDoc hack) ' end |