Skip to content

Commit

Permalink
Rename scheme -> protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Oct 13, 2010
1 parent dd9d671 commit 512fcdf
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions lib/twitter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ def self.format=(value)
@format = value
end

def self.scheme
@scheme ||= 'https'
def self.protocol
@protocol ||= 'https'
end

def self.scheme=(value)
@scheme = value
def self.protocol=(value)
@protocol = value
end

def self.api_endpoint
Expand Down
2 changes: 1 addition & 1 deletion lib/twitter/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def connection_with_builders(builders)
builder.adapter(@adapter || Faraday.default_adapter)
builders.each do |b| builder.use b end
end
@connection.scheme = Twitter.scheme
@connection.scheme = Twitter.protocol
@connection
end

Expand Down
2 changes: 1 addition & 1 deletion lib/twitter/geo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def connection
end
builder.use Faraday::Response::Mashify
end
@connection.scheme = Twitter.scheme
@connection.scheme = Twitter.protocol
@connection
end

Expand Down
2 changes: 1 addition & 1 deletion lib/twitter/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def connection
end
builder.use Faraday::Response::Mashify
end
@connection.scheme = Twitter.scheme
@connection.scheme = Twitter.protocol
@connection
end

Expand Down
2 changes: 1 addition & 1 deletion lib/twitter/trends.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def connection
end
builder.use Faraday::Response::Mashify
end
@connection.scheme = Twitter.scheme
@connection.scheme = Twitter.protocol
@connection
end

Expand Down
2 changes: 1 addition & 1 deletion lib/twitter/unauthenticated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def connection_with_builders(builders)
builder.adapter(@adapter || Faraday.default_adapter)
builders.each do |b| builder.use b end
end
@connection.scheme = Twitter.scheme
@connection.scheme = Twitter.protocol
@connection
end

Expand Down
14 changes: 7 additions & 7 deletions test/twitter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,16 @@ class TwitterTest < Test::Unit::TestCase
end
end

should "default scheme to https" do
assert_equal "https", Twitter.scheme
should "default protocol to https" do
assert_equal "https", Twitter.protocol
end

context "when overriding scheme" do
should "be able to specify scheme" do
Twitter.scheme = "http"
assert_equal "http", Twitter.scheme
context "when overriding protocol" do
should "be able to specify protocol" do
Twitter.protocol = "http"
assert_equal "http", Twitter.protocol
# Reset
Twitter.scheme = "https"
Twitter.protocol = "https"
end
end

Expand Down

0 comments on commit 512fcdf

Please sign in to comment.