Class: RugularCoffee

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(coffee_file) ⇒ RugularCoffee

Returns a new instance of RugularCoffee.



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

def initialize(coffee_file)
  @coffee_file = coffee_file
end

Class Method Details

.compile(coffee_file) ⇒ Object



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

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

.delete(coffee_file) ⇒ Object



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

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

Instance Method Details

#compileObject



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

def compile
  write_tmp_file

  "Successfully compiled #{coffee_file} to js!\n"
end

#deleteObject



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

def delete
  FileUtils.rm(tmp_file)

  "Sucessfully removed #{tmp_file}\n"
end