Sha256: 643f2cfccb7114bbe4512c31638a077904b4222e20600e7b5374a1b3a4965d21
Contents?: true
Size: 1020 Bytes
Versions: 4
Compression:
Stored size: 1020 Bytes
Contents
$:.unshift 'lib' require 'rubygems' require 'tempfile' require 'spec/expectations' require 'fileutils' require 'reek' require 'reek/adapters/application' class ReekWorld def run(cmd) stderr_file = Tempfile.new('reek-world') stderr_file.close @last_stdout = `#{cmd} 2> #{stderr_file.path}` @last_exit_status = $?.exitstatus @last_stderr = IO.read(stderr_file.path) end def reek(args) run("ruby -Ilib -rubygems bin/reek #{args}") end def reek_with_pipe(stdin, args) run("echo \"#{stdin}\" | ruby -Ilib -rubygems bin/reek #{args}") end def rake(name, task_def) header = <<EOS $:.unshift('lib') require 'reek/adapters/rake_task' EOS rakefile = Tempfile.new('rake_task', '.') rakefile.puts(header + task_def) rakefile.close run("RUBYOPT=rubygems rake -f #{rakefile.path} #{name}") lines = @last_stdout.split("\n") if lines.length > 0 and lines[0] =~ /^\(/ @last_stdout = lines[1..-1].join("\n") end end end World do ReekWorld.new end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
reek-1.2.6 | features/support/env.rb |
reek-1.2.5 | features/support/env.rb |
reek-1.2.4 | features/support/env.rb |
reek-1.2.3 | features/support/env.rb |