Skip to content
This repository
Browse code

Respect the global load path

  • Loading branch information...
commit 6a629a6a06e115388cce6f1de04f45a4b0707cac 1 parent a2b0b51
Erik Michaels-Ober authored

Showing 31 changed files with 60 additions and 40 deletions. Show diff stats Hide diff stats

  1. 12  lib/twitter.rb
  2. 6  lib/twitter/api.rb
  3. 21  lib/twitter/client.rb
  4. 2  lib/twitter/configuration.rb
  5. 5  lib/twitter/connection.rb
  6. 2  spec/faraday/response_spec.rb
  7. 4  spec/{spec_helper.rb → helper.rb}
  8. 2  spec/twitter/api_spec.rb
  9. 2  spec/twitter/base_spec.rb
  10. 2  spec/twitter/client/account_spec.rb
  11. 2  spec/twitter/client/block_spec.rb
  12. 2  spec/twitter/client/direct_messages_spec.rb
  13. 2  spec/twitter/client/favorites_spec.rb
  14. 2  spec/twitter/client/friends_and_followers_spec.rb
  15. 2  spec/twitter/client/friendship_spec.rb
  16. 2  spec/twitter/client/geo_spec.rb
  17. 2  spec/twitter/client/legal_spec.rb
  18. 2  spec/twitter/client/list_members_spec.rb
  19. 2  spec/twitter/client/list_spec.rb
  20. 2  spec/twitter/client/list_subscribers_spec.rb
  21. 2  spec/twitter/client/local_trends_spec.rb
  22. 2  spec/twitter/client/notification_spec.rb
  23. 2  spec/twitter/client/saved_searches_spec.rb
  24. 2  spec/twitter/client/spam_reporting_spec.rb
  25. 2  spec/twitter/client/timeline_spec.rb
  26. 2  spec/twitter/client/trends_spec.rb
  27. 2  spec/twitter/client/tweets_spec.rb
  28. 2  spec/twitter/client/user_spec.rb
  29. 2  spec/twitter/client_spec.rb
  30. 2  spec/twitter/search_spec.rb
  31. 2  spec/twitter_spec.rb
12  lib/twitter.rb
... ...
@@ -1,9 +1,9 @@
1  
-require File.expand_path('../twitter/error', __FILE__)
2  
-require File.expand_path('../twitter/configuration', __FILE__)
3  
-require File.expand_path('../twitter/api', __FILE__)
4  
-require File.expand_path('../twitter/client', __FILE__)
5  
-require File.expand_path('../twitter/search', __FILE__)
6  
-require File.expand_path('../twitter/base', __FILE__)
  1
+require 'twitter/error'
  2
+require 'twitter/configuration'
  3
+require 'twitter/api'
  4
+require 'twitter/client'
  5
+require 'twitter/search'
  6
+require 'twitter/base'
7 7
 
8 8
 module Twitter
9 9
   extend Configuration
6  lib/twitter/api.rb
... ...
@@ -1,6 +1,6 @@
1  
-require File.expand_path('../connection', __FILE__)
2  
-require File.expand_path('../request', __FILE__)
3  
-require File.expand_path('../authentication', __FILE__)
  1
+require 'twitter/connection'
  2
+require 'twitter/request'
  3
+require 'twitter/authentication'
4 4
 
5 5
 module Twitter
6 6
   # @private
21  lib/twitter/client.rb
@@ -7,7 +7,26 @@ class Client < API
7 7
     # Require client method modules after initializing the Client class in
8 8
     # order to avoid a superclass mismatch error, allowing those modules to be
9 9
     # Client-namespaced.
10  
-    Dir[File.expand_path('../client/*.rb', __FILE__)].each{|f| require f}
  10
+    require 'twitter/client/utils'
  11
+    require 'twitter/client/account'
  12
+    require 'twitter/client/block'
  13
+    require 'twitter/client/direct_messages'
  14
+    require 'twitter/client/favorites'
  15
+    require 'twitter/client/friendship'
  16
+    require 'twitter/client/friends_and_followers'
  17
+    require 'twitter/client/geo'
  18
+    require 'twitter/client/legal'
  19
+    require 'twitter/client/list'
  20
+    require 'twitter/client/list_members'
  21
+    require 'twitter/client/list_subscribers'
  22
+    require 'twitter/client/local_trends'
  23
+    require 'twitter/client/notification'
  24
+    require 'twitter/client/spam_reporting'
  25
+    require 'twitter/client/saved_searches'
  26
+    require 'twitter/client/timeline'
  27
+    require 'twitter/client/trends'
  28
+    require 'twitter/client/tweets'
  29
+    require 'twitter/client/user'
11 30
 
12 31
     alias :api_endpoint :endpoint
