Module: Freyia::Setup::ClassMethods

Defined in:
lib/freyia.rb

Instance Method Summary collapse

Instance Method Details

#shellObject

Returns the shell used in all Freyia classes. If you are in a Unix platform it will use a colored log, otherwise it will use a basic one without color.



23
24
25
26
27
28
29
30
31
# File 'lib/freyia.rb', line 23

def shell
  @shell ||= if ENV["FREYIA_SHELL"] && !ENV["FREYIA_SHELL"].empty?
               Freyia::Shell.const_get(ENV["FREYIA_SHELL"])
             elsif RbConfig::CONFIG["host_os"] =~ %r{mswin|mingw} && !ENV["ANSICON"]
               Freyia::Shell::Basic
             else
               Freyia::Shell::Color
             end
end

#template_type(type = nil) ⇒ Symbol

Set or return the template type for the Freyia base. Defaults to :erb

Parameters:

  • type (Symbol) (defaults to: nil)

    either :erb or :serbea

Returns:

  • (Symbol)

    if called without an argument, returns the template type



37
38
39
40
# File 'lib/freyia.rb', line 37

def template_type(type = nil)
  @template_type ||= :erb
  type ? @template_type = type : @template_type
end