How do I get pp to wrap (limit) the line lengths to 79 characters as the pp documentation says?
The following example demonstrates that pp does not limit the output to default length 79 as stated in the pp documentation.
- (1) Put the following code into a file (pprfile.rb).
#!/usr/bin/env ruby require 'pp' STDIN.read.split("\n").each do |l| PP.pp(l) end
- (2) Clone the Github typo code repo and cd into the repo directory.
- (3) Run the following command line:
- pprfile.rb < ./app/controllers/accounts_controller.rb | awk 'length($0) > 79 { print length($0), $0 }'
- (4) I expected all of the output lines to be limited to less than or equal 79 characters, but here is what I I got as output:
89 " redirect_back_or_default :controller => \"admin/dashboard\", :action => \"index\"" 94 " self.current_user = User.authenticate(params[:user][:login], params[:user][:password])" 82 " self.current_user.remember_me unless self.current_user.remember_token?" 82 " add_to_cookies(:typo_user_profile, self.current_user.profile_label, '/')" 91 " redirect_back_or_default :controller => \"admin/dashboard\", :action => \"index\"" 80 " @page_title = \"#{this_blog.blog_name} - #{_('Recover your password')}\"" 124 " @user = User.find(:first, :conditions => [\"login = ? or email = ?\", params[:user][:login], params[:user][:login]])" 108 " flash[:notice] = _(\"An email has been successfully sent to your address with your new password\")" 88 " redirect_to(:controller => \"accounts\", :action => \"signup\") if User.count == 0" 92 " redirect_to :controller => \"setup\", :action => \"index\" if ! this_blog.configured?"</li>