Class: PGit::CurrentProject

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/pgit/current_project.rb,
lib/pgit/current_project/validator.rb

Defined Under Namespace

Classes: Validator

Instance Method Summary collapse

Constructor Details

#initialize(configuration) ⇒ CurrentProject

Returns a new instance of CurrentProject.

Raises:



12
13
14
15
16
17
18
# File 'lib/pgit/current_project.rb', line 12

def initialize(configuration)
  @current = configuration.projects.find do |p|
    File.expand_path(p.path) == Dir.pwd
  end

  raise PGit::Error::User, "Current Project does not exist. See `pgit proj add -h`" unless @current
end