Skip to content

Commit

Permalink
Remove deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Oct 7, 2011
1 parent e60b9ca commit 5f59f19
Show file tree
Hide file tree
Showing 17 changed files with 7 additions and 441 deletions.
1 change: 0 additions & 1 deletion lib/twitter.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'twitter/api'
require 'twitter/base'
require 'twitter/client'
require 'twitter/configuration'
require 'twitter/error'
Expand Down
24 changes: 0 additions & 24 deletions lib/twitter/base.rb

This file was deleted.

17 changes: 0 additions & 17 deletions lib/twitter/client/block.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,6 @@ def block?(user, options={})
false
end

# Returns true if the authenticating user is blocking a target user
#
# @see https://dev.twitter.com/docs/api/1/get/blocks/exists
# @deprecated {Twitter::Client::Block#block_exists?} is deprecated and will be removed in the next major version. Please use {Twitter::Client::Block#block?} instead.
# @requires_authentication Yes
# @rate_limited Yes
# @param user [Integer, String] A Twitter user ID or screen name.
# @param options [Hash] A customizable set of options.
# @return [Boolean] true if the authenticating user is blocking the target user, otherwise false.
# @example Check whether the authenticating user is blocking @sferik
# Twitter.block?("sferik")
# Twitter.block?(7505382) # Same as above
def block_exists?(user, options={})
warn "#{caller.first}: [DEPRECATION] #block_exists? is deprecated and will be removed in the next major version. Please use #block? instead."
block?(user, options)
end

# Returns an array of user objects that the authenticating user is blocking
#
# @see https://dev.twitter.com/docs/api/1/get/blocks/blocking
Expand Down
17 changes: 0 additions & 17 deletions lib/twitter/client/friendship.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,6 @@ def friendship?(user_a, user_b, options={})
get("/1/friendships/exists.json", options.merge(:user_a => user_a, :user_b => user_b))
end

# Test for the existence of friendship between two users
#
# @see https://dev.twitter.com/docs/api/1/get/friendships/exists
# @deprecated {Twitter::Client::Friendship#friendship_exists?} is deprecated and will be removed in the next major version. Please use {Twitter::Client::Friendship#friendship?} instead.
# @rate_limited Yes
# @requires_authentication No unless user_a or user_b is protected
# @param user_a [Integer, String] The ID or screen_name of the subject user.
# @param user_b [Integer, String] The ID or screen_name of the user to test for following.
# @param options [Hash] A customizable set of options.
# @return [Boolean] true if user_a follows user_b, otherwise false.
# @example Return true if @sferik follows @pengwynn
# Twitter.friendship_exists?("sferik", "pengwynn")
def friendship_exists?(user_a, user_b, options={})
warn "#{caller.first}: [DEPRECATION] #friendship_exists? is deprecated and will be removed in the next major version. Please use #friendship? instead."
friendship?(user_a, user_b, options={})
end

# Returns detailed information about the relationship between two users
#
# @see https://dev.twitter.com/docs/api/1/get/friendships/show
Expand Down
29 changes: 7 additions & 22 deletions lib/twitter/client/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,14 @@ module List
# @note Accounts are limited to 20 lists.
# @rate_limited No
# @requires_authentication Yes
# @overload list_create(screen_name, name, options={})
# @deprecated Calling {Twitter::Client::List#list_create} with a screen_name is deprecated and will be removed in the next major version. Please omit the screen_name argument.
# @param screen_name [String] A Twitter user name.
# @param name [String] The name for the list.
# @param options [Hash] A customizable set of options.
# @option options [String] :mode ('public') Whether your list is public or private. Values can be 'public' or 'private'.
# @option options [String] :description The description to give the list.
# @example Create a list named "presidents"
# Twitter.list_create("sferik", "presidents")
# @overload list_create(name, options={})
# @param name [String] The name for the list.
# @param options [Hash] A customizable set of options.
# @option options [String] :mode ('public') Whether your list is public or private. Values can be 'public' or 'private'.
# @option options [String] :description The description to give the list.
# @example Create a list named "presidents"
# Twitter.list_create("presidents")
# @param name [String] The name for the list.
# @param options [Hash] A customizable set of options.
# @option options [String] :mode ('public') Whether your list is public or private. Values can be 'public' or 'private'.
# @option options [String] :description The description to give the list.
# @example Create a list named "presidents"
# Twitter.list_create("presidents")
# @return [Hashie::Mash] The created list.
def list_create(*args)
options = args.last.is_a?(Hash) ? args.pop : {}
name = args.pop
if screen_name = args.pop
warn "#{caller.first}: [DEPRECATION] Calling #list_create with a screen_name is deprecated and will be removed in the next major version. Please omit the screen_name argument."
end
def list_create(name, options={})
post("/1/lists/create.json", options.merge(:name => name))
end

