Fix Guardfile
This commit is contained in:
@@ -1,11 +1,12 @@
|
|||||||
require 'asciidoctor'
|
require 'asciidoctor'
|
||||||
require 'erb'
|
require 'erb'
|
||||||
|
require './src/main/ruby/readme.rb'
|
||||||
|
|
||||||
options = {:mkdirs => true, :safe => :unsafe, :attributes => 'linkcss'}
|
options = {:mkdirs => true, :safe => :unsafe, :attributes => 'linkcss'}
|
||||||
|
|
||||||
guard 'shell' do
|
guard 'shell' do
|
||||||
watch(/^[A-Za-z].*\.adoc$/) {|m|
|
watch(/^src\/[A-Za-z].*\.adoc$/) {|m|
|
||||||
Asciidoctor.render_file('src/main/adoc/README.adoc', options.merge(:to_file => './README.md'))
|
SpringCloud::Build.render_file('src/main/asciidoc/README.adoc', :to_file => './README.adoc')
|
||||||
Asciidoctor.render_file('src/main/adoc/spring-cloud-cli.adoc', options.merge(:to_dir => 'target/docs'))
|
Asciidoctor.render_file('src/main/asciidoc/spring-cloud-cli.adoc', options.merge(:to_dir => 'target/generated-docs'))
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -41,8 +41,9 @@ module SpringCloud
|
|||||||
unless options[:to_file]
|
unless options[:to_file]
|
||||||
puts out
|
puts out
|
||||||
else
|
else
|
||||||
writer = File.new(options[:to_file],'w+')
|
File.open(options[:to_file],'w+') do |file|
|
||||||
out.each { |line| writer.write(line) }
|
out.each { |line| file.write(line) }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user