Class: Asciidoctor::ConfluencePublisher::Invoker
- Inherits:
-
Object
- Object
- Asciidoctor::ConfluencePublisher::Invoker
- Defined in:
- lib/asciidoctor/confluence_publisher/invoker.rb
Constant Summary collapse
- DEFAULT_TEMPLATE_DIR =
default template directory for asciidoctor_confluence marcos
File.("../../../../template", __FILE__)
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options) ⇒ Invoker
constructor
A new instance of Invoker.
- #invoke! ⇒ Object
Constructor Details
#initialize(options) ⇒ Invoker
Returns a new instance of Invoker.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/asciidoctor/confluence_publisher/invoker.rb', line 10 def initialize() @options = .dup @options[:to_file] = nil @options[:catalog_assets] = true @options[:backend] = 'xhtml5' @options[:template_dirs] = Array([:template_dirs]) << DEFAULT_TEMPLATE_DIR @options[:to_file] = false @options[:header_footer] = false # confluence related configuration attributes = [:attributes] || {} attributes['confluence_host'] ||= ENV['CONFLUENCE_HOST'] attributes['space'] ||= ENV['SPACE'] attributes['username'] ||= ENV['CONFLUENCE_USERNAME'] attributes['password'] ||= ENV['CONFLUENCE_PASSWORD'] @ancestor_id = (attributes['ancestor_id'] ||= ENV['ANCESTOR_ID']) check_confluence_config(attributes) proxy = attributes[:proxy] || ENV['CONFLUENCE_PROXY'] skip_verify_ssl = attributes['skip_verify_ssl'].to_s == 'true' @confluence_client = ConfluenceApi.new(attributes['confluence_host'], attributes['space'], attributes['username'], attributes['password'], skip_verify_ssl: skip_verify_ssl, proxy: proxy) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/asciidoctor/confluence_publisher/invoker.rb', line 9 def @options end |
Instance Method Details
#invoke! ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/asciidoctor/confluence_publisher/invoker.rb', line 38 def invoke! input_files = [:asciidoc_source_dir] ? Array([:asciidoc_source_dir]) : [:input_files] input_files.map(&method(:build_file_tree)).each do |node| traverse_file_tree(@ancestor_id, node, &method(:convert_and_publish)) end end |