Class: LockJar::Runtime::Lock
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- LockJar::Runtime::Lock
- Defined in:
- lib/lock_jar/runtime/lock.rb
Instance Attribute Summary collapse
-
#jarfile ⇒ Object
Returns the value of attribute jarfile.
-
#lockfile ⇒ Object
Returns the value of attribute lockfile.
-
#opts ⇒ Object
Returns the value of attribute opts.
Instance Method Summary collapse
-
#initialize(runtime) ⇒ Lock
constructor
A new instance of Lock.
- #lock(jarfile_or_dsl, opts = {}, &blk) ⇒ Object
Constructor Details
Instance Attribute Details
#jarfile ⇒ Object
Returns the value of attribute jarfile.
8 9 10 |
# File 'lib/lock_jar/runtime/lock.rb', line 8 def jarfile @jarfile end |
#lockfile ⇒ Object
Returns the value of attribute lockfile.
8 9 10 |
# File 'lib/lock_jar/runtime/lock.rb', line 8 def lockfile @lockfile end |
#opts ⇒ Object
Returns the value of attribute opts.
8 9 10 |
# File 'lib/lock_jar/runtime/lock.rb', line 8 def opts @opts end |
Instance Method Details
#lock(jarfile_or_dsl, opts = {}, &blk) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/lock_jar/runtime/lock.rb', line 16 def lock(jarfile_or_dsl, opts = {}, &blk) @opts = { download: true }.merge(opts) create_dsl!(jarfile_or_dsl, &blk) apply_repositories! apply_maps! apply_excludes! apply_merged! artifacts = jarfile.artifacts.values.flatten apply_artifacts!(artifacts) unless artifacts.empty? lockfile.write(@opts[:lockfile] || 'Jarfile.lock') lockfile end |