This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
require 'rcov/rcovtask' | |
Rcov::RcovTask.new do |t| | |
t.libs << "test" | |
dot_rakes = | |
t.rcov_opts = [ | |
'-xRakefile', '-xrakefile', '-xpublish.rf', | |
'-xlib/rake/contrib', '-x/Library', | |
'--text-report', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> m "a string" | |
% * + < << <= <=> == === =~ > >= [] []= __id__ __send__ | |
all? any? | |
between? | |
capitalize capitalize! casecmp center chomp chomp! chop chop! class clone collect concat count crypt | |
delete delete! detect display downcase downcase! dump dup | |
each each_byte each_line each_with_index eigenclass empty? entries eql? equal? extend | |
find find_all freeze frozen? | |
grep gsub gsub! | |
hash hex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq jw-cc-style | |
'((c-hanging-comment-starter-p . nil) | |
(c-hanging-comment-ender-p . nil) | |
(c-offsets-alist . ((string . -1000) | |
(topmost-intro . 0) | |
(topmost-intro-cont . 0) | |
(inline-open . 0) | |
(substatement . +) | |
(substatement-open . 0) | |
(member-init-intro . 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Parent | |
def x | |
@@x | |
end | |
end | |
class Son < Parent | |
def xs | |
@@x | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts (?:==?????:?:) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Switch to Ruby 1.8.7 | |
rvm use 1.8.7 | |
# Print out the ruby version | |
ruby -v | |
# But the output of this is: | |
# | |
# $ ./tryrvm | |
# <i> Now using ruby 1.8.7 p249 </i> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spec::Runner.configure do |config| | |
config.mock_with :flexmock | |
end | |
class Foo | |
attr_accessor :bar | |
def initialize(style) | |
@bar = Bar.new(style) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a simplified snippet of code representing the line number | |
# reporting problem. Running the following using rspec yields (in | |
# part): | |
# 1) | |
# 'something should be true' FAILED | |
# expected false to be true | |
# line_spec.rb:20:in `block in Then' | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is the regexml URL matching example rewritten to use the Ruby Re library. | |
# | |
# Regexml: http://code.google.com/p/regexml/ | |
# Re library: http://github.com/jimweirich/re | |
URL_PATTERN = | |
re.any("A-Z", "a-z").one_or_more.capture(:scheme) + | |
re(":") + | |
re("//").optional + | |
re.any("0-9", "A-Z", "a-z", "-@.").one_or_more.capture(:host) + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby" | |
require 'rake/clean' | |
require 'rake/testtask' | |
task :default => :test | |
Rake::TestTask.new(:test) do |t| | |
t.warning = true | |
t.verbose = false |