lib/hackpad/cli/client.rb in hackpad-cli-0.1.1 vs lib/hackpad/cli/client.rb in hackpad-cli-0.1.2

- old
+ new

@@ -1,6 +1,5 @@ -require 'reverse_markdown' require 'paint' require_relative 'config' require_relative 'api' require_relative 'store' @@ -25,10 +24,13 @@ end end def workspaces @config.workspaces.each do |s| + if s.name == @config.workspace + s.name = "> #{s.name}" + end table s.name, s.site end end def default @@ -79,17 +81,12 @@ table 'Moderated', "#{pad.moderated}" table 'Cached', "#{pad.cached_at || 'unknown'}" end def show(id, format) - ext = (format == 'md') ? 'html' : format pad = Pad.new id - pad.load ext - if format == 'md' - @output.puts ReverseMarkdown.convert(pad.content, github_flavored: true) - else - @output.puts pad.content - end + pad.load format + @output.puts pad.content end private def padline(pad)