Class: PGit::Project::Add
- Inherits:
-
Object
- Object
- PGit::Project::Add
- Extended by:
- Forwardable
- Defined in:
- lib/pgit/project/add.rb
Instance Attribute Summary collapse
-
#adder ⇒ Object
readonly
Returns the value of attribute adder.
Instance Method Summary collapse
- #execute! ⇒ Object
-
#initialize(app) ⇒ Add
constructor
A new instance of Add.
Constructor Details
#initialize(app) ⇒ Add
Returns a new instance of Add.
10 11 12 13 14 15 |
# File 'lib/pgit/project/add.rb', line 10 def initialize(app) @app = app raise PGit::Error::User, 'Project path already exists. See `pgit proj update --help.`' if app.exists? @reuse_adder = PGit::Project::ReuseApiTokenAdder.new(app.project, app.projects) end |
Instance Attribute Details
#adder ⇒ Object (readonly)
Returns the value of attribute adder.
9 10 11 |
# File 'lib/pgit/project/add.rb', line 9 def adder @adder end |
Instance Method Details
#execute! ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/pgit/project/add.rb', line 17 def execute! @reuse_adder.execute! @adder = PGit::Project::InteractiveAdder.new(@reuse_adder.project) adder.execute! adder.save! puts "Successfully added the project!" end |