Skip to content

Commit

Permalink
added coffee-script compile task
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Dec 28, 2011
1 parent bdf5241 commit ca0d106
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Gemfile
Expand Up @@ -6,7 +6,8 @@ gem 'sprockets'


group :development do group :development do
gem 'thin', :require => false, :platforms => :ruby gem 'thin', :require => false, :platforms => :ruby
gem 'racksh' gem 'racksh', :require => false
gem 'coffee-script'


gem 'capistrano', :require => false gem 'capistrano', :require => false
gem 'capistrano_colors', :require => false gem 'capistrano_colors', :require => false
Expand Down
7 changes: 7 additions & 0 deletions Gemfile.lock
Expand Up @@ -21,9 +21,15 @@ GEM
mechanize (~> 2.0.0) mechanize (~> 2.0.0)
childprocess (0.2.4) childprocess (0.2.4)
ffi (~> 1.0.6) ffi (~> 1.0.6)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.2.0)
daemons (1.1.5) daemons (1.1.5)
diff-lcs (1.1.3) diff-lcs (1.1.3)
eventmachine (0.12.10) eventmachine (0.12.10)
execjs (1.2.13)
multi_json (~> 1.0)
ffi (1.0.11) ffi (1.0.11)
ffi (1.0.11-java) ffi (1.0.11-java)
fuubar (0.0.6) fuubar (0.0.6)
Expand Down Expand Up @@ -113,6 +119,7 @@ DEPENDENCIES
capistrano_colors capistrano_colors
capybara capybara
capybara-mechanize (~> 0.3.0.rc3) capybara-mechanize (~> 0.3.0.rc3)
coffee-script
fuubar fuubar
launchy launchy
pit pit
Expand Down
10 changes: 10 additions & 0 deletions Rakefile
Expand Up @@ -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/*` `cd #{root_dir} && rdoc --all --charset=UTF8 --op=rdoc --inline-source README ChangeLog index.rb update.rb tdiary.rb tdiary/* misc/* plugin/*`
end 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: # Local Variables:
# mode: ruby # mode: ruby
# indent-tabs-mode: t # indent-tabs-mode: t
Expand Down

0 comments on commit ca0d106

Please sign in to comment.