Sha256: 2bfc308b8da4496e06a0302984d29dd7b398f49e2ae38f8d2e4b5e1eaaf1269e

Contents?: true

Size: 528 Bytes

Versions: 1

Compression:

Stored size: 528 Bytes

Contents

class GitPresenter::Slide
  attr_reader :commit, :message, :run

  def initialize(slide)
    @commit  = slide["commit"]
    @message = slide["message"]
    @run = slide["run"]
  end

  def execute
    output = ""
    output << checkout unless @commit.nil?
    output << `#{run}` unless @run.nil?
    output
  end

  def to_s
    return "#{@commit[0..9]}, #{@message}" unless @commit.nil?
    "run: #{@run}"
  end

  private

  def checkout
    `git checkout -q . `
    `git checkout -q #{@commit}`
    @message + "\n"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
git_presenter-0.3.0 lib/git_presenter/slide.rb