aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/Rakefile
diff options
context:
space:
mode:
authorJavan Makhmali <javan@javan.us>2016-05-23 09:37:16 -0400
committerJavan Makhmali <javan@javan.us>2016-05-24 13:11:10 -0400
commit11078dddbb94c620bff13a7c656390392b2007f8 (patch)
tree65216a0d9e047bf55db62f7878d931d9ae8bd1ee /actioncable/Rakefile
parent6a2b2058e57d0474588fcabad261182cdb8866ef (diff)
downloadrails-11078dddbb94c620bff13a7c656390392b2007f8.tar.gz
rails-11078dddbb94c620bff13a7c656390392b2007f8.tar.bz2
rails-11078dddbb94c620bff13a7c656390392b2007f8.zip
Build action_cable.js with Blade
Diffstat (limited to 'actioncable/Rakefile')
-rw-r--r--actioncable/Rakefile40
1 files changed, 4 insertions, 36 deletions
diff --git a/actioncable/Rakefile b/actioncable/Rakefile
index 58c18dd457..aa62265ac9 100644
--- a/actioncable/Rakefile
+++ b/actioncable/Rakefile
@@ -1,15 +1,14 @@
require 'rake/testtask'
require 'pathname'
-require 'sprockets'
-require 'coffee-script'
require 'action_cable'
+require 'blade'
dir = File.dirname(__FILE__)
task :default => :test
task :package => "assets:compile"
-task "package:clean" => "assets:clean"
+task "package:clean"
Rake::TestTask.new do |t|
t.libs << "test"
@@ -27,44 +26,13 @@ namespace :test do
end
task :javascript do
- require 'blade'
Blade.start(interface: :runner)
end
end
namespace :assets do
- root_path = Pathname.new(dir)
- destination_path = root_path.join("lib/assets/compiled")
-
- desc "Compile dist/action_cable.js"
+ desc "Compile Action Cable assets"
task :compile do
- puts 'Compiling Action Cable assets...'
-
- precompile_list = %w(action_cable.js)
-
- environment = Sprockets::Environment.new
- environment.gzip = false
- Pathname.glob(root_path.join("app/assets/*/")) do |subdir|
- environment.append_path subdir
- end
-
- compile_path = root_path.join("tmp/sprockets")
- compile_path.rmtree if compile_path.exist?
- compile_path.mkpath
-
- manifest = Sprockets::Manifest.new(environment.index, compile_path)
- manifest.compile(precompile_list)
-
- destination_path.rmtree if destination_path.exist?
- manifest.assets.each do |path, fingerprint_path|
- destination_path.join(path).dirname.mkpath
- FileUtils.cp(compile_path.join(fingerprint_path), destination_path.join(path))
- end
-
- puts 'Done'
- end
-
- task :clean do
- destination_path.rmtree if destination_path.exist?
+ Blade.build
end
end