Class: Mediumize::StdoutPublisher

Inherits:
Object
  • Object
show all
Defined in:
lib/mediumize/stdout_publisher.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ StdoutPublisher

Returns a new instance of StdoutPublisher.



3
4
5
# File 'lib/mediumize/stdout_publisher.rb', line 3

def initialize(opts={})
  @renderer = Mediumize::Renderer.new(opts)
end

Instance Method Details

#publish(file) ⇒ Object



7
8
9
10
11
# File 'lib/mediumize/stdout_publisher.rb', line 7

def publish(file)
  content = @renderer.render(File.read(file), file)
  puts content[:content]
  { :id => "id/dry-run", :url => "http://example.com/dry-run", :content => content }
end