Skip to content

Instantly share code, notes, and snippets.

class Context
end
Context.new.instance_eval <<-END
class String
def foo() 'foo' end
end
puts ''.foo
END
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=============================================================-=========================================-=======================================================
ii ack-grep 1.80-1 A grep-like program specifically for large source trees
ii acl 2.2.47-2 Access control list utilities
ii acpi-support 0.121 scripts for handling many ACPI events
ii acpid 1.0.6-9ubuntu4.9.04.3
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=============================================================-=========================================-=======================================================
ii ack-grep 1.80-1 A grep-like program specifically for large source trees
ii acl 2.2.47-2 Access control list utilities
ii acpi-support 0.121 scripts for handling many ACPI events
ii acpid 1.0.6-9ubuntu4.9.04.3
# Run me with:
#
# $ watchr less.watchr
# --------------------------------------------------
# Helpers
# --------------------------------------------------
def lessc(file)
print "compiling #{file.inspect}... "
system "lessc #{file}"
~| gem list swap
*** LOCAL GEMS ***
~| irb
>> require 'swap'
=> true
>> $:.map {|p| Dir[File.join(p, '*')] }.flatten.map {|p| File.basename(p) }.grep(/wirble/)
=> ["wirble.rb"]
uniques = results.delete_if {|r| r['occurrences'] == 1 }.map {|r| r['id'] }
duplicates = results.map {|r| r['id'] }
# Run me with:
#
# $ watchr docs.watchr.rb
def run_rdoc
system('rake --silent rdoc')
end
def run_yard
print "\nUpdating yardocs... "
# Run me with:
#
# $ watchr specs.watchr.rb
# --------------------------------------------------
# Convenience Methods
# --------------------------------------------------
def all_test_files
Dir['test/**/test_*.rb'] - ['test/test_helper.rb']
end
In response to all the responses to:
http://twitter.com/rtomayko/status/1155906157
You should never do this in a source file included with your library,
app, or tests:
require 'rubygems'
The system I use to manage my $LOAD_PATH is not your library/app/tests
...
Package libpcre was not found in the pkg-config search path.
Perhaps you should add the directory containing `libpcre.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libpcre' found
In file included from vm/string.c:3:
vm/tr.h:12:18: error: pcre.h: No such file or directory
In file included from vm/string.c:3:
vm/tr.h:285: error: expected specifier-qualifier-list before ‘pcre’
make: *** [vm/string.o] Error 1