Class: PointRb::Actions::CheckProjectPath

Inherits:
Object
  • Object
show all
Defined in:
lib/pointrb/actions/check_project_path.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ CheckProjectPath

Returns a new instance of CheckProjectPath.



4
5
6
# File 'lib/pointrb/actions/check_project_path.rb', line 4

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
12
# File 'lib/pointrb/actions/check_project_path.rb', line 8

def call(env)
  raise PointRb::Exceptions::ProjectPathExists, "Directory '#{env.project.name}' exists." if File.exists? env.project.path

  @app.call(env)
end