Skip to content
Browse files

no need to manage the LOAD_PATH, really

  • Loading branch information...
1 parent 066274d commit df4b3cd06a8fe5066968adc5a59b7a9259b70d2f @mislav committed Oct 20, 2009
View
6 Rakefile
@@ -1,7 +1,3 @@
-lib_dir = File.expand_path(File.join(File.dirname(__FILE__), "lib"))
-$:.unshift(lib_dir)
-$:.uniq!
-
require 'rubygems'
require 'rake'
require 'rake/testtask'
@@ -10,7 +6,7 @@ require 'rake/packagetask'
require 'rake/gempackagetask'
require 'spec/rake/spectask'
-require File.join(File.dirname(__FILE__), 'lib/addressable', 'version')
+require File.join(File.dirname(__FILE__), 'lib', 'addressable', 'version')
PKG_DISPLAY_NAME = 'Addressable'
PKG_NAME = PKG_DISPLAY_NAME.downcase
View
4 lib/addressable/template.rb
@@ -22,10 +22,6 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++
-$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), '/..')))
-$:.uniq!
-
-require "addressable/version"
require "addressable/uri"
module Addressable
View
4 lib/addressable/uri.rb
@@ -22,10 +22,6 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++
-$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), '/..')))
-$:.uniq!
-
-require "addressable/version"
require "addressable/idna"
module Addressable
View
3 spec/addressable/idna_spec.rb
@@ -22,9 +22,6 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++
-$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../../lib'))
-$:.uniq!
-
require "addressable/idna"
describe Addressable::IDNA, "when converting from unicode to ASCII" do
View
4 spec/addressable/template_spec.rb
@@ -22,10 +22,6 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++
-$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../../lib'))
-$:.uniq!
-
-require "addressable/uri"
require "addressable/template"
if !"".respond_to?("force_encoding")
View
3 spec/addressable/uri_spec.rb
@@ -22,9 +22,6 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++
-$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../../lib'))
-$:.uniq!
-
require "addressable/uri"
if !"".respond_to?("force_encoding")
View
13 tasks/spec.rake
@@ -1,12 +1,10 @@
namespace :spec do
Spec::Rake::SpecTask.new(:rcov) do |t|
+ t.libs = %w[lib spec]
t.spec_files = FileList['spec/**/*_spec.rb']
t.spec_opts = ['--color', '--format', 'specdoc']
- if RCOV_ENABLED
- t.rcov = true
- else
- t.rcov = false
- end
+
+ t.rcov = RCOV_ENABLED
t.rcov_opts = [
'--exclude', 'spec',
'--exclude', '1\\.8\\/gems',
@@ -16,18 +14,19 @@ namespace :spec do
end
Spec::Rake::SpecTask.new(:normal) do |t|
+ t.libs = %w[lib spec]
t.spec_files = FileList['spec/**/*_spec.rb']
t.spec_opts = ['--color', '--format', 'specdoc']
t.rcov = false
end
desc "Generate HTML Specdocs for all specs"
Spec::Rake::SpecTask.new(:specdoc) do |t|
- specdoc_path = File.expand_path(
- File.join(File.dirname(__FILE__), '../specdoc/'))
+ specdoc_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'specdoc'))
Dir.mkdir(specdoc_path) if !File.exist?(specdoc_path)
output_file = File.join(specdoc_path, 'index.html')
+ t.libs = %w[lib spec]
t.spec_files = FileList['spec/**/*_spec.rb']
t.spec_opts = ["--format", "\"html:#{output_file}\"", "--diff"]
t.fail_on_error = false

0 comments on commit df4b3cd

Please sign in to comment.
Something went wrong with that request. Please try again.