Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
============================================================= Excerpt from code ============================================================= p "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" p "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" p "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" r = CardRegistration.new(:person => person, :card => c, :staffing_agency => @s, :at => at) p "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" p "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" p "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" ============================================================= property.rb#get(resource) ============================================================= # Provides a standardized getter method for the property # # @raise <ArgumentError> "+resource+ should be a DataMapper::Resource, but was ...." #- # @api private def get(resource) p "------------------------" p instance_variable_name new_record = resource.new_record? p "Step 1" puts caller.join("\n") unless new_record or resource.attribute_loaded?(name) p "Step 1a" # TODO: refactor this section contexts = if lazy? name else model.properties(resource.repository.name).reject do |property| property.lazy? || resource.attribute_loaded?(property.name) end end p "Step 1b" resource.send(:lazy_load, contexts) end p "Step 2" value = get!(resource) case track when :hash resource.original_values[name] = value.dup.hash unless resource.original_values.has_key?(name) rescue value.hash when :get resource.original_values[name] = value.dup unless resource.original_values.has_key?(name) rescue value end p "Step 3" if value.nil? && new_record && !options[:default].nil? && !resource.attribute_loaded?(name) value = default_for(resource) set(resource, value) end p "Step 4" p value p "##########################" value end ============================================================= Output ============================================================= "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" "------------------------" "@id" "Step 1" "Step 2" "Step 3" "Step 4" 325 "##########################" "------------------------" "@id" "Step 1" "Step 2" "Step 3" "Step 4" 246 "##########################" "------------------------" "@id" "------------------------" "@person_id" "Step 1" "Step 2" "Step 3" "Step 4" 295 "##########################" "------------------------" "@person_id" "Step 1" "Step 2" "Step 3" "Step 4" 295 "##########################" "------------------------" "@person_id" "Step 1" "Step 2" "Step 3" "Step 4" 295 "##########################" "Step 1" "Step 2" "Step 3" "Step 4" nil "##########################" "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
This paste will be private.
From the Design Piracy series on my blog: