Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
# # Output the amount of RAM in Megs on linux. require 'facter' Facter.add("ram") do confine :kernel => :Linux ram = 0 # Steal linux's meminfo File.open( "/proc/meminfo" , 'r' ) do |f| f.grep( /^MemTotal:/ ) { |mem| ram = mem.split( / +/ )[1].to_i / 1024 } end # http://projects.reductivelabs.com/issues/2455 weird. setcode do ram end end
This paste will be private.
From the Design Piracy series on my blog: