Permalink
Browse files

added coffee-script compile task

  • Loading branch information...
1 parent bdf5241 commit ca0d1067a5e7078ac3d32a5ccc06df54c03e52d4 @hsbt hsbt committed Dec 28, 2011
Showing with 19 additions and 1 deletion.
  1. +2 −1 Gemfile
  2. +7 −0 Gemfile.lock
  3. +10 −0 Rakefile
View
3 Gemfile
@@ -6,7 +6,8 @@ gem 'sprockets'
group :development do
gem 'thin', :require => false, :platforms => :ruby
- gem 'racksh'
+ gem 'racksh', :require => false
+ gem 'coffee-script'
gem 'capistrano', :require => false
gem 'capistrano_colors', :require => false
View
7 Gemfile.lock
@@ -21,9 +21,15 @@ GEM
mechanize (~> 2.0.0)
childprocess (0.2.4)
ffi (~> 1.0.6)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.2.0)
daemons (1.1.5)
diff-lcs (1.1.3)
eventmachine (0.12.10)
+ execjs (1.2.13)
+ multi_json (~> 1.0)
ffi (1.0.11)
ffi (1.0.11-java)
fuubar (0.0.6)
@@ -113,6 +119,7 @@ DEPENDENCIES
capistrano_colors
capybara
capybara-mechanize (~> 0.3.0.rc3)
+ coffee-script
fuubar
launchy
pit
View
10 Rakefile
@@ -84,6 +84,16 @@ task :rdoc do
`cd #{root_dir} && rdoc --all --charset=UTF8 --op=rdoc --inline-source README ChangeLog index.rb update.rb tdiary.rb tdiary/* misc/* plugin/*`
end
+desc "compile coffeescript"
+task :compile do
+ require 'coffee-script'
+ FileList['js/**/*.coffee'].each do |coffee|
+ File.open(Pathname(coffee).sub_ext('.js'), 'w') do |js|
+ js.write CoffeeScript.compile(File.read(coffee))
+ end
+ end
+end
+
# Local Variables:
# mode: ruby
# indent-tabs-mode: t

0 comments on commit ca0d106

Please sign in to comment.