Expand Down
30 changes: 0 additions & 30 deletions lib/twitter/client/list_members.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,36 +186,6 @@ def list_member?(*args)
rescue Twitter::NotFound, Twitter::Forbidden
false
end

# Check if a user is a member of the specified list
#
# @see https://dev.twitter.com/docs/api/1/get/lists/members/show
# @deprecated {Twitter::Client::ListMembers#is_list_member?} is deprecated and will be removed in the next major version. Please use {Twitter::Client::ListMembers#list_member?} instead.
# @requires_authentication Yes
# @rate_limited Yes
# @overload is_list_member?(list, user_to_check, options={})
# @param list [Integer, String] The list_id or slug of the list.
# @param user_to_check [Integer, String] The user ID or screen name of the list member.
# @param options [Hash] A customizable set of options.
# @return [Boolean] true if user is a member of the specified list, otherwise false.
# @example Check if @BarackObama is a member of the authenticated user's "presidents" list
# Twitter.is_list_member?("presidents", 813286)
# Twitter.is_list_member?(8863586, 'BarackObama')
# @overload is_list_member?(user, list, user_to_check, options={})
# @param user [Integer, String] A Twitter user ID or screen name.
# @param list [Integer, String] The list_id or slug of the list.
# @param user_to_check [Integer, String] The user ID or screen name of the list member.
# @param options [Hash] A customizable set of options.
# @return [Boolean] true if user is a member of the specified list, otherwise false.
# @example Check if @BarackObama is a member of @sferik's "presidents" list
# Twitter.is_list_member?("sferik", "presidents", 813286)
# Twitter.is_list_member?('sferik', 8863586, 'BarackObama')
# Twitter.is_list_member?(7505382, "presidents", 813286)
# @return [Boolean] true if user is a member of the specified list, otherwise false.
def is_list_member?(*args)
warn "#{caller.first}: [DEPRECATION] #is_list_member? is deprecated and will be removed in the next major version. Please use #list_member? instead."
list_member?(args)
end
end
end
end
32 changes: 0 additions & 32 deletions lib/twitter/client/list_subscribers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,38 +139,6 @@ def list_subscriber?(*args)
rescue Twitter::NotFound, Twitter::Forbidden
false
end

# Check if a user is a subscriber of the specified list
#
# @see https://dev.twitter.com/docs/api/1/get/lists/subscribers/show
# @deprecated {Twitter::Client::ListSubscribers#is_subscriber?} is deprecated and will be removed in the next major version. Please use {Twitter::Client::ListSubscribers#list_subscriber?} instead.
# @rate_limited Yes
# @requires_authentication Yes
# @overload is_subscriber?(list, user_to_check, options={})
# @param list [Integer, String] The list_id or slug of the list.
# @param user_to_check [Integer, String] The user ID or screen_name of the list member.
# @param options [Hash] A customizable set of options.
# @return [Boolean] true if user is a subscriber of the specified list, otherwise false.
# @example Check if @BarackObama is a subscriber of the authenticated user's "presidents" list
# Twitter.is_subscriber?('presidents', 813286)
# Twitter.is_subscriber?(8863586, 813286)
# Twitter.is_subscriber?('presidents', 'BarackObama')
# @overload is_subscriber?(user, list, user_to_check, options={})
# @param user [Integer, String] A Twitter user ID or screen name.
# @param list [Integer, String] The list_id or slug of the list.
# @param user_to_check [Integer, String] The user ID or screen_name of the list member.
# @param options [Hash] A customizable set of options.
# @return [Boolean] true if user is a subscriber of the specified list, otherwise false.
# @example Check if @BarackObama is a subscriber of @sferik's "presidents" list
# Twitter.is_subscriber?("sferik", 'presidents', 813286)
# Twitter.is_subscriber?("sferik", 8863586, 813286)
# Twitter.is_subscriber?(7505382, 'presidents', 813286)
# Twitter.is_subscriber?("sferik", 'presidents', 'BarackObama')
# @return [Boolean] true if user is a subscriber of the specified list, otherwise false.
def is_subscriber?(*args)
warn "#{caller.first}: [DEPRECATION] #is_subscriber? is deprecated and will be removed in the next major version. Please use #list_subscriber? instead."
list_subscriber?(args)
end
end
end
end
25 changes: 0 additions & 25 deletions lib/twitter/client/timeline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def public_timeline(options={})
# Returns the 20 most recent statuses, including retweets if they exist, posted by the authenticating user and the users they follow
#
# @see https://dev.twitter.com/docs/api/1/get/statuses/home_timeline
# @note This method is identical to {Twitter::Client::Timeline#friends_timeline}, except that this method always includes retweets.
# @note This method can only return up to 800 statuses, including retweets.
# @rate_limited Yes
# @requires_authentication Yes
Expand All @@ -39,30 +38,6 @@ def home_timeline(options={})
get("/1/statuses/home_timeline.json", options)
end

# Returns the 20 most recent statuses posted by the authenticating user and the users they follow
#
# @see https://dev.twitter.com/docs/api/1/get/statuses/friends_timeline
# @deprecated {Twitter::Client::Timeline#friends_timeline} is deprecated and will be removed in the next major version. Please use {Twitter::Client::Timeline#home_timeline} instead.
# @note This method is identical to {Twitter::Client::Timeline#home_timeline}, except that this method will only include retweets if the :include_rts option is set.
# @note This method can only return up to 800 statuses. If the :include_rts option is set, only 800 statuses, including retweets if they exist, can be returned.
# @rate_limited Yes
# @requires_authentication Yes
# @param options [Hash] A customizable set of options.
# @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID.
# @option options [Integer] :max_id Returns results with an ID less than (that is, older than) or equal to the specified ID.
# @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 200.
# @option options [Integer] :page Specifies the page of results to retrieve.
# @option options [Boolean, String, Integer] :trim_user Each tweet returned in a timeline will include a user object with only the author's numerical ID when set to true, 't' or 1.
# @option options [Boolean, String, Integer] :include_rts The timeline will contain native retweets (if they exist) in addition to the standard stream of tweets when set to true, 't' or 1.
# @option options [Boolean, String, Integer] :include_entities Include {https://dev.twitter.com/docs/tweet-entities Tweet Entities} when set to true, 't' or 1.
# @return [Array]
# @example Return the 20 most recent statuses, including retweets if they exist, posted by the authenticating user and the users they follow
# Twitter.friends_timeline
def friends_timeline(options={})
warn "#{caller.first}: [DEPRECATION] #friends_timeline is deprecated and will be removed in the next major version. Please use #home_timeline instead."
home_timeline(options)
end

# Returns the 20 most recent statuses posted by the specified user
#
# @see https://dev.twitter.com/docs/api/1/get/statuses/user_timeline
Expand Down
16 changes: 0 additions & 16 deletions lib/twitter/client/trends.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,6 @@ def trends(options={})
local_trends(1, options)
end

# Returns the current top 10 trending topics on Twitter
#
# @see https://dev.twitter.com/docs/api/1/get/trends/current
# @deprecated {Twitter::Client::Trends#trends_current} is deprecated and will be removed in the next major version. Please use {Twitter::Client::Trends#trends} instead.
# @rate_limited Yes
# @requires_authentication No
# @param options [Hash] A customizable set of options.
# @option options [String] :exclude Setting this equal to 'hashtags' will remove all hashtags from the trends list.
# @return [Array]
# @example Return the current top 10 trending topics on Twitter
# Twitter.trends_current
def trends_current(options={})
warn "#{caller.first}: [DEPRECATION] #trends_current is deprecated and will be removed in the next major version. Please use #trends instead."
local_trends(1, options)
end

# Returns the top 20 trending topics for each hour in a given day
#
# @see https://dev.twitter.com/docs/api/1/get/trends/daily
Expand Down
Loading

0 comments on commit 5f59f19

Please sign in to comment.