Class: Rake::ErrgentTask
- Inherits:
-
TaskLib
- Object
- TaskLib
- Rake::ErrgentTask
- Defined in:
- lib/errgent/task.rb
Instance Attribute Summary collapse
-
#codes ⇒ Object
Returns the value of attribute codes.
-
#destination ⇒ Object
Returns the value of attribute destination.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#renderer ⇒ Object
readonly
Returns the value of attribute renderer.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
- #define ⇒ Object
-
#initialize(name = :errgent) {|_self| ... } ⇒ ErrgentTask
constructor
A new instance of ErrgentTask.
Constructor Details
#initialize(name = :errgent) {|_self| ... } ⇒ ErrgentTask
Returns a new instance of ErrgentTask.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/errgent/task.rb', line 11 def initialize(name = :errgent) @name = name @renderer = Errgent::Renderer.new @codes = [500, 403, 404, 422] @source = File.join('layouts', 'error_page') @destination = File.join('public', '%{code}.html') yield self if block_given? define end |
Instance Attribute Details
#codes ⇒ Object
Returns the value of attribute codes.
9 10 11 |
# File 'lib/errgent/task.rb', line 9 def codes @codes end |
#destination ⇒ Object
Returns the value of attribute destination.
9 10 11 |
# File 'lib/errgent/task.rb', line 9 def destination @destination end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/errgent/task.rb', line 8 def name @name end |
#renderer ⇒ Object (readonly)
Returns the value of attribute renderer.
8 9 10 |
# File 'lib/errgent/task.rb', line 8 def renderer @renderer end |
#source ⇒ Object
Returns the value of attribute source.
9 10 11 |
# File 'lib/errgent/task.rb', line 9 def source @source end |
Instance Method Details
#define ⇒ Object
24 25 26 27 28 29 |
# File 'lib/errgent/task.rb', line 24 def define desc 'Generates error pages' task name => :environment do generate_error_pages end end |