here's most of the core classes, modules, traits, and methods. i probably missed some, but it's a start.
the number after method names is the arity.
# Classes:
Object
task :test do | |
require "minitest/autorun" | |
Dir["spec/**/*_spec.rb"] { |f| require f } | |
end |
source 'https://rubygems.org' | |
gem 'rails' |
$ rails r 'File.write("./viz.html", Rails.application.routes.router.visualizer)' | |
$ ruby -r webrick -e "s = WEBrick::HTTPServer.new(:Port => 8080, :DocumentRoot => Dir.pwd); trap('INT') { s.shutdown }; s.start" | |
$ open "http://localhost:8080/viz.html" |
*.c | |
*.rl |
class Dot | |
class Node | |
attr_reader :children, :name, :started | |
attr_accessor :finished | |
def initialize name, fields = [], started = Time.now | |
@name = name | |
@fields = fields | |
@children = [] | |
@started = started |
diff --git a/lib/middleware/visitor.rb b/lib/middleware/visitor.rb | |
new file mode 100644 | |
index 0000000..fdfb96d | |
--- /dev/null | |
+++ b/lib/middleware/visitor.rb | |
@@ -0,0 +1,100 @@ | |
+module Middleware | |
+ class Visitor | |
+ class Node < Struct.new(:id, :name) | |
+ end |
#### | |
# It must output this: | |
# | |
# hello one two | |
# world one two | |
# | |
class Filter | |
def initialize name | |
@name = name | |
end |
def future # :block: | |
thread = Thread.new do | |
Thread.current.abort_on_exception = false | |
yield | |
end | |
lambda { thread.value } | |
end | |
def compose(proc) # :block: |
# Poor Man's Fiber (API compatible Thread based Fiber implementation for Ruby 1.8) | |
# (c) 2008 Aman Gupta (tmm1) | |
unless defined? Fiber | |
require 'thread' | |
class FiberError < StandardError; end | |
class Fiber | |
def initialize |