Skip to content

Instantly share code, notes, and snippets.

attr_accessor :secret
undef_method "secret"
undef_method "secret="
def secret
@modes["s"]
end
alias_method :secret?, :secret
def secret=(bool)
if bool
$ bundle --version
Bundler version 0.9.26
$ bundle version
Bundler version 0.9.26
$ bundle install --version
Unknown switches '--version'
$ bundle --version
Bundler version 0.9.26
$ bundle --version --version
Unknown switches '--version'
Cassady:~ yossef$ rvm list
rvm rubies
ree-1.8.7-head [ i386 ]
ruby-1.8.7-p249 [ i386 ]
ruby-1.9.1-p378 [ i386 ]
Cassady:~ yossef$ rvm use ruby-1.8.7
Cassady:~/dev/projects/flogic/nihilist_bot(cinch-1.0) yossef$ gem list
*** LOCAL GEMS ***
cinch (1.0.0)
mechanize (1.0.0)
mocha (0.9.8)
nokogiri (1.4.3.1)
rake (0.8.7)
rdoc (2.5.10)
#!/usr/bin/env ruby -pi.bak
# bacon before takes no argument
$_.sub!(/before\s*\(?\s*:each\s*\)?\s*/, 'before ')
# same with after
# No magic annoying spaces after 'should'.
# Matchers are methods on the Should object
$_.sub!(/\.should\s*/, '.should.')
# fix `should_not` -> `should._not`
def has_a_last_clinic?
true if last_clinic
end
require 'spec/runner/formatter/progress_bar_formatter'
class NescafeFormatter < Spec::Runner::Formatter::ProgressBarFormatter
def example_failed(example, counter, failure)
super
dump_failure(counter, failure)
end
end
class Foo
class << self
def some_method
Bar.some_method
end
end
end
class Bar < Foo
class << self
def duration
@duration ||= begin
# 26 god-damned lines of code here
end || 3.weeks
end
class User
generator_for :password, :method => :generated_password
generator_for :password_confirmation, :method => :generated_password
generator_for :email, :start => '[email protected]' do |prev|
u, d = prev.split(/@/)
[u.succ, d].join('@')
end
def self.generated_password
's3kr17'