diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e2b343..3aadbe3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ ## Edge version +## v0.9.2 + +* remove before hook in favour of rake dependency by @itszootime and @carsomyr [#121][] + +[#121]: https://github.com/42dev/bower-rails/pull/121 + ## v0.9.1 * add `bower:clean:cache` rake task by @ruprict [#115][] diff --git a/lib/bower-rails/version.rb b/lib/bower-rails/version.rb index b6a3a3e..ea1da89 100644 --- a/lib/bower-rails/version.rb +++ b/lib/bower-rails/version.rb @@ -1,4 +1,4 @@ # -*- encoding : utf-8 -*- module BowerRails - VERSION = "0.9.1" + VERSION = "0.9.2" end diff --git a/lib/tasks/bower.rake b/lib/tasks/bower.rake index e93f583..31e97fb 100644 --- a/lib/tasks/bower.rake +++ b/lib/tasks/bower.rake @@ -1,8 +1,5 @@ -require 'tasks/helpers/before_hook' require 'bower-rails/performer' -include BeforeHook - namespace :bower do desc "Install components from bower" task :install, :options do |_, args| @@ -86,10 +83,12 @@ namespace :bower do end end end -end -before_rake_task 'assets:precompile' do - BowerRails.tasks.map do |task| - Rake::Task[task].invoke + task :before_precompile do + BowerRails.tasks.each do |task| + Rake::Task[task].invoke + end end end + +task "assets:precompile" => ["bower:before_precompile"] diff --git a/lib/tasks/helpers/before_hook.rb b/lib/tasks/helpers/before_hook.rb deleted file mode 100644 index 95e24ac..0000000 --- a/lib/tasks/helpers/before_hook.rb +++ /dev/null @@ -1,20 +0,0 @@ -module BeforeHook - # The `before` hook for rake tasks. - # The code was taken from https://github.com/guillermo/rake-hooks/blob/master/lib/rake/hooks.rb#L2 - def before_rake_task(*task_names, &new_task) - task_names.each do |task_name| - old_task = Rake.application.instance_variable_get('@tasks').delete(task_name.to_s) - return unless old_task - - desc old_task.full_comment - task task_name => old_task.prerequisites do - begin - new_task.call - rescue LoadError - #empty - end - old_task.invoke - end - end - end -end