Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Automatically download uglify.js

  • Loading branch information...
commit dcf67acdac49c2598cab67196b550d178397fa77 1 parent 0bfdbbd
@aslakhellesoy aslakhellesoy authored
Showing with 12 additions and 1 deletion.
  1. +12 −1 tasks/ragel_task.rb
View
13 tasks/ragel_task.rb
@@ -19,7 +19,10 @@ def initialize(lang, i18n)
end
def define_tasks
- file target => [lang_ragel, common_ragel] do
+ deps = [lang_ragel, common_ragel]
+ deps.unshift(UGLIFYJS) if(@lang == 'js')
+
+ file target => deps do
mkdir_p(File.dirname(target)) unless File.directory?(File.dirname(target))
sh "ragel #{flags} #{lang_ragel} -o #{target}"
if(@lang == 'js')
@@ -31,6 +34,14 @@ def define_tasks
end
end
+ file UGLIFYJS do
+ unless File.exist?(UGLIFYJS)
+ Dir.chdir('js') do
+ sh "npm link"
+ end
+ end
+ end
+
file lang_ragel => lang_erb do
write(ERB.new(IO.read(lang_erb)).result(binding), lang_ragel)
end
Please sign in to comment.
Something went wrong with that request. Please try again.