Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@tosch
tosch / yard_example.rb
Created Mar 15, 2013
Some YARD examples.
View yard_example.rb
# This is a very shallow example class for Yard.
#
# @abstract Subclass and override {#abstract_method} to implement a custom YardExample class.
class AbstractYardExample
# This is something abstract.
#
# @raise [NotImplementedError] if not overridden in subclass
def abstract_method
raise NotImplementedError
end
View gist:1035539
Failures:
1) /_ruote/processes GET /_ruote/processes/wfid with a running process gives process information back (HTML)
Failure/Error: get "/_ruote/processes/#{@wfid}"
NoMethodError:
undefined method `leaves' for #<Ruote::ProcessStatus:0x000000026195e8>
# ./lib/ruote-kit/resources/processes.rb:27:in `block in <class:Application>'
# ./spec/resources/processes_spec.rb:125:in `block (4 levels) in <top (required)>'
2) /_ruote/processes GET /_ruote/processes/wfid with a running process gives process information back (JSON)
View 01.rb
Ruote.process_definition 'foo' do
sequence do
alpha
concurrence do
alpha
alpha
end
end
end
View start_ruote_worker.rb
#!/usr/bin/env ruby
require 'rubygems' # or better use Bundler
require 'ruote'
require 'ruote/storage/fs_storage'
class WorkerInstance
def initialize(storage = Ruote::FsStorage.new(File.join(File.dirname(__FILE__), 'ruote_work')))
@storage, @worker = storage, Ruote::Worker.new(storage)
end
View scheduler.rb
class Scheduler
def initialize
end
def start
@scheduler = Rufus::Scheduler.start_new
['TERM', 'INT'].each do |signal|
Signal.trap(signal) { stop }
end
View gist:810874
ruby-1.9.2-p136@ruote-kit webtest@pc1:~/git/ruote-kit$ rake spec
(in /home/webtest/git/ruote-kit)
rake aborted!
uninitialized constant Gem::UserInteraction
/home/webtest/git/ruote-kit/Rakefile:35:in `<top (required)>'
(See full trace by running task with --trace)
ruby-1.9.2-p136@ruote-kit webtest@pc1:~/git/ruote-kit$ vim Rakefile
ruby-1.9.2-p136@ruote-kit webtest@pc1:~/git/ruote-kit$ rake spec --trace
(in /home/webtest/git/ruote-kit)
rake aborted!
View gist:604522
ruby-1.9.2-p0@ruote tsc@raisa:~/git/ruote$ ruby -I. test/functional/test.rb -- --dm
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]
2010-09-30 14:19:07 +0200
Loaded suite test/functional/test
Started
..............................................................................................................................................................................F..................................................................................................................................................................F........................................................
noisy /home/tsc/git/ruote/test/functional/rt_1_listen.rb:33:in `test_listen_and_restart'
0 80 pa * {"regex"=>"alpha", "engine_worker_only"=>true}
1 80 la * 20100930-bebatsusage {:wi=>["0!!20100930-bebatsusage", 0], :t=>["define", {}, [["concurrence", {}, [["sequence", {}, [["listen", {"to"=>"^al.*", "upon"=>"reply"}, []], ["echo", {"done."=>nil}, []]]], ["alpha", {}, []]]]]]}
View dm.log
ree-1.8.7-2010.02@ruote tsc@raisa:~/git/ruote$ ruby test/functional/rt_1_listen.rb -- --dm
ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2010.02
Thu Sep 30 11:54:34 +0200 2010
Loaded suite test/functional/rt_1_listen
Started
tracker subscribed to worker
#<Ruote::Worker:0xa2ea554 @storage=#<Ruote::Dm::DmStorage:0xa326b80 @context=#<Ruote::Context:0xa2e9de8 @engine=nil, @services={"s_parser"=>#<Ruote::Parser:0xa2e61e8 @context=#<Ruote::Context:0xa2e9de8 ...>>}, @storage=#<Ruote::Dm::DmStorage:0xa326b80 ...>, @worker=#<Ruote::Worker:0xa2ea554 ...>>, @repository=:default, @options={"s_logger"=>["ruote/log/test_logger", "Ruote::TestLogger"]}>, @subscribers=[[:all, #<Ruote::Tracker:0xa1e24a4 @context=#<Ruote::Context:0xa2e9de8 @engine=nil, @services={"s_parser"=>#<Ruote::Parser:0xa2e61e8 @context=#<Ruote::Context:0xa2e9de8 ...>>}, @storage=#<Ruote::Dm::DmStorage:0xa326b80 @context=#<Ruote::Context:0xa2e9de8 ...>, @repository=:default, @options={"s_logger"=>["ruote/log/te
View net_persistent.rb
#
# Re-opening Net::HTTP::Persistent to add a shutdown_in_all_threads method.
#
class Net::HTTP::Persistent
#
# Shuts down all connections in a thread.
#
# Uses this thread by default
#