13 32
 
2  lib/twitter/configuration.rb
... ...
@@ -1,5 +1,5 @@
1 1
 require 'faraday'
2  
-require File.expand_path('../version', __FILE__)
  2
+require 'twitter/version'
3 3
 
4 4
 module Twitter
5 5
   # Defines constants and methods related to configuration
5  lib/twitter/connection.rb
... ...
@@ -1,5 +1,8 @@
1 1
 require 'faraday_middleware'
2  
-Dir[File.expand_path('../../faraday/*.rb', __FILE__)].each{|f| require f}
  2
+require 'faraday/multipart'
  3
+require 'faraday/oauth'
  4
+require 'faraday/raise_http_4xx'
  5
+require 'faraday/raise_http_5xx'
3 6
 
4 7
 module Twitter
5 8
   # @private
2  spec/faraday/response_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Faraday::Response do
4 4
   before do
4  spec/spec_helper.rb → spec/helper.rb
@@ -4,9 +4,7 @@
4 4
   add_group 'Faraday Middleware', 'lib/faraday'
5 5
   add_group 'Specs', 'spec'
6 6
 end
7  
-
8  
-require File.expand_path('../../lib/twitter', __FILE__)
9  
-
  7
+require 'twitter'
10 8
 require 'rspec'
11 9
 require 'webmock/rspec'
12 10
 RSpec.configure do |config|
2  spec/twitter/api_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Twitter::API do
4 4
   before do
2  spec/twitter/base_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Twitter::Base do
4 4
   context ".new" do
2  spec/twitter/client/account_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../../../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Twitter::Client do
4 4
   Twitter::Configuration::VALID_FORMATS.each do |format|
2  spec/twitter/client/block_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../../../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Twitter::Client do
4 4
   Twitter::Configuration::VALID_FORMATS.each do |format|
2  spec/twitter/client/direct_messages_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../../../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Twitter::Client do
4 4
   Twitter::Configuration::VALID_FORMATS.each do |format|
2  spec/twitter/client/favorites_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../../../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Twitter::Client do
4 4
   Twitter::Configuration::VALID_FORMATS.each do |format|
2  spec/twitter/client/friends_and_followers_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../../../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Twitter::Client do
4 4
   Twitter::Configuration::VALID_FORMATS.each do |format|
2  spec/twitter/client/friendship_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../../../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Twitter::Client do
4 4
   Twitter::Configuration::VALID_FORMATS.each do |format|
2  spec/twitter/client/geo_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../../../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Twitter::Client do
4 4
   context ".new" do
2  spec/twitter/client/legal_spec.rb
... ...
@@ -1,4 +1,4 @@
2  spec/twitter/client/list_members_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../../../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Twitter::Client do
4 4
   Twitter::Configuration::VALID_FORMATS.each do |format|
2  spec/twitter/client/list_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../../../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Twitter::Client do
4 4
   Twitter::Configuration::VALID_FORMATS.each do |format|
2  spec/twitter/client/list_subscribers_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../../../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Twitter::Client do
4 4
   Twitter::Configuration::VALID_FORMATS.each do |format|
2  spec/twitter/client/local_trends_spec.rb
... ...
@@ -1,4 +1,4 @@
2  spec/twitter/client/notification_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../../../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Twitter::Client do
4 4
   Twitter::Configuration::VALID_FORMATS.each do |format|
2  spec/twitter/client/saved_searches_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../../../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Twitter::Client do
4 4
   Twitter::Configuration::VALID_FORMATS.each do |format|
2  spec/twitter/client/spam_reporting_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../../../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Twitter::Client do
4 4
   Twitter::Configuration::VALID_FORMATS.each do |format|
2  spec/twitter/client/timeline_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../../../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Twitter::Client do
4 4
   Twitter::Configuration::VALID_FORMATS.each do |format|
2  spec/twitter/client/trends_spec.rb
... ...
@@ -1,4 +1,4 @@
2  spec/twitter/client/tweets_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../../../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Twitter::Client do
4 4
   Twitter::Configuration::VALID_FORMATS.each do |format|
2  spec/twitter/client/user_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../../../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Twitter::Client do
4 4
   Twitter::Configuration::VALID_FORMATS.each do |format|
2  spec/twitter/client_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Twitter::Client do
4 4
   it "should connect using the endpoint configuration" do
2  spec/twitter/search_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Twitter::Search do
4 4
 
2  spec/twitter_spec.rb
... ...
@@ -1,4 +1,4 @@
1  
-require File.expand_path('../spec_helper', __FILE__)
  1
+require 'helper'
2 2
 
3 3
 describe Twitter do
4 4
   after do

1 note on commit 6a629a6

Josh Kalderimis

Yay! I <3 Load Path

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