Skip to content

Commit 95b6e0b

Browse files
committedOct 15, 2014
Remove 'rake build' task
1 parent c46aba1 commit 95b6e0b

File tree

1 file changed

+0
-66
lines changed

1 file changed

+0
-66
lines changed
 

‎Rakefile

-66
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,7 @@
11
require 'bundler'
22
Bundler.require
33

4-
5-
desc "Build opal/opal/rspec/rspec.js"
6-
task :dist do
7-
File.open('opal/opal/rspec/rspec.js', 'w+') do |out|
8-
out << build_rspec
9-
end
10-
end
11-
12-
134
Bundler::GemHelper.install_tasks
14-
task :build => :dist
15-
165

176
require 'opal/rspec/rake_task'
187
Opal::RSpec::RakeTask.new(:default)
19-
task :default => :dist
20-
21-
22-
desc "Show dev/min sizes"
23-
task :sizes do
24-
code = build_rspec
25-
min = uglify code
26-
27-
puts "\ndevelopment: #{code.size}, minified: #{min.size}"
28-
end
29-
30-
31-
32-
33-
def build_rspec
34-
Opal::Processor.dynamic_require_severity = :warning
35-
36-
code = []
37-
gems = %w(rspec rspec-core rspec-support rspec-expectations rspec-mocks)
38-
39-
gems.each do |gem_name|
40-
spec = Gem::Specification.find_by_name gem_name
41-
gem_dir = File.join spec.gem_dir, 'lib'
42-
prefix = gem_dir + '/'
43-
44-
Dir.glob(File.join(gem_dir, '**/*.rb')).each do |source|
45-
requirable = source.sub(prefix, '').sub(/\.rb$/, '')
46-
47-
compiler = Opal::Compiler.new File.read(source),
48-
requirable: true, file: requirable, dynamic_require_severity: :warning
49-
50-
code << compiler.compile
51-
end
52-
end
53-
54-
stubs = %w(shellwords fileutils optparse)
55-
56-
stubs.each do |stub|
57-
compiler = Opal::Compiler.new '', requirable: true, file: stub
58-
code << compiler.compile
59-
end
60-
61-
code.join "\n"
62-
end
63-
64-
def uglify(str)
65-
IO.popen('uglifyjs', 'r+') do |i|
66-
i.puts str
67-
i.close_write
68-
return i.read
69-
end
70-
rescue Errno::ENOENT
71-
$stderr.puts '"uglifyjs" command not found (install with: "npm install -g uglify-js")'
72-
nil
73-
end

0 commit comments

Comments
 (0)
Please sign in to comment.