Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

lib/thin should expect lib/ to already be in the $LOAD_PATH. scripts …

…requiring thin should be responsible for adding lib/ to the $LOAD_PATH
  • Loading branch information...
commit d25ad7dedeb0bc9a8d5b6352e21e25c862c6b446 1 parent f640ea6
@josh josh authored
View
4 Rakefile
@@ -4,7 +4,9 @@ SUDO = (WIN ? "" : "sudo")
require 'rake'
require 'rake/clean'
-require 'lib/thin'
+
+$: << File.join(File.dirname(__FILE__), 'lib')
+require 'thin'
Dir['tasks/**/*.rake'].each { |rake| load rake }
View
5 benchmark/runner
@@ -6,7 +6,10 @@
#
# ruby simple.rb [num of request] [print|graph] [concurrency levels]
#
-require File.dirname(__FILE__) + '/../lib/thin'
+
+$: << File.join(File.dirname(__FILE__), '..', 'lib')
+require 'thin'
+
require File.dirname(__FILE__) + '/benchmarker'
require 'optparse'
View
2  example/adapter.rb
@@ -1,7 +1,7 @@
# Run with: ruby adapter.rb
# Then browse to http://localhost:3000/test
# and http://localhost:3000/files/adapter.rb
-require File.dirname(__FILE__) + '/../lib/thin'
+require 'thin'
class SimpleAdapter
def call(env)
View
3  example/config.ru
@@ -5,8 +5,7 @@
#
# Check Rack::Builder doc for more details on this file format:
# http://rack.rubyforge.org/doc/classes/Rack/Builder.html
-
-require ::File.dirname(__FILE__) + '/../lib/thin'
+require 'thin'
app = proc do |env|
# Response body has to respond to each and yield strings
View
2  lib/thin.rb
@@ -1,5 +1,3 @@
-$:.unshift File.expand_path(File.dirname(__FILE__))
-
require 'fileutils'
require 'timeout'
require 'stringio'
View
4 script/bleak
@@ -73,7 +73,9 @@ end
require 'rubygems'
require 'bleak_house'
-require File.dirname(__FILE__) + '/../lib/thin'
+
+$: << File.join(File.dirname(__FILE__), '..', 'lib')
+require 'thin'
Thin::Connection.send :include, BleakInstruments::Connection
Thin::Backends::TcpServer.send :include, BleakInstruments::Backend
View
4 script/profile
@@ -3,7 +3,9 @@
# Takes the same arguments as the thin script.
require 'rubygems'
require 'ruby-prof'
-require File.dirname(__FILE__) + '/../lib/thin'
+
+$: << File.join(File.dirname(__FILE__), '..', 'lib')
+require 'thin'
class Adapter
def call(env)
View
2  spec/spec_helper.rb
@@ -1,5 +1,5 @@
require 'rubygems'
-require File.dirname(__FILE__) + '/../lib/thin'
+require 'thin'
require 'spec'
require 'benchmark'
require 'timeout'
View
1  tasks/spec.rake
@@ -23,6 +23,7 @@ else
def spec_task(name, specs)
Spec::Rake::SpecTask.new(name) do |t|
+ t.libs << 'lib'
t.spec_opts = %w(-fs -c)
t.spec_files = specs
end
Please sign in to comment.
Something went wrong with that request. Please try again.