Class: BuildTasks::GitBuildpackage::DSL

Inherits:
Object
  • Object
show all
Includes:
Mixins::DSL
Defined in:
lib/buildtasks/git_buildpackage/dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Mixins::DSL

#_validate, #codename, #set_or_return

Constructor Details

#initialize(&block) ⇒ DSL

Returns a new instance of DSL.



8
9
10
11
12
13
14
15
16
# File 'lib/buildtasks/git_buildpackage/dsl.rb', line 8

def initialize(&block)
  @name      = nil
  @version   = nil
  @source    = nil
  @patches   = []
  @changelog = nil

  instance_eval(&block) if block_given?
end

Instance Attribute Details

#changelogObject (readonly)

Returns the value of attribute changelog.



18
19
20
# File 'lib/buildtasks/git_buildpackage/dsl.rb', line 18

def changelog
  @changelog
end

#patchesObject (readonly)

Returns the value of attribute patches.



18
19
20
# File 'lib/buildtasks/git_buildpackage/dsl.rb', line 18

def patches
  @patches
end

Instance Method Details

#apply_patch(patch) ⇒ Object



32
33
34
# File 'lib/buildtasks/git_buildpackage/dsl.rb', line 32

def apply_patch(patch)
  @patches << patch
end

#name(arg = nil) ⇒ Object



20
21
22
# File 'lib/buildtasks/git_buildpackage/dsl.rb', line 20

def name(arg = nil)
  set_or_return(:name, arg, :kind_of => String)
end

#source(arg = nil) ⇒ Object



28
29
30
# File 'lib/buildtasks/git_buildpackage/dsl.rb', line 28

def source(arg = nil)
  set_or_return(:source, arg, :kind_of => String)
end

#update_changelog(text, options = {}) ⇒ Object



36
37
38
# File 'lib/buildtasks/git_buildpackage/dsl.rb', line 36

def update_changelog(text, options = {})
  @changelog = { :text => text }.merge(options)
end

#version(arg = nil) ⇒ Object



24
25
26
# File 'lib/buildtasks/git_buildpackage/dsl.rb', line 24

def version(arg = nil)
  set_or_return(:version, arg, :kind_of => String)
end