class Fangorn::Output

Public Class Methods

dest() click to toggle source
# File lib/fangorn/output.rb, line 45
def self.dest
  File.absolute_path(@@dest || (@@dist ? 'dist' : 'public'))
end
dest=(dest) click to toggle source
# File lib/fangorn/output.rb, line 57
def self.dest= (dest)
  @@dest = dest
end
dist!() click to toggle source
# File lib/fangorn/output.rb, line 49
def self.dist!
  @@dist = true
end
dist?() click to toggle source
# File lib/fangorn/output.rb, line 33
def self.dist?
  @@dist
end
env() click to toggle source
# File lib/fangorn/output.rb, line 37
def self.env
  @@env
end
env=(env) click to toggle source
# File lib/fangorn/output.rb, line 61
def self.env= (env)
  @@env = env
end
make(input) click to toggle source
# File lib/fangorn/output.rb, line 24
def self.make(input)
  type = File.extname(input)[1..-1]
  begin
    Fangorn.const_get(type.capitalize).new input
  rescue LoadError, NameError
    StaticFile.new input
  end
end
new(input, output) click to toggle source
# File lib/fangorn/output.rb, line 5
def initialize(input, output)
  @input, @output = input, output
  @config = YAML.load_file 'fangorn.yml'
end
source() click to toggle source
# File lib/fangorn/output.rb, line 41
def self.source
  File.absolute_path(@@source)
end
source=(source) click to toggle source
# File lib/fangorn/output.rb, line 53
def self.source= (source)
  @@source = source
end

Public Instance Methods

create!() click to toggle source
# File lib/fangorn/output.rb, line 9
def create!
  FileUtils.mkdir_p File.dirname(@output)
  create_command
end
get_config() click to toggle source
# File lib/fangorn/output.rb, line 19
def get_config
  if @config
    @config[Output::env]
  end
end
remove!() click to toggle source
# File lib/fangorn/output.rb, line 13
def remove!
  FileUtils.rm_f @output
end
to_s() click to toggle source
# File lib/fangorn/output.rb, line 16
def to_s
  @output
end