Sha256: 86ec9c7a35f84d4c5752b31e733393f72c6d0025daa92b6bab8feb1a0de9ff09
Contents?: true
Size: 1.23 KB
Versions: 20
Compression:
Stored size: 1.23 KB
Contents
#-- # Copyright (c) 2010-2012 Engine Yard, Inc. # Copyright (c) 2007-2009 Sun Microsystems, Inc. # This source code is available under the MIT license. # See the file LICENSE.txt for details. #++ module Warbler module Traits # The NoGemspec trait is used when no gemspec file is found for a # jar project. It assumes a standard layout including +bin+ and # +lib+ directories. class NoGemspec include Trait include PathmapHelper include ExecutableHelper def self.detect? Jar.detect? && !Gemspec.detect? end def before_configure config.dirs = ['.'] end def after_configure if File.directory?("lib") add_init_load_path(config.pathmaps.application.inject("lib") {|pm,x| pm.pathmap(x)}) end end def update_archive(jar) update_archive_add_executable(jar) end def default_executable exes = Dir['bin/*'].sort unless(exe = exes.grep(/#{config.jar_name}/).first) exe = exes.first if exe warn "No executable matching config.jar_name found, using #{exe}" end end raise "No executable script found" unless exe exe end end end end
Version data entries
20 entries across 20 versions & 1 rubygems