Module: Buildr::LockJar::ProjectExtension

Includes:
Extension
Included in:
Project
Defined in:
lib/lock_jar/buildr.rb

Instance Method Summary collapse

Instance Method Details

#lock_jar(&blk) ⇒ Object


53
54
55
56
# File 'lib/lock_jar/buildr.rb', line 53

def lock_jar(&blk)
  @lockjar_dsl = ::LockJar::Domain::Dsl.create(&blk)
  @lockjar_dsl.merge(Buildr.global_lockjar_dsl) unless Buildr.global_lockjar_dsl.nil?
end

#lock_jars(*args) ⇒ Object


58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/lock_jar/buildr.rb', line 58

def lock_jars(*args)
  lockfile = Buildr.project_to_lockfile(project)
  opts = {}
  groups = ['default']

  args.each do |arg|
    if arg.is_a?(Hash)
      opts.merge!(arg)
    elsif arg.is_a?(String)
      lockfile = arg
    elsif arg.is_a?(Array)
      groups = arg
    end
  end

  ::LockJar.list(lockfile, groups, opts)
end

#lockjar_dslObject


76
77
78
# File 'lib/lock_jar/buildr.rb', line 76

def lockjar_dsl
  @lockjar_dsl || Buildr.global_lockjar_dsl
end