Or how about this?

```ruby
def check_ppa(package)
  %Q{find /etc/apt/ -name \*.list | xargs grep -o "deb http://ppa.launchpad.net/#{to_apt_line_uri(package)}"}
 end

def check_ppa_enabled(package)
  %Q{find /etc/apt/ -name \*.list | xargs grep -o "^deb http://ppa.launchpad.net/#{to_apt_line_uri(package)}"}
end

def to_apt_line_uri(repo)
  escape(repo.sub(/^ppa:/, ''))
end
```