Class: Raketeer::IRBTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Raketeer::IRBTask
- Defined in:
- lib/raketeer/irb_task.rb
Overview
Instance Attribute Summary collapse
- #description ⇒ Object
- #irb_cmd ⇒ Object
- #main_module ⇒ Object
- #name ⇒ Object
- #warning ⇒ Object (also: #warning?)
Instance Method Summary collapse
- #define ⇒ Object
-
#initialize(name = :irb) {|_self| ... } ⇒ IRBTask
constructor
A new instance of IRBTask.
Constructor Details
#initialize(name = :irb) {|_self| ... } ⇒ IRBTask
Returns a new instance of IRBTask.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/raketeer/irb_task.rb', line 32 def initialize(name=:irb) super() @description = 'Open an irb session loaded with this library' @main_module = Util.find_main_module @name = name @warning = true @irb_cmd = ['irb'] @irb_cmd.push('-r','rubygems') @irb_cmd.push('-r','bundler/setup') yield self if block_given? @irb_cmd.push('-r',@main_module) unless @main_module.nil? @irb_cmd << '-w' if @warning define end |
Instance Attribute Details
#description ⇒ Object
24 25 26 |
# File 'lib/raketeer/irb_task.rb', line 24 def description @description end |
#irb_cmd ⇒ Object
25 26 27 |
# File 'lib/raketeer/irb_task.rb', line 25 def irb_cmd @irb_cmd end |
#main_module ⇒ Object
26 27 28 |
# File 'lib/raketeer/irb_task.rb', line 26 def main_module @main_module end |
#name ⇒ Object
27 28 29 |
# File 'lib/raketeer/irb_task.rb', line 27 def name @name end |
#warning ⇒ Object Also known as: warning?
28 29 30 |
# File 'lib/raketeer/irb_task.rb', line 28 def warning @warning end |
Instance Method Details
#define ⇒ Object
52 53 54 55 56 57 |
# File 'lib/raketeer/irb_task.rb', line 52 def define desc @description task @name do |task,args| sh(*@irb_cmd) end end |