Sha256: a5b16afe0b61c9a30e650cd36625d1d195a56cdb41be1489e0acedf2b13505a4

Contents?: true

Size: 519 Bytes

Versions: 1

Compression:

Stored size: 519 Bytes

Contents

class RailsInfo::VersionControlPresenter < ::RailsInfo::Presenter
  def initialize(subject, options = {})
    super(subject, options)
    
    @errors = []
    @repository_params = options[:repository]
    
    unless @repository_params[:path].present? && @repository_params[:branch].present?
      @errors << 'Please pass path and branch'
    end
    
    if valid?
      @repository = Grit::Repo.new(@repository_params[:path])
    end
  end
  
  def valid?
    errors.none?
  end
  
  def errors
    @errors
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_info-0.1.0 app/presenters/rails_info/version_control_presenter.rb