Class: PGit::Project::Remove
- Inherits:
-
Object
- Object
- PGit::Project::Remove
- Includes:
- Interactive
- Defined in:
- lib/pgit/project/remove.rb
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#projects ⇒ Object
readonly
Returns the value of attribute projects.
Instance Method Summary collapse
- #execute! ⇒ Object
-
#initialize(app) ⇒ Remove
constructor
A new instance of Remove.
Constructor Details
#initialize(app) ⇒ Remove
Returns a new instance of Remove.
8 9 10 11 12 13 |
# File 'lib/pgit/project/remove.rb', line 8 def initialize(app) @project = app.project @projects = app.projects raise PGit::Error::User, "#{@project.path} is not in the configuration file." unless @project.exists? end |
Instance Attribute Details
#project ⇒ Object (readonly)
Returns the value of attribute project.
7 8 9 |
# File 'lib/pgit/project/remove.rb', line 7 def project @project end |
#projects ⇒ Object (readonly)
Returns the value of attribute projects.
7 8 9 |
# File 'lib/pgit/project/remove.rb', line 7 def projects @projects end |
Instance Method Details
#execute! ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/pgit/project/remove.rb', line 15 def execute! confirm.ask_and_wait_for_valid_response do |confirm_response| if confirm_response.yes? puts "Removing #{path} from the configuration file..." project.remove! puts "Removed." elsif confirm_response.no? puts "Cancelling..." end end end |