Module: MetaRake::Publisher::Directory

Extended by:
Magic
Includes:
FileUtils
Defined in:
lib/metarake/publisher/directory.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Methods included from Magic

included

Instance Method Details

#publish!Object

Copy all the project targets to the publish path



25
26
27
28
29
30
# File 'lib/metarake/publisher/directory.rb', line 25

def publish!
  mkdir_p File.join(self.publish_path, self.to_s)
  self.targets.each do |tgt|
    install File.join(self.to_s, tgt), File.join(self.publish_path, self.to_s, tgt)
  end
end

#publish_pathObject

Returns class attribute @publish_path.

Returns:

  • class attribute @publish_path



14
15
16
# File 'lib/metarake/publisher/directory.rb', line 14

def publish_path
  self.class.publish_path or raise ValueError, "#{self.class}.publish_path is not set"
end

#published?Boolean

True if all project targets are copied to the publish path

Returns:

  • (Boolean)


19
20
21
22
# File 'lib/metarake/publisher/directory.rb', line 19

def published?
  self.targets.map { |tgt| File.exist?(File.join(
        self.publish_path, self.to_s, tgt)) }.all?
end