Class: Pushwagner::Maven
- Inherits:
-
Object
- Object
- Pushwagner::Maven
- Defined in:
- lib/pushwagner/maven.rb
Defined Under Namespace
Classes: Artifact, Deployer, Repository
Instance Attribute Summary collapse
-
#artifacts ⇒ Object
readonly
Returns the value of attribute artifacts.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
Instance Method Summary collapse
- #any? ⇒ Boolean
-
#initialize(maven, version) ⇒ Maven
constructor
A new instance of Maven.
- #required(msg) ⇒ Object
Constructor Details
#initialize(maven, version) ⇒ Maven
Returns a new instance of Maven.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/pushwagner/maven.rb', line 11 def initialize(maven, version) required("Need maven configuration") unless maven if version && !version.empty? @version = version else required("Deployment version for artifacts is required") end @repository = Repository.new(maven['repositories']) @artifacts = Hash[(maven['artifacts'] || required("Requires at least one maven artifact")).map { |k,h| [k, Artifact.new(h['artifact_id'], h['group_id'], h['version'] || version)] }] (artifacts && repository) || required("Could not initialize maven configuration") end |
Instance Attribute Details
#artifacts ⇒ Object (readonly)
Returns the value of attribute artifacts.
10 11 12 |
# File 'lib/pushwagner/maven.rb', line 10 def artifacts @artifacts end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
10 11 12 |
# File 'lib/pushwagner/maven.rb', line 10 def repository @repository end |
Instance Method Details
#any? ⇒ Boolean
30 31 32 |
# File 'lib/pushwagner/maven.rb', line 30 def any? artifacts && repository end |
#required(msg) ⇒ Object
26 27 28 |
# File 'lib/pushwagner/maven.rb', line 26 def required(msg) raise StandardError.new(msg) end |