Ruby

Ruby Code Screenshot Generator

Turn Ruby snippets into images worth sharing, without leaving your Mac.

Ruby is one of the best languages to screenshot, because idiomatic Ruby is short and the point is usually visible in three or four lines.

Codeshot detects Ruby from the code you paste, so there is no language picker to get wrong. Here is the same snippet in three of the 30 themes it ships with, rendered with the app's own stylesheets.

class Snapshot
  attr_reader :code, :theme

  def initialize(code, theme: "xcode", scale: 2)
    @code, @theme, @scale = code, theme, scale
  end

  def export(path)
    Renderer.render(code, theme).save(path, scale: @scale)
  end
end
Atom One · dark
class Snapshot
  attr_reader :code, :theme

  def initialize(code, theme: "xcode", scale: 2)
    @code, @theme, @scale = code, theme, scale
  end

  def export(path)
    Renderer.render(code, theme).save(path, scale: @scale)
  end
end
GitHub · dark
class Snapshot
  attr_reader :code, :theme

  def initialize(code, theme: "xcode", scale: 2)
    @code, @theme, @scale = code, theme, scale
  end

  def export(path)
    Renderer.render(code, theme).save(path, scale: @scale)
  end
end
Solarized · dark

Choosing a theme for Ruby

Ruby's low line count means you can push the font size up and still fit the whole idea. Take advantage of that rather than filling the frame.

Getting the size right

Let the image follow your content, or lock it to a ratio — 1:1, 4:3, 3:2, 16:9, 9:16, 2:3, or 3:4 — then export at 1×, 2×, or 3× so it stays sharp on a retina display. Copy it straight to the clipboard with C, or save with S.

See all 30 themes side by side, or read the full workflow.

Built for Ruby, and 59 other languages

Everything runs on your Mac. Your code never leaves it.

Download for macOS