This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def run_in_background(&block) | |
Process.fork do | |
Process.fork do | |
puts "Launching Background Process" | |
Daemons.call &block | |
puts "Background Process has been Launched" | |
end | |
exit | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test2_spec.rb - call using 'rspec test2_spec.rb' | |
require 'rspec' | |
require 'mocha' | |
RSpec::configure do |config| | |
config.mock_with :mocha | |
end | |
class Test2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test2_spec.rb - call using 'rspec test2_spec.rb' | |
require 'rspec' | |
class Test2 | |
attr_accessor :msg | |
def initialize | |
@msg = sayhi | |
end | |
def sayhi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c | |
d | |
e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You can become a registered Vim user by sending at least 10 euro. This works | |
similar to sponsoring Vim, see |sponsor| above. Registration was made | |
possible for the situation where your boss or bookkeeper may be willing to | |
register software, but does not like the terms "sponsoring" and "donation". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test1_spec.rb - run this using "rspec test1_spec.rb" | |
require 'rspec' | |
class Test1 | |
def initialize | |
sayhi | |
end | |
def sayhi | |
puts "HI" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems'; require 'parslet' | |
class Xp < Parslet::Parser | |
rule(:b) { str("\n").absnt? } | |
root(:b) | |
end | |
# this generates an error - I think it should just return "a"... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'parslet' | |
class LineParser < Parslet::Parser | |
rule(:eol) { match['\n\r'] } | |
rule(:eol?) { eol.maybe } | |
rule(:line) { (any.repeat).as(:line) } | |
rule(:line_eol) { line >> eol? } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
=begin | |
Example One - this is working | |
In this example, the constant (ZZZ) is set in the | |
Spec, and detected in the target code. | |
=end | |
module TestModule | |
class TestClass |