Skip to content

Commit

Permalink
Do not always build min
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Oct 23, 2013
1 parent 9a899ec commit 0ebde6e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ gemspec

gem 'rake'

gem 'opal', :github => 'opal/opal'
gem 'opal-sprockets'
gem 'opal', :github => 'opal/opal'
gem 'opal-sprockets', :github => 'opal/opal-sprockets'

# As we monkey patch a lot, work of a specific commit on github
gem 'rspec-expectations', :github => 'rspec/rspec-expectations', :ref => '4c47e4c43e'
Expand Down
23 changes: 15 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,27 @@ Opal::RSpec::RakeTask.new(:default)

desc "Build opal/opal/rspec/rspec.js"
task :build do
File.open('opal/opal/rspec/rspec.js', 'w+') do |out|
out << build_rspec
end
end

desc "Show dev/min sizes"
task :sizes do
code = build_rspec
min = uglify code

puts "\ndevelopment: #{code.size}, minified: #{min.size}"
end

def build_rspec
Opal::Processor.dynamic_require_severity = :warning
Opal.append_path 'app'

Opal.use_gem 'rspec'
Opal.use_gem 'rspec-expectations'

code = Opal.process('rspec-builder')
min = uglify code

puts "\ndevelopment: #{code.size}, minified: #{min.size}"

File.open('opal/opal/rspec/rspec.js', 'w+') do |out|
out << code
end
Opal.process('rspec-builder')
end

def uglify(str)
Expand Down

0 comments on commit 0ebde6e

Please sign in to comment.