Class: Tavola::Demonstration
- Inherits:
-
Object
- Object
- Tavola::Demonstration
- Defined in:
- lib/tavola/demonstrations.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(config, path) ⇒ Demonstration
constructor
A new instance of Demonstration.
- #qed_augment(path) ⇒ Object
- #relative_path ⇒ Object
- #render ⇒ Object
- #root ⇒ Object
Constructor Details
#initialize(config, path) ⇒ Demonstration
32 33 34 35 |
# File 'lib/tavola/demonstrations.rb', line 32 def initialize config, path @config = config @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
30 31 32 |
# File 'lib/tavola/demonstrations.rb', line 30 def path @path end |
Instance Method Details
#qed_augment(path) ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/tavola/demonstrations.rb', line 51 def qed_augment path # Mostly a copy from Session#run in QED. settings = ::QED::Settings.new() session = ::QED::Session.new(settings) io = StringIO.new reporter = QED::Reporter.new(io: io) session.prepare_loadpath session.require_libraries demo = ::QED::Demo.new(path, at: root) demo.steps ::QED::Evaluator.run(demo, observers: [reporter], settings: settings) p io io.string end |
#relative_path ⇒ Object
42 43 44 |
# File 'lib/tavola/demonstrations.rb', line 42 def relative_path remove_root(path) end |
#render ⇒ Object
46 47 48 49 |
# File 'lib/tavola/demonstrations.rb', line 46 def render qed_augment(path) # File.read(path) end |