-
Notifications
You must be signed in to change notification settings - Fork 0
/
join
executable file
·35 lines (30 loc) · 1.21 KB
/
join
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/ruby
files = %w{markupEditor plugins/t10n locale/en plugins/isValid util
plugins/enhanceTextfield plugins/combobox dialog
core/jqueryHook core/mode core/toolbar core/editor
modes/textile/textileMode modes/textile/bruteForceCompiler modes/wysiwygMode modes/hamlMode}
File.open('source/javascripts/joined.js','w') do |file|
files.each do |filename|
regexp = /( # Match she-bang style C-comment
\/\*[!*] # Opening delimiter.
[^*]*\*+ # {normal*} Zero or more non-*, one or more *
(?: # Begin {(special normal*)*} construct.
[^*\/] # {special} a non-*, non-\/ following star.
[^*]*\*+ # More {normal*}
)* # Finish "Unrolling-the-Loop"
\/ # Closing delimiter.
| # Or
$\s*\/\/.* # One line comments
|
$\s*console\..*
)/x
file.puts File.open('source/javascripts/' + filename + '.js').read.gsub(regexp, '')
end
end
require 'rubygems'
require 'closure-compiler'
File.open('source/javascripts/joined-min.js','w') do |file|
# closure = Closure::Compiler.new(:compilation_level => 'ADVANCED_OPTIMIZATIONS')
closure = Closure::Compiler.new
file.puts closure.compile(File.open('source/javascripts/joined.js', 'r'))
end