Module: MetaRake::Publisher::Directory
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#publish! ⇒ Object
Copy all the project targets to the publish path.
-
#publish_path ⇒ Object
Class attribute @publish_path.
-
#published? ⇒ Boolean
True if all project targets are copied to the publish path.
Methods included from Magic
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_path ⇒ Object
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
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 |