lib/sprout/file_target.rb in sprout-1.0.29.pre vs lib/sprout/file_target.rb in sprout-1.0.31.pre

- old
+ new

@@ -26,10 +26,18 @@ @platform = :universal yield self if block_given? end ## + # This is a template method that will be called + # so that RemoteFileTarget subclasses and load + # the appropriate files at the appropriate time. + # Admittedly kind of smelly, other ideas welcome... + def resolve + end + + ## # Add a library to the RubyGem package. # # @name Symbol that will be used to retrieve this library later. # @path File, Path or Array of files that will be associated with this # library and copied to the target lib. @@ -37,26 +45,26 @@ # If the path is a directory, all files forward of that directory # will be copied into the RubyGem. # def add_library name, path if path.is_a?(Array) - path = path.collect { |p| expand_executable_path(p) } + path = path.collect { |p| expand_local_path(p) } else - path = expand_executable_path path + path = expand_local_path path end - libraries << Sprout::Library.new( :name => name, :path => path, :file_target => self ) + libraries << OpenStruct.new( :name => name, :path => path, :file_target => self ) end ## # Add an executable to the RubyGem package. # # @name Symbol that will be used to retrieve this executable later. # @target The relative path to the executable that will be associated # with this name. # def add_executable name, path - path = expand_executable_path path + path = expand_local_path path executables << OpenStruct.new( :name => name, :path => path, :file_target => self ) end def to_s "[FileTarget pkg_name=#{pkg_name} pkg_version=#{pkg_version} platform=#{platform}]" @@ -65,10 +73,13 @@ def validate raise Sprout::Errors::UsageError.new "FileTarget.pkg_name is required" if pkg_name.nil? raise Sprout::Errors::UsageError.new "FileTarget.pkg_version is required" if pkg_version.nil? end - def expand_executable_path path + ## + # This is a template method that is overridden + # by RemoteFileTarget. + def expand_local_path path File.join load_path, path end end end