Rakefile in opal-0.3.18 vs Rakefile in opal-0.3.19
- old
+ new
@@ -3,31 +3,32 @@
Bundler.setup
require 'opal'
require 'opal/version'
+Opal::BuilderTask.new do |t|
+ t.name = 'opal'
+ t.files = []
+ t.dependencies = %w[opal-spec]
+ t.specs_dir = 'test'
+ t.specs_main = 'test/spec_helper'
+end
+
desc "Build opal.js runtime into ./build"
-task :opal do
+task :build do
File.open('build/opal.js', 'w+') do |o|
o.write Opal::Builder.runtime
end
end
-Opal::BuilderTask.new do |t|
- t.name = 'opal'
- t.files = []
- t.specs_dir = './core/spec'
- t.dependencies = %w[opal-spec opal-racc opal-strscan]
-end
-
desc "Check file sizes for opal.js runtime"
task :sizes do
o = File.read 'build/opal.js'
m = uglify o
g = gzip m
- puts "#{opal.js}:"
+ puts "opal.js:"
puts "development: #{o.size}, minified: #{m.size}, gzipped: #{g.size}"
end
desc "Rebuild grammar.rb for opal parser"
task :racc do
@@ -60,50 +61,7 @@
end
desc "Release opal-#{Opal::VERSION}.gem"
task :release do
puts "Need to release opal-#{Opal::VERSION}.gem"
- end
-end
-
-# Documentation
-namespace :docs do
- task :clone do
- if File.exists? 'gh-pages'
- Dir.chdir('gh-pages') { sh 'git pull origin gh-pages' }
- else
- FileUtils.mkdir_p 'gh-pages'
- Dir.chdir('gh-pages') do
- sh 'git clone git@github.com:/adambeynon/opal.git .'
- sh 'git checkout gh-pages'
- end
- end
- end
-
- task :build do
- require 'redcarpet'
- require 'albino'
-
- klass = Class.new(Redcarpet::Render::HTML) do
- def block_code(code, language)
- Albino.new(code, language || :text).colorize
- end
- end
-
- markdown = Redcarpet::Markdown.new(klass, :fenced_code_blocks => true)
- sources = %w[index]
-
- sources.each do |s|
- File.open(File.join('gh-pages', "#{s}.html"), 'w+') do |o|
- o.write File.read('docs/pre.html')
- o.write markdown.render(File.read "docs/#{s}.md")
- o.write File.read('docs/post.html')
- end
- end
- end
-
- task :copy do
- FileUtils.cp 'build/opal.js', 'gh-pages/opal.js'
- FileUtils.cp 'docs/styles.css', 'gh-pages/styles.css'
- FileUtils.cp 'docs/syntax.css', 'gh-pages/syntax.css'
end
end
\ No newline at end of file