Class: Rake::Task
- Inherits:
-
Object
- Object
- Rake::Task
- Defined in:
- lib/raken.rb
Instance Attribute Summary collapse
-
#beginning ⇒ Object
readonly
Returns the value of attribute beginning.
-
#ending ⇒ Object
readonly
Returns the value of attribute ending.
Instance Method Summary collapse
- #_enhance ⇒ Object
- #apply_task_body(blk, *params) ⇒ Object
- #duration ⇒ Object
- #enhance(*args, &blk) ⇒ Object
Instance Attribute Details
#beginning ⇒ Object (readonly)
Returns the value of attribute beginning.
69 70 71 |
# File 'lib/raken.rb', line 69 def beginning @beginning end |
#ending ⇒ Object (readonly)
Returns the value of attribute ending.
69 70 71 |
# File 'lib/raken.rb', line 69 def ending @ending end |
Instance Method Details
#_enhance ⇒ Object
68 |
# File 'lib/raken.rb', line 68 alias_method :_enhance, :enhance |
#apply_task_body(blk, *params) ⇒ Object
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/raken.rb', line 81 def apply_task_body blk, *params if application..time && (application..time == 'all' || ARGV.include?(name)) org_blk = blk blk = lambda { |*args| begin @beginning = Time.now org_blk.call *args ensure @ending = Time.now end } end return blk.call *params unless ARGV.include?(name) if application..trace_tree binding.trace_tree(**application..trace_tree) do blk.call *params end elsif application..pry_debug binding.pry blk.call *params else blk.call *params end end |
#duration ⇒ Object
109 110 111 |
# File 'lib/raken.rb', line 109 def duration @ending - @beginning end |
#enhance(*args, &blk) ⇒ Object
71 72 73 74 75 76 77 78 79 |
# File 'lib/raken.rb', line 71 def enhance *args, &blk if block_given? _enhance *args do |*params| apply_task_body blk, *params end else _enhance *args end end |