Class: RugularHaml

Inherits:
Object
  • Object
show all
Defined in:
lib/rugular/tasks/server/guards/rugular_haml.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(haml_file) ⇒ RugularHaml

Returns a new instance of RugularHaml.



12
13
14
# File 'lib/rugular/tasks/server/guards/rugular_haml.rb', line 12

def initialize(haml_file)
  @haml_file = haml_file
end

Class Method Details

.compile(haml_file) ⇒ Object



4
5
6
# File 'lib/rugular/tasks/server/guards/rugular_haml.rb', line 4

def self.compile(haml_file)
  new(haml_file).compile
end

.delete(haml_file) ⇒ Object



8
9
10
# File 'lib/rugular/tasks/server/guards/rugular_haml.rb', line 8

def self.delete(haml_file)
  new(haml_file).delete
end

Instance Method Details

#compileObject



16
17
18
19
20
# File 'lib/rugular/tasks/server/guards/rugular_haml.rb', line 16

def compile
  write_tmp_file

  "Successfully compiled #{haml_file} to html!\n"
end

#deleteObject



22
23
24
25
26
# File 'lib/rugular/tasks/server/guards/rugular_haml.rb', line 22

def delete
  FileUtils.rm(tmp_file)

  "Sucessfully removed #{tmp_file}\n"
end