Module: Printrun
- Extended by:
- Printrun
- Includes:
- Core
- Included in:
- Printrun
- Defined in:
- lib/printrun.rb,
lib/printrun/core.rb,
lib/printrun/version.rb
Defined Under Namespace
Modules: Core
Constant Summary collapse
- VERSION =
"0.0.1"
Instance Method Summary collapse
- #err(world = nil, &block) ⇒ Object
-
#on(io, world = proc { binding }[], &block) ⇒ Object
careful of the bug of sourcify with double quotes (if still there at time of reading)…
- #out(world = nil, &block) ⇒ Object
Methods included from Core
Instance Method Details
#err(world = nil, &block) ⇒ Object
26 27 28 |
# File 'lib/printrun.rb', line 26 def err(world = nil, &block) world ? on(STDERR, world, &block) : on(STDERR, &block) end |
#on(io, world = proc { binding }[], &block) ⇒ Object
careful of the bug of sourcify with double quotes (if still there at time of reading)…
13 14 15 16 17 18 19 20 |
# File 'lib/printrun.rb', line 13 def on(io, world = proc { binding }[], &block) i = 0 line_eval(world, proc { |line| io.puts "#{i += 1} >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#{line}\n --- " proc { |ans| io.puts "#{ans}\ndone!" } }, &block) end |
#out(world = nil, &block) ⇒ Object
22 23 24 |
# File 'lib/printrun.rb', line 22 def out(world = nil, &block) world ? on(STDOUT, world, &block) : on(STDOUT, &block) end |