File indexing completed on 2024-05-19 04:38:18

0001 $:.unshift('this_freakingly_awesome_path')
0002 
0003 module Dummy
0004   module BA
0005     def inject(n)
0006       each { |value| n = yield(n, value) }
0007       n
0008     end
0009 
0010     def BA.greeting str
0011       "Hello #{str}!"
0012     end
0013 
0014     def BA.want_a_block(&mblock)
0015       yield mblock
0016     end
0017 
0018     CONST = 0
0019   end
0020 end
0021 
0022 module AA
0023   include ::Dummy::BA
0024 
0025   def sum(initial = 0)
0026     inject(initial) { |n, value| n + value }
0027   end
0028 
0029   ACONST = 1
0030 end
0031 
0032 class Range
0033   include AA
0034 end
0035 
0036 puts (1..5).sum
0037 puts Dummy::BA::CONST, ::AA::ACONST
0038 puts(Dummy::BA::CONST, ::AA::ACONST)
0039 puts 'lalala', Dummy::BA.greeting('Miquel')
0040 puts('lalala', Dummy::BA.greeting('Miquel'))
0041 puts "Where is thumbkin?", Dummy::BA.want_a_block { 'Here I am!' }
0042 puts("Where is thumbkin?", Dummy::BA.want_a_block { 'Here I am!' })
0043 puts %Q{ lalala }.length
0044 
0045 __inspect__.sub("Chameleon", method.to_s.sub('to_','').capitalize)
0046 method.to_s.sub('to_','').capitalize
0047 b.a(1).c
0048 a.b.c 1, 2
0049 puts 1+1
0050 
0051 a.class
0052 foo 1,
0053     2
0054 
0055 foo a, :a => 'string', b: 'another'
0056 where_is_thumbkin? && here_i_am!
0057 
0058 class Klass
0059   def self.foo(str)
0060     { 'result' => str }
0061   end
0062 end
0063 
0064 puts Klass.foo('lala')['result']
0065 
0066 def moo(a, b)
0067   yield if block_given?
0068 end
0069 
0070 require 'rubygems'
0071 
0072 Gem::Specification::new do |spec|
0073 end
0074 
0075 open a do |os|
0076   loop do
0077     a
0078   end
0079 end
0080 
0081 remove_method(:alternate=)