1a6dd72e by Michael Richards

Remove Gemfile, Rakefile, Guardfile.

1 parent f150b31d
source :rubygems
gem 'coffee-script'
gem 'closure-compiler'
gem 'guard'
gem 'guard-coffeescript'
GEM
remote: http://rubygems.org/
specs:
closure-compiler (1.1.6)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.3.3)
execjs (1.4.0)
multi_json (~> 1.0)
ffi (1.0.11)
guard (1.0.2)
ffi (>= 0.5.0)
thor (~> 0.14.6)
guard-coffeescript (0.6.0)
coffee-script (>= 2.2.0)
guard (>= 0.8.3)
multi_json (1.3.6)
thor (0.14.6)
PLATFORMS
ruby
DEPENDENCIES
closure-compiler
coffee-script
guard
guard-coffeescript
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
guard 'coffeescript', :input => 'src', :output => 'build'
require 'rubygems'
BUILD_DIRECTORY = 'lib'
SRC_DIRECTORY = 'src'
desc "build the toast-min.js files for distribution"
task :default => :clean do
FileUtils.mkdir_p(BUILD_DIRECTORY)
compile_js
end
task :build => :default
desc "removes the build directory"
task :clean do
print_action('Removing existing build directory') do
FileUtils.rm_rf(BUILD_DIRECTORY)
end
end
def compile_js()
require 'coffee-script'
require 'closure-compiler'
source = File.read(File.join(SRC_DIRECTORY, 'rivets.coffee'))
FileUtils.mkdir_p(BUILD_DIRECTORY)
output = File.join(BUILD_DIRECTORY, 'rivets.js')
minified_output = File.join(BUILD_DIRECTORY, 'rivets-min.js')
compiled = ''
print_action("Compiling CoffeeScript to '#{output}'") do
File.open(output, 'w+') do |file|
compiled = CoffeeScript.compile(source)
file.write(compiled)
end
end
print_action("Minifying Javascript to '#{minified_output}'") do
File.open(minified_output, 'w+') do |file|
file.write(Closure::Compiler.new.compress(compiled))
end
end
end
def print_action(action, &block)
print "#{action}... "
STDOUT.flush
if block.call()
puts 'done'
else
puts 'failed'
end
end