Class: Mvnizer::Command::AddDependency
- Inherits:
-
Object
- Object
- Mvnizer::Command::AddDependency
- Includes:
- TaskHelper
- Defined in:
- lib/mvnizer/commands/add_dependency.rb
Constant Summary
Constants included from TaskHelper
Instance Method Summary collapse
Methods included from TaskHelper
#add_dependency, #create_dir, #generate_file
Instance Method Details
#run(options) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/mvnizer/commands/add_dependency.rb', line 6 def run() raise Mvnizer::FileNotFoundError, "The pom.xml file cannot be found." unless pom_present? dependency = [:name] content = add_dependency([dependency]) File.open("pom.xml", "w") do |f| f.write(content) end end |