Skip to content

Commit

Permalink
Implement CLI invoker
Browse files Browse the repository at this point in the history
  • Loading branch information
gscheibel committed Jan 26, 2015
1 parent 2ed2e7d commit 94ea65e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bin/asciidoctor-confluence
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env ruby

require 'rubygems' if RUBY_VERSION < '1.9'
require File.join File.dirname(__FILE__), '../lib/asciidoctor/confluence/invoker'

result_code = Asciidoctor::Confluence::Invoker.invoke ARGV
exit result_code
18 changes: 18 additions & 0 deletions lib/asciidoctor/confluence/invoker.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'asciidoctor'
require 'asciidoctor/cli'
require_relative './options'
require_relative '../confluence/invoker'

module Asciidoctor
module Confluence

class Invoker
def self.invoke(args)
options = Asciidoctor::Confluence::Options.parse! args #['--host', 'http://192.168.59.103:8090/', '--spaceKey', 'AS', '--title', 'Asciidoctor is awesome', '--username', 'admin', '--password', 'admin', 'test.adoc']
publisher = Asciidoctor::Confluence::Publisher.new options
publisher.publish
end
end

end
end
5 changes: 5 additions & 0 deletions lib/asciidoctor/confluence/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Asciidoctor
module Confluence
VERSION = "0.0.1"
end
end

0 comments on commit 94ea65e

Please sign in to comment.