Class: RubyDeployer::ArtifactDSL
- Inherits:
-
Object
- Object
- RubyDeployer::ArtifactDSL
- Includes:
- GeneralDSL
- Defined in:
- lib/ruby_deployer/artifact_dsl.rb
Instance Attribute Summary collapse
-
#excludes ⇒ Object
readonly
Returns the value of attribute excludes.
Instance Method Summary collapse
- #before(&block) ⇒ Object
- #exclude(excludes) ⇒ Object
- #execute(&block) ⇒ Object
-
#initialize(options) ⇒ ArtifactDSL
constructor
A new instance of ArtifactDSL.
- #publish(file) ⇒ Object
Methods included from GeneralDSL
Constructor Details
#initialize(options) ⇒ ArtifactDSL
Returns a new instance of ArtifactDSL.
10 11 12 13 |
# File 'lib/ruby_deployer/artifact_dsl.rb', line 10 def initialize @repository = ([:repository] or FileSystemRepository).new @excludes = [] end |
Instance Attribute Details
#excludes ⇒ Object (readonly)
Returns the value of attribute excludes.
8 9 10 |
# File 'lib/ruby_deployer/artifact_dsl.rb', line 8 def excludes @excludes end |
Instance Method Details
#before(&block) ⇒ Object
15 16 17 |
# File 'lib/ruby_deployer/artifact_dsl.rb', line 15 def before(&block) @before_block = block end |
#exclude(excludes) ⇒ Object
19 20 21 |
# File 'lib/ruby_deployer/artifact_dsl.rb', line 19 def exclude excludes @excludes = excludes.map { |exclude| "\\*#{exclude}" } end |
#execute(&block) ⇒ Object
23 24 25 |
# File 'lib/ruby_deployer/artifact_dsl.rb', line 23 def execute(&block) instance_eval &block end |
#publish(file) ⇒ Object
27 28 29 30 |
# File 'lib/ruby_deployer/artifact_dsl.rb', line 27 def publish file instance_eval &@before_block if @before_block @repository.publish file end |