Sha256: a93bd12e3f9ecd747cfdb67515c37c1bc4c5d690cae4eaddfd0224e0cabec6bb
Contents?: true
Size: 1.77 KB
Versions: 2
Compression:
Stored size: 1.77 KB
Contents
module IronWorkerNG module Feature module Java module MergeExec class Feature < IronWorkerNG::Feature::Base attr_reader :path attr_reader :klass def initialize(path, klass) @path = File.expand_path(path) @klass = klass end def hash_string Digest::MD5.hexdigest(@path + @klass + File.mtime(@path).to_i.to_s) end def bundle(zip) IronCore::Logger.debug 'IronWorkerNG', "Bundling java exec with path='#{@path}' and class='#{@klass}'" zip.add(File.basename(@path), @path) end def code_for_classpath File.basename(@path) end end module InstanceMethods def merge_exec(path, klass = nil) @exec ||= nil unless @exec.nil? IronCore::Logger.warn 'IronWorkerNG', "Ignoring attempt to merge java exec with path='#{path}' and class='#{klass}'" return end if klass.nil? @name ||= File.basename(path).gsub(/\.jar$/, '').capitalize.gsub(/_./) { |x| x[1].upcase } else @name ||= klass.split('.')[-1] end @exec = IronWorkerNG::Feature::Java::MergeExec::Feature.new(path, klass) IronCore::Logger.info 'IronWorkerNG', "Merging java exec with path='#{path}' and class='#{klass}'" @features << @exec end alias :exec :merge_exec alias :merge_worker :merge_exec alias :worker :merge_worker def self.included(base) IronWorkerNG::Code::Base.register_feature(:name => 'merge_exec', :for_klass => base, :args => 'PATH,CLASS') end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
iron_worker_ng-0.4.1 | lib/iron_worker_ng/feature/java/merge_exec.rb |
iron_worker_ng-0.4.0 | lib/iron_worker_ng/feature/java/merge_exec.rb |