Class: SeeingIsBelieving::Binary::AddAnnotations
- Inherits:
-
Object
- Object
- SeeingIsBelieving::Binary::AddAnnotations
- Includes:
- HasException
- Defined in:
- lib/seeing_is_believing/binary/add_annotations.rb
Instance Attribute Summary collapse
-
#results ⇒ Object
Returns the value of attribute results.
Attributes included from HasException
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(uncleaned_body, options = {}, &annotater) ⇒ AddAnnotations
constructor
A new instance of AddAnnotations.
Constructor Details
#initialize(uncleaned_body, options = {}, &annotater) ⇒ AddAnnotations
Returns a new instance of AddAnnotations.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/seeing_is_believing/binary/add_annotations.rb', line 26 def initialize(uncleaned_body, ={}, &annotater) self. = self.body = CleanBody.call uncleaned_body, !xmpfilter_style self.results = SeeingIsBelieving.call body, filename: ([:as] || [:filename]), require: [:require], load_path: [:load_path], encoding: [:encoding], stdin: [:stdin], timeout: [:timeout], debugger: debugger, ruby_executable: [:shebang], number_of_captures: [:number_of_captures] end |
Instance Attribute Details
#results ⇒ Object
Returns the value of attribute results.
25 26 27 |
# File 'lib/seeing_is_believing/binary/add_annotations.rb', line 25 def results @results end |
Class Method Details
.method_from_options(*args) ⇒ Object
15 16 17 |
# File 'lib/seeing_is_believing/binary/add_annotations.rb', line 15 def self.(*args) define_method(args.first) { .fetch *args } end |
Instance Method Details
#call ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/seeing_is_believing/binary/add_annotations.rb', line 41 def call @new_body ||= begin new_body = if xmpfilter_style body_with_updated_annotations else body_with_everything_annotated end add_stdout_stderr_and_exceptions_to new_body debugger.context "OUTPUT" new_body end end |