Sha256: fdd4eea3bc3f2cf6dfbdead807e59522e775c4f98f69473aa5bccc15e671b77b
Contents?: true
Size: 355 Bytes
Versions: 2
Compression:
Stored size: 355 Bytes
Contents
#!/usr/bin/env ruby require "rubygems" require "ruby_process" RubyProcess.new.spawn_process do |rp| #Spawns string in the subprocess. str = rp.new(:String, "Kasper is 26 years old") #Scans with regex in subprocess, but yields proxy-objects in the current process. str.scan(/is (\d+) years old/) do |match| puts match.__rp_marshal end end
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
ruby_process-0.0.13 | examples/example_strscan.rb |
RubyProcess-0.0.12 | examples/example_strscan.rb |