lib/hyla/commands/watch.rb in hyla-1.0.1 vs lib/hyla/commands/watch.rb in hyla-1.0.2
- old
+ new
@@ -121,14 +121,16 @@
def self.call_asciidoctor(f)
dir_file = File.dirname(f)
file_to_process = Pathname.new(f).basename
@ext_name = File.extname(file_to_process)
- Hyla.logger.info ">> Directory of the file to be processed : #{dir_file}"
- Hyla.logger.info ">> File to be processed : #{file_to_process}"
- Hyla.logger.info ">> Extension of the file : #{@ext_name}"
- if @ext_name != '.html'
+ if [".adoc",".ad",".asciidoc",".txt",".index"].include? @ext_name
+
+ Hyla.logger.info ">> Directory containing file(s) to be processed : #{dir_file}"
+ Hyla.logger.info ">> File to be processed : #{file_to_process}"
+ Hyla.logger.info ">> Extension of the file : #{@ext_name}"
+
# Generate File name
# Rename xxx.adoc, xxx.asciidoc, xxx.ad, xxx.index to xxx.html
to_file = file_to_process.to_s.gsub(/.adoc|.ad|.asciidoc|.index/, '.html')
@opts[:to_file] = to_file