This file contains 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; def a; end; end | |
=> nil | |
>> class Bar < Foo; def a; super; end; end | |
=> nil | |
>> Bar.new.a | |
=> nil |
This file contains 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 'rspec' | |
require "rspec/core/rake_task" | |
RSpec::Core::RakeTask.new(:core) do |t| | |
t.rspec_opts = "-t ~foo" | |
end | |
describe "foo", :foo => true do | |
it "should be awesome" do | |
puts "foooooo!" |
This file contains 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
new-host-3% rvm install rbx | |
rbx-head installing #dependencies | |
Cloning git://github.com/rubinius/rubinius.git | |
Copying from repo to source... | |
rbx-head - #configuring | |
rbx-head - #compiling | |
rbx-head - adjusting #shebangs for (erb ri rdoc). | |
rbx-head - #importing default gemsets (/Users/andrewwagner/.rvm/gemsets/) | |
WARN: rbx rbx-head-head is not installed. | |
To install do: 'rvm install rbx-head-head' |
This file contains 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
new-host-3% rvm install rbx | |
rbx-head installing #dependencies | |
Cloning git://github.com/rubinius/rubinius.git | |
mkdir: /Users/andrewwagner/.rvm/log/rbx-head: Permission denied | |
touch: /Users/andrewwagner/.rvm/log/rbx-head/rbx.repo.log: No such file or directory | |
/Users/andrewwagner/.rvm/scripts/functions/utility: line 152: /Users/andrewwagner/.rvm/log/rbx-head/rbx.repo.log: No such file or directory | |
/Users/andrewwagner/.rvm/scripts/functions/utility: line 159: /Users/andrewwagner/.rvm/log/rbx-head/rbx.repo.log: No such file or directory | |
ERROR: Error running 'git clone --depth 1 git://github.com/rubinius/rubinius.git /Users/andrewwagner/.rvm/repos/rbx-head', please read /Users/andrewwagner/.rvm/log/rbx-head/rbx.repo.log | |
Could not fetch git://github.com/rubinius/rubinius.git - trying http://github.com/rubinius/rubinius.git | |
Cloning http://github.com/rubinius/rubinius.git |
This file contains 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
rvm rubies | |
jruby-1.6.4 [ darwin-x86_64-java ] | |
rbx-master [ x86_64 ] | |
=> ruby-1.8.7-p352 [ x86_64 ] | |
ruby-1.9.2-p290 [ x86_64 ] | |
new-host-3% sudo uninstall rbx-master | |
sudo: uninstall: command not found | |
new-host-3% sudo rvm uninstall rbx-master |
This file contains 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
ERROR: While executing gem ... (Gem::FilePermissionError) | |
You don't have write permissions into the /Users/andrewwagner/.rvm/gems/rbx-head-head-master directory. |
This file contains 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
/Users/andrewwagner/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find bundler (>= 0) amongst [minitest-1.6.0, rake-0.8.7, rdoc-2.5.8] (Gem::LoadError) | |
from /Users/andrewwagner/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec' | |
from /Users/andrewwagner/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:1195:in `gem' | |
from /Users/andrewwagner/.rvm/gems/ruby-1.9.2-p290/bin/bundle:18:in `<main>' | |
new-host-3% |
This file contains 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
# reek does this at the top level somewhere | |
# (which means you could define your own smell at the top level somewhere too) | |
smell :duplication do |code| | |
code.methods.where do |method| | |
method.method_calls.where do |call| | |
method.method_calls.where do |call2| | |
call2 == call | |
end.count > 1 | |
end.count > 1 | |
end |
This file contains 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
# YAML report | |
smell_results = {} | |
smells.each do |smell| | |
smell_results[smell.name] = smell.results | |
end | |
puts y smell_results |
This file contains 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 'reek2' | |
describe "smell detection" do | |
context "attribute" do | |
it "detects when there are 2 attr_readers in one class" do | |
pending | |
code_str = <<RUBY | |
class Foo | |
attr_reader :bar1 | |
attr_reader :bar2 |