rake-hooks 1.1.1 → 1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rake/hooks.rb +23 -15
- data/lib/rake/hooks/version.rb +1 -1
- data/test/test_rake_hooks.rb +1 -2
- metadata +5 -5
data/lib/rake/hooks.rb
CHANGED
@@ -1,21 +1,29 @@
|
|
1
|
-
|
2
|
-
task_names
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
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
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
data/lib/rake/hooks/version.rb
CHANGED
data/test/test_rake_hooks.rb
CHANGED
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.
|
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: &
|
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: *
|
25
|
+
version_requirements: *2153109460
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: bundler
|
28
|
-
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: *
|
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:
|