Permalink
Browse files

Merge branch 'master' of github.com:samsymons/RedditKit.rb

  • Loading branch information...
2 parents 1d52771 + 13a7d08 commit 932c48855222897b87d05a14a4f8a5f668c0ffb2 Sam Symons committed Jan 6, 2014
Showing with 9 additions and 3 deletions.
  1. +1 −1 .travis.yml
  2. +5 −0 Gemfile
  3. +1 −1 lib/redditkit/client/captcha.rb
  4. +2 −1 lib/redditkit/client/search.rb
View
@@ -1,13 +1,13 @@
language: ruby
rvm:
- jruby-19mode
- - rbx-19mode
- 1.9.3
- 2.0.0
- 2.1.0
matrix:
allow_failures:
- rvm: 2.1.0
+ - rvm: rbx
env:
global:
- secure: "Ry6INhL05+XfREUEDBbe0hhui/ijy6BZh2Ez8AtCEudUE3pfm5iQla5Su3lYolUozStGFziwMxRsUHsO25gHH/f1NHjcosipYOmE2F61nktLIUMYDOJTG1rRWBa4NUqnDZr1xF/nt7vurJAjtigJ9nVjir1TRg5Cq+DSNkJvNhY="
View
@@ -17,4 +17,9 @@ group :test do
gem 'webmock', '>= 1.12.0'
end
+platforms :rbx do
+ gem 'rubysl', '~> 2'
+ gem 'racc', '~> 1.4'
+end
+
gemspec
@@ -11,7 +11,7 @@ def needs_captcha?
response = get('api/needs_captcha.json', nil)
needs_captcha = response[:body]
- needs_captcha == 'true'
+ needs_captcha.to_s == 'true'
end
# Returns a new CATPCHA identifier.
@@ -10,12 +10,13 @@ module Search
# @option options [true, false] :restrict_to_subreddit Whether to search only in a specified subreddit.
# @option options [String, RedditKit::Subreddit] :subreddit The optional subreddit to search.
# @option options [1..100] limit The number of links to return.
+ # @option options [String] the order in which to return results which is one of (relevance, new, hot, top, comments)
# @option options [String] before Only return links before this full name.
# @option options [String] after Only return links after this full name.
# @return [RedditKit::PaginatedResponse]
def search(query, options = {})
path = "%s/search.json" % ('r/' + options[:subreddit] if options[:subreddit])
- parameters = { :q => query, :restrict_sr => options[:restrict_to_subreddit], :limit => options[:limit] }
+ parameters = { :q => query, :restrict_sr => options[:restrict_to_subreddit], :limit => options[:limit], :sort => options[:sort] }
objects_from_response(:get, path, parameters)
end

0 comments on commit 932c488

Please sign in to comment.