Skip to content

Instantly share code, notes, and snippets.

require 'rubygems'
require 'yard'
include YARD
def traverse(node = Registry.root, indent = 0)
# Print contents of node
if node == Registry.root
puts "root"
else
if CodeObjects::MethodObject === node
class YARD::Handlers::RemoteHandler < YARD::Handlers::Base
handles /\Aremote/
def process
name_token = statement.tokens[2]
name = name_token.text.sub(/:/, '')
o1 = MethodObject.new(namespace, name, :instance)
o2 = MethodObject.new(namespace, "#{name}_cached", :instance)
register(o1, o2)
class String
# @it "should reverse the String contents"
# "xyz".reverse.should == "zyx"
def reverse
end
end
require 'yard'
$RSpecCount = 0
class SpecificationGroupObject < YARD::CodeObjects::NamespaceObject
attr_accessor :test_class, :specifications
def type; :specification_group end
def path; "__RSpecTest::" + super end
def initialize(*args)
require 'yard'
class RSpecDescribeHandler < YARD::Handlers::Ruby::Base
handles method_call(:describe)
def process
name = statement.parameters.first.source
if statement.parameters[1]
src = statement.parameters[1].jump(:string_content).source
name += (src[0] == "#" ? "" : "::") + src
@lsegal
lsegal / gist:128272
Created June 11, 2009 22:17
Make RubyGems generate sane binaries that work for ruby18 and ruby19
--- a/lib/rubygems/installer.rb 2009-05-02 18:53:50.000000000 -0400
+++ b/lib/rubygems/installer.rb 2009-06-11 16:25:33.000000000 -0400
@@ -397,14 +397,19 @@
else
path = File.join @gem_dir, @spec.bindir, bin_file_name
+ ruby_bin_file = File.join(File.dirname(Gem.ruby), 'ruby')
+ unless File.symlink?(ruby_bin_file)
+ ruby_bin_file = Gem.ruby
+ end
require 'rubygems'
require 'yard'
class ContextObject < YARD::CodeObjects::NamespaceObject
attr_accessor :tests
def initialize(*args)
super
@tests = []
end
require 'yard'
YARD::Parser::SourceParser.parse_string <<-eof
# ### HELPERS ###
# Generates the base job definition hash
#
# @param [Hash] p The sanitized params sent by the user
# @param [Symbol] verb The job verb (:get, :post, :delete, :put)
require 'yard'
class ClassLineHandler < YARD::Handlers::Ruby::Base
handles :class
def process
obj = ClassObject.new(namespace, statement[0].source)
obj.line_end = statement[0].line + statement.source.split("\n").size - 1
end
end
yard (master)$ sudo gem install ruby-debug19
Password:
Building native extensions. This could take a while...
Building native extensions. This could take a while...
ERROR: Error installing ruby-debug19:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby19 extconf.rb
checking for vm_core.h... no
checking for vm_core.h... yes