Skip to content

Instantly share code, notes, and snippets.

@luislavena
Created October 19, 2010 12:07
Show Gist options
  • Save luislavena/e1291eb84136699e3a05 to your computer and use it in GitHub Desktop.
Save luislavena/e1291eb84136699e3a05 to your computer and use it in GitHub Desktop.
From 63952a26f8ced734559fadf10441feb512f8fc55 Mon Sep 17 00:00:00 2001
From: Luis Lavena <luislavena@gmail.com>
Date: Tue, 19 Oct 2010 09:06:15 -0300
Subject: [PATCH] Do not play with $LOAD_PATH
Also, use Bundler only for development and ignore coverage
---
.gitignore | 1 +
Rakefile | 9 ++++++++-
lib/slim.rb | 3 ---
test/helper.rb | 2 --
4 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/.gitignore b/.gitignore
index 7885450..35fd2a1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ readme.html
.yardoc/
doc/
.bundle/
+coverage/
diff --git a/Rakefile b/Rakefile
index 1a46c16..c5cad05 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,6 +1,13 @@
require 'rubygems'
require 'rake'
+begin
+ require 'bundler'
+ Bundler::GemHelper.install_tasks
+rescue LoadError => e
+ warn "Please install bundler to properly track development dependencies. `gem install bundler`"
+end
+
require File.join(File.dirname(__FILE__), "lib", "slim")
begin
@@ -48,7 +55,7 @@ end
begin
require 'rcov/rcovtask'
Rcov::RcovTask.new do |test|
- test.libs << 'test'
+ test.libs << 'lib' << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end
diff --git a/lib/slim.rb b/lib/slim.rb
index 9350043..7805819 100644
--- a/lib/slim.rb
+++ b/lib/slim.rb
@@ -1,8 +1,5 @@
# encoding: utf-8
-$:.unshift File.dirname(__FILE__)
-
-require 'bundler/setup'
require 'escape_utils'
require 'slim/compiler'
require 'slim/engine'
diff --git a/test/helper.rb b/test/helper.rb
index a1830ff..d15cc2b 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -4,8 +4,6 @@ require 'minitest/unit'
MiniTest::Unit.autorun
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
-
require 'slim'
class Env
--
1.7.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment