module Ruhoh::Base::Compilable

Public Class Methods

included(klass) click to toggle source
# File lib/ruhoh/base/compilable.rb, line 2
def self.included(klass)
  __send__(:attr_reader, :collection)
end
new(collection) click to toggle source
# File lib/ruhoh/base/compilable.rb, line 6
def initialize(collection)
  @ruhoh = collection.ruhoh
  @collection = collection
end

Public Instance Methods

collection_exists?() click to toggle source
# File lib/ruhoh/base/compilable.rb, line 21
def collection_exists?
  collection = @collection
  unless @collection.paths?
    Ruhoh::Friend.say { yellow "#{ collection.resource_name.capitalize }: directory not found - skipping." }
    return false
  end
  Ruhoh::Friend.say { cyan "#{ collection.resource_name.capitalize }: (copying valid files)" }
  true
end
compile_collection_path() click to toggle source
# File lib/ruhoh/base/compilable.rb, line 17
def compile_collection_path
  FileUtils.mkdir_p(@collection.compiled_path)
end
setup_compilable() click to toggle source
# File lib/ruhoh/base/compilable.rb, line 11
def setup_compilable
  return false unless collection_exists?

  compile_collection_path
end