rake-hooks 1.1.1 → 1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,21 +1,29 @@
1
- def before(*task_names, &new_task)
2
- task_names.each do |task_name|
3
- old_task = Rake.application.instance_variable_get('@tasks').delete(task_name.to_s)
4
- desc old_task.full_comment
5
- task task_name do
6
- new_task.call
7
- old_task.invoke
1
+ module Rake::Hooks
2
+ def before(*task_names, &new_task)
3
+ task_names.each do |task_name|
4
+ old_task = Rake.application.instance_variable_get('@tasks').delete(task_name.to_s)
5
+ desc old_task.full_comment
6
+ task task_name do
7
+ new_task.call
8
+ old_task.invoke
9
+ end
8
10
  end
9
11
  end
10
- end
11
12
 
12
- def after(*task_names, &new_task)
13
- task_names.each do |task_name|
14
- old_task = Rake.application.instance_variable_get('@tasks').delete(task_name.to_s)
15
- desc old_task.full_comment
16
- task task_name do
17
- old_task.invoke
18
- new_task.call
13
+ def after(*task_names, &new_task)
14
+ task_names.each do |task_name|
15
+ old_task = Rake.application.instance_variable_get('@tasks').delete(task_name.to_s)
16
+ desc old_task.full_comment
17
+ task task_name do
18
+ old_task.invoke
19
+ new_task.call
20
+ end
19
21
  end
20
22
  end
21
23
  end
24
+
25
+ if defined?(Rake::DSL)
26
+ Rake::DSL.send(:include, Rake::Hooks)
27
+ else
28
+ include Rake::Hooks
29
+ end
@@ -1,5 +1,5 @@
1
1
  module Rake
2
2
  module Hooks
3
- VERSION = "1.1.1"
3
+ VERSION = "1.2"
4
4
  end
5
5
  end
@@ -19,9 +19,8 @@ end
19
19
 
20
20
 
21
21
  class TestRakeHooks < Test::Unit::TestCase
22
- begin
22
+ if defined?(Rake::DSL)
23
23
  include Rake::DSL
24
- rescue
25
24
  end
26
25
 
27
26
  def setup
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake-hooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: '1.2'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ date: 2011-09-09 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
17
- requirement: &2152395480 !ruby/object:Gem::Requirement
17
+ requirement: &2153109460 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 0.9.2
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2152395480
25
+ version_requirements: *2153109460
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: bundler
28
- requirement: &2152395060 !ruby/object:Gem::Requirement
28
+ requirement: &2153109040 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *2152395060
36
+ version_requirements: *2153109040
37
37
  description: Add after and before hooks to rake tasks. You can use "after :task do
38
38
  ... end" and "before :task do ... end".
39
39
  email: