lib/coffeescript.rb in capucine-0.0.5 vs lib/coffeescript.rb in capucine-0.0.6
- old
+ new
@@ -16,21 +16,24 @@
Dir.glob(coffee_files).each do |file_coffee_o|
file_coffee = File.expand_path file_coffee_o
base_in_dir = File.join settings.working_dir, input
- relative_path = File.basename(file_coffee)
+ relative_path = file_coffee.gsub(File.join(Capucine.settings.working_dir, Capucine.settings.config['coffeescript_files_dir'] ),'')
relative_path = relative_path.gsub(/\.coffee$/, '.js')
relative_path_min = relative_path.gsub(/\.js$/, '.min.js')
+ # exit
+
file_out = File.join settings.working_dir, output, relative_path
file_out_min = File.join settings.working_dir, output, relative_path_min
relative_coffee_file = file_coffee.gsub(base_in_dir, '')
opts = settings.config['coffeescript_options']
-
+ opts = {:bare => true}
+
coffee_output_min = ""
error = false
begin
coffee_output = CoffeeScript.compile(File.read(file_coffee), opts)
@@ -66,11 +69,10 @@
else
self.compile_dir file, settings.config['coffeescript_output_dir']
end
puts "[coffee] - Compiled"
- # Capucine::Incloudr.run_once if settings.config['incloudr_enable']
end
def self.proc_watch
settings = Capucine.settings
@@ -79,15 +81,15 @@
coffee_thread = Thread.new {
FSSM.monitor(files_to_lookat, :directories => true) do
update do |b, r|
file = File.join b, r
- Capucine::Coffee.run_once file if File.extname(r) == '.coffee'
+ Capucine::Coffee.run_once file if File.extname(r) == '.coffee'
end
create do |b, r|
file = File.join b, r
- Capucine::Coffee.run_once file if File.extname(r) == '.coffee'
+ Capucine::Coffee.run_once file if File.extname(r) == '.coffee'
end
delete do |b, r|
file_name = File.expand_path File.join(b, r)