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
attr_accessor :secret | |
undef_method "secret" | |
undef_method "secret=" | |
def secret | |
@modes["s"] | |
end | |
alias_method :secret?, :secret | |
def secret=(bool) | |
if bool |
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
$ 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' |
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
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 |
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
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) |
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 -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` |
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
def has_a_last_clinic? | |
true if last_clinic | |
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
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 |
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 Foo | |
class << self | |
def some_method | |
Bar.some_method | |
end | |
end | |
end | |
class Bar < Foo | |
class << self |
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
def duration | |
@duration ||= begin | |
# 26 god-damned lines of code here | |
end || 3.weeks | |
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
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' |