Permalink
Browse files

adding rake task to group js files into one

  • Loading branch information...
1 parent 8d8776b commit 31246214eefb8de2a83f8f2860aff83b0653fc6a @jomz committed Sep 20, 2010
Showing with 15 additions and 9 deletions.
  1. +15 −9 lib/tasks/gorillafy_extension_tasks.rake
View
24 lib/tasks/gorillafy_extension_tasks.rake
@@ -1,4 +1,19 @@
namespace :radiant do
+ namespace :assets do
+ desc "Groups all javascript and css files into 1 'main'"
+ task :group do
+ Javascripts = %w(jquery application).map { |js| File.join(RAILS_ROOT, 'public/javascripts', "#{js}.js") }
+
+ cache_file = File.open(File.join(RAILS_ROOT, 'public', 'javascripts', 'all.js'), 'w')
+ Javascripts.each do |js|
+ cache_file << File.read(js)
+ cache_file << "\n\n"
+ end
+ cache_file.close
+ end
+ end
+
+
namespace :extensions do
namespace :gorillafy do
@@ -26,12 +41,3 @@ namespace :radiant do
end
end
end
-
-namespace 'views' do
- desc 'Renames all your rhtml views to erb'
- task 'rename' do
- Dir.glob('**/views/**/*.rhtml').each do |file|
- puts `git mv #{file} #{file.gsub(/\.rhtml$/, '.html.erb')}`
- end
- end
-end

0 comments on commit 3124621

Please sign in to comment.