Permalink
Browse files

Fix the require issues in ruby -w

  • Loading branch information...
1 parent 9a7249c commit 0f848f9996c397ed58031fe0f19b5482448a3937 @copiousfreetime committed Mar 9, 2013
@@ -10,8 +10,7 @@
#-----------------------------------------------------------------------
$:.unshift File.expand_path( File.join( File.dirname(__FILE__), "..", "lib" ) )
-require 'stickler/middleware/gemcutter'
-require 'stickler/middleware/compression'
+require 'stickler'
gem_dir = File.expand_path( "../spec/tmp", File.dirname( __FILE__ ) )
View
@@ -2,10 +2,13 @@ module Stickler
# The Current Version of the library
VERSION = "2.3.0"
end
+require 'sinatra/base'
+require 'stickler/logable'
require 'stickler/error'
require 'stickler/paths'
+require 'stickler/spec_lite'
+
require 'stickler/repository'
require 'stickler/middleware'
-require 'stickler/spec_lite'
require 'stickler/server'
View
@@ -1,5 +1,4 @@
require 'trollop'
-require 'rubygems'
require 'stickler/client/config_file'
module Stickler
@@ -43,9 +42,10 @@ def remote_repo_for( opts )
end
end
-require 'stickler/client/push'
-require 'stickler/client/yank'
-require 'stickler/client/delete'
-require 'stickler/client/mirror'
require 'stickler/client/config'
+require 'stickler/client/delete'
require 'stickler/client/list'
+require 'stickler/client/mirror'
+require 'stickler/client/push'
+require 'stickler/client/unyank'
+require 'stickler/client/yank'
@@ -2,3 +2,10 @@ module Stickler
module Middleware
end
end
+require 'stickler/middleware/helpers'
+require 'stickler/middleware/compression'
+require 'stickler/middleware/gemcutter'
+require 'stickler/middleware/index'
+require 'stickler/middleware/local'
+require 'stickler/middleware/mirror'
+require 'stickler/middleware/not_found'
@@ -1,5 +1,3 @@
-require 'rack/utils'
-require 'stickler/middleware'
module Stickler::Middleware
class Compression
def initialize( app )
@@ -1,8 +1,4 @@
-require 'sinatra/base'
-require 'stickler/middleware'
require 'stickler/middleware/local'
-require 'stickler/repository/local'
-
module Stickler::Middleware
#
# A rack middleware for implementing the gemcutter api
@@ -1,5 +1,3 @@
-require 'stickler/middleware'
-require 'stickler/repository/local'
module Stickler::Middleware
module Helpers
#
@@ -1,11 +1,3 @@
-require 'sinatra'
-require 'stickler/middleware'
-require 'stickler/middleware/helpers'
-require 'stickler/repository/null'
-require 'stickler/spec_lite'
-require 'stickler/logable'
-require 'stickler/paths'
-
module Stickler::Middleware
# Index is a Rack middleware that passes all requests through except for the
# following urls:
@@ -1,8 +1,4 @@
-require 'sinatra'
-require 'stickler/middleware'
require 'stickler/middleware/index'
-require 'stickler/repository/local'
-
module Stickler::Middleware
#
# A Sinatra middleware that implements the HTTP portions of a Modern gem server.
@@ -1,7 +1,3 @@
-require 'sinatra/base'
-require 'stickler/middleware/index'
-require 'stickler/repository/mirror'
-
module Stickler::Middleware
#
# A Mirror server keeps gems from one or more upstream gem servers in local
@@ -1,4 +1,3 @@
-require 'stickler/middleware'
module Stickler::Middleware
#
# Idea completely taken from rack-contrib, it can function as a middleware
View
@@ -1,10 +1,14 @@
-require 'stickler/error'
-require 'rubygems/format'
-require 'rubygems/platform'
-require 'rubygems/dependency'
-
module Stickler
module Repository
class Error < ::Stickler::Error ; end
end
end
+require 'stickler/repository/api'
+require 'stickler/repository/basic_authenticator'
+require 'stickler/repository/index'
+require 'stickler/repository/local'
+require 'stickler/repository/mirror'
+require 'stickler/repository/null'
+require 'stickler/repository/remote'
+require 'stickler/repository/remote_mirror'
+require 'stickler/repository/rubygems_authenticator'
@@ -1,5 +1,4 @@
require 'stickler/spec_lite'
-require 'stickler/repository'
module Stickler::Repository
#
@@ -1,10 +1,8 @@
-require 'stickler/spec_lite'
-require 'stickler/logable'
-require 'stickler/repository'
require 'stickler/repository/index'
require 'addressable/uri'
require 'tempfile'
require 'forwardable'
+require 'rubygems/format'
module Stickler::Repository
#
@@ -1,4 +1,3 @@
-require 'stickler/repository'
module Stickler::Repository
#
# A null repository. It is in most respecs like a Repository::Local that has
@@ -1,6 +1,4 @@
require 'excon'
-require 'stickler'
-require 'stickler/repository'
require 'stickler/repository/api'
require 'stickler/repository/rubygems_authenticator'
require 'stickler/repository/basic_authenticator'
View
@@ -1,11 +1,3 @@
-require 'stickler/error'
-require 'stickler/middleware/compression'
-require 'stickler/middleware/gemcutter'
-require 'stickler/middleware/mirror'
-require 'stickler/middleware/index'
-require 'stickler/middleware/not_found'
-require 'rack/commonlogger'
-
module Stickler
class Server
@@ -1,7 +1,4 @@
-require File.expand_path( "../spec_helper",File.dirname(__FILE__) )
-
-require 'stickler/middleware/local'
-require 'stickler/middleware/compression'
+require 'spec_helper'
describe Stickler::Middleware::Local do
@@ -1,5 +1,4 @@
-require File.expand_path( File.join( File.dirname(__FILE__), "..", "spec_helper.rb" ) )
-require 'stickler/middleware/not_found'
+require 'spec_helper'
describe ::Stickler::Middleware::NotFound do
include Rack::Test::Methods
View
@@ -1,6 +1,4 @@
-require File.expand_path( File.join( File.dirname( __FILE__ ), "spec_helper.rb" ) )
-
-require 'stickler/paths'
+require 'spec_helper'
describe Stickler::Paths do
it "can access the root dir of the project" do
@@ -1,5 +1,3 @@
-require 'stickler/repository/api'
-
shared_examples_for "includes Repository::Api" do
describe "responds to all the api methods" do
Stickler::Repository::Api.api_methods.each do |method|
@@ -1,7 +1,6 @@
-require File.expand_path( File.join( File.dirname(__FILE__), "..", "spec_helper.rb" ) )
-require File.expand_path( File.join( File.dirname(__FILE__), "api_behavior.rb" ) )
+require 'spec_helper'
+require 'repository/api_behavior'
-require 'stickler/repository/api'
module Stickler::Repository
class Stub
include Stickler::Repository::Api
@@ -1,5 +1,4 @@
-require File.expand_path( File.join( File.dirname(__FILE__), "..", "spec_helper.rb" ) )
-require 'stickler/repository/index'
+require 'spec_helper'
describe ::Stickler::Repository::Index do
@@ -1,7 +1,5 @@
-require File.expand_path( File.join( File.dirname(__FILE__), "..", "spec_helper.rb" ) )
-require File.expand_path( File.join( File.dirname(__FILE__), "api_behavior.rb" ) )
-
-require 'stickler/repository/local'
+require 'spec_helper'
+require 'repository/api_behavior'
describe ::Stickler::Repository::Local do
@@ -1,8 +1,5 @@
-require File.expand_path( File.join( File.dirname(__FILE__), "..", "spec_helper.rb" ) )
-require File.expand_path( File.join( File.dirname(__FILE__), "api_behavior.rb" ) )
-
-require 'stickler/repository/null'
-
+require 'spec_helper'
+require 'repository/api_behavior'
describe ::Stickler::Repository::Null do
before do
@@ -1,7 +1,5 @@
-require File.expand_path( File.join( File.dirname(__FILE__), "..", "spec_helper.rb" ) )
-require File.expand_path( File.join( File.dirname(__FILE__), "api_behavior.rb" ) )
-
-require 'stickler/repository/remote'
+require 'spec_helper'
+require 'repository/api_behavior'
class SticklerTestServer
def initialize( spec_dir, ru_file )
View
@@ -1,7 +1,12 @@
-require 'rspec'
+if RUBY_VERSION >= '1.9.2' then
+ require 'simplecov'
+ SimpleCov.start if ENV['COVERAGE']
+end
+
+require "rspec/autorun"
+require 'stickler'
require 'index_spec_helpers'
-require 'stickler/repository/local'
RSpec.configure do |config|
View
@@ -1,6 +1,4 @@
-require File.expand_path( File.join( File.dirname(__FILE__), "spec_helper.rb" ) )
-
-require 'stickler/spec_lite'
+require 'spec_helper'
describe Stickler::SpecLite do
before do
View
@@ -1,36 +0,0 @@
-desc "Instructions on how to contribute to stickler"
-task :help do
- abort <<-_banner
------------------------------------------------------------------------
- I see you are wanting to do some development on stickler. You will
- need to install the 'bones' gem first.
-
- % gem install bones -v #{USING_BONES_VERSION}
-
- The easiest way to start after that is with the
- 'install:dependencies' task:
-
- % rake gem:install_dependencies
-
- If you use bundler, then you will need to first create the Gemfile
- and then run 'bundle install':
-
- % rake bundle:gemfile
- % bundle install
-
- Now you are ready to work on stickler. Please submit bugs and pull
- requests to:
-
- https://github.com/copiousfreetime/stickler
-
- Thanks!
-
- -jeremy
------------------------------------------------------------------------
-_banner
-end
-
-desc "(Alias for 'help') Instructions on how to contribute to stickler"
-task 'how_to_contribute' => :help
-desc "(Alias for 'help') Instructions on how to contribute to stickler"
-task '==> I WANT TO CONTRIBUTE <==' => :help

0 comments on commit 0f848f9

Please sign in to comment.