lib/jbundler.rb in jbundler-0.6.4 vs lib/jbundler.rb in jbundler-0.7.0

- old
+ new

@@ -18,10 +18,11 @@ # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # require 'jbundler/context' +require 'jbundler/lock_down' module JBundler def self.context @context ||= JBundler::Context.new @@ -30,33 +31,10 @@ def self.setup_test context.classpath.require_test_classpath context.config end - def self.update - if( context.classpath.needs_update?( context.jarfile, - context.gemfile_lock ) and - not context.vendor.vendored? ) - - warn '' - warn 'jar bundle is outdated - use jbundle install to update bundle' - warn '' - - aether = JBundler::AetherRuby.new( context.config ) - - context.jarfile.populate_unlocked( aether ) - context.gemfile_lock.populate_dependencies( aether ) - context.jarfile.populate_locked( aether ) - - aether.resolve - - context.classpath.generate( aether.classpath_array, [], [], - context.config.local_repository ) - context.jarfile.generate_lockfile( aether.resolved_coordinates ) - end - end - def self.require_jars if context.vendor.vendored? jars = context.vendor.require_jars if context.config.verbose warn "jbundler classpath:" @@ -75,14 +53,19 @@ end Jars.freeze_loading end end + def self.install( debug = false, verbose = false ) + jbundler = JBundler::LockDown.new( context.config ) + msg = jbundler.lock_down( false, debug, verbose ) + puts msg if msg + end + def self.setup if context.config.skip warn "skip jbundler setup" if context.config.verbose else - update require_jars end end end