Po dwóch miesiącach pracy w Three of Coins jako młodsza programistka postanowiłam podzielić się z uczestnikami/czkami WRUGa moją przygodą w cudownym świecie metaprogramowania.
= Pathname.new(filename).cleanpath.expand_path @configuration[:vendorfile_path] = pathname @configuration[:root_dir] = if pathname.basename.to_s == 'vendor.rb' && pathname.dirname.basename.to_s == 'config' pathname.dirname.dirname else pathname.dirname end instance_eval(IO.read(filename), filename, 1) end end end
# Running: .EEEEEEEEEEEEEEEEEEEEEEEEEE..EEEEEEEEEEEEEEEEEEE 1) Error: Vendorificator::Config#test_0001_allows to set and get values: SystemStackError: stack level too deep /path/to/repo/lib/config.rb:77 48 runs, 16 assertions, 0 failures, 45 errors, 0 skips rake aborted!
&block) if modules.keys.include? method_symbol modules[method_symbol].new(environment, args.delete_at(0).to_s, *args, &block) else super end end end end
Program Like the Ruby Pros, Paolo Perrotta • Confident Ruby, Avdi Grimm: http://confidentruby.com/ • Thoughtbot: http://robots.thoughtbot.com/ • Ruby Rogues: http://rubyrogues.com/