Class: LockJar::Runtime
- Inherits:
-
Object
- Object
- LockJar::Runtime
- Defined in:
- lib/lock_jar/runtime.rb,
lib/lock_jar/runtime/list.rb,
lib/lock_jar/runtime/load.rb,
lib/lock_jar/runtime/lock.rb,
lib/lock_jar/runtime/install.rb
Defined Under Namespace
Modules: Install, List, Load Classes: Lock
Instance Attribute Summary collapse
-
#current_resolver ⇒ Object
readonly
Returns the value of attribute current_resolver.
Instance Method Summary collapse
-
#initialize ⇒ Runtime
constructor
A new instance of Runtime.
- #lock(jarfile_or_dsl, opts = {}, &blk) ⇒ Object
- #opts ⇒ Object
- #reset! ⇒ Object
- #resolver(opts = {}) ⇒ Object
Methods included from Install
Methods included from List
#build_lockfile, #dependencies_from_lockfile, #list
Methods included from Load
Constructor Details
#initialize ⇒ Runtime
Returns a new instance of Runtime.
38 39 40 |
# File 'lib/lock_jar/runtime.rb', line 38 def initialize @current_resolver = nil end |
Instance Attribute Details
#current_resolver ⇒ Object (readonly)
Returns the value of attribute current_resolver.
36 37 38 |
# File 'lib/lock_jar/runtime.rb', line 36 def current_resolver @current_resolver end |
Instance Method Details
#lock(jarfile_or_dsl, opts = {}, &blk) ⇒ Object
42 43 44 |
# File 'lib/lock_jar/runtime.rb', line 42 def lock(jarfile_or_dsl, opts = {}, &blk) Lock.new(self).lock(jarfile_or_dsl, opts, &blk) end |
#opts ⇒ Object
46 47 48 |
# File 'lib/lock_jar/runtime.rb', line 46 def opts current_resolver.opts if current_resolver end |
#reset! ⇒ Object
68 69 70 |
# File 'lib/lock_jar/runtime.rb', line 68 def reset! @current_resolver = nil end |
#resolver(opts = {}) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/lock_jar/runtime.rb', line 50 def resolver(opts = {}) # XXX: Caches the resolver by the options. Passing in nil opts will replay # from the cache. This need to change. if !opts.nil? opts[:local_repo] = File.(opts[:local_repo]) if opts[:local_repo] elsif @current_resolver opts = @current_resolver.opts else opts = {} end if @current_resolver.nil? || opts != @current_resolver.opts @current_resolver = LockJar::Resolver.new(opts) end @current_resolver end |