Class: RubyDeployer::ArtifactDSL

Inherits:
Object
  • Object
show all
Includes:
GeneralDSL
Defined in:
lib/ruby_deployer/artifact_dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from GeneralDSL

#log, #rake, #sh

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 options
  @repository = (options[:repository] or FileSystemRepository).new
  @excludes = []
end

Instance Attribute Details

#excludesObject (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