harrisj-nytimes-articles 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/nytimes_articles/article.rb +8 -2
- data/test/nytimes/articles/test_article.rb +4 -3
- metadata +2 -2
data/VERSION.yml
CHANGED
@@ -252,7 +252,13 @@ module Nytimes
|
|
252
252
|
|
253
253
|
def self.add_facets_param(out_params, in_params)
|
254
254
|
if in_params[:facets]
|
255
|
-
|
255
|
+
unless in_params[:facets].is_a? Array
|
256
|
+
facet_array = [in_params[:facets]]
|
257
|
+
else
|
258
|
+
facet_array = in_params[:facets]
|
259
|
+
end
|
260
|
+
|
261
|
+
out_params['facets'] = facet_array.map {|f| Facet.symbol_name(f)}.join(',')
|
256
262
|
end
|
257
263
|
end
|
258
264
|
|
@@ -425,7 +431,7 @@ module Nytimes
|
|
425
431
|
end
|
426
432
|
|
427
433
|
if in_params[:since] && out_params['end_date'].nil?
|
428
|
-
out_params['end_date'] = date_argument(:end_date,
|
434
|
+
out_params['end_date'] = date_argument(:end_date, Date.today + 1)
|
429
435
|
end
|
430
436
|
end
|
431
437
|
|
@@ -112,9 +112,10 @@ class TestNytimes::TestArticles::TestArticle < Test::Unit::TestCase
|
|
112
112
|
assert_raise(ArgumentError) { Article.search :since => 23 }
|
113
113
|
end
|
114
114
|
|
115
|
-
|
116
|
-
|
117
|
-
Article.
|
115
|
+
# This is to fix an error where the begin and end date are the same
|
116
|
+
should "add a end_date of tomorrow if no :before or :end_date argument is provided" do
|
117
|
+
Article.expects(:invoke).with(has_entry('end_date', (Date.today + 1).strftime("%Y%m%d")))
|
118
|
+
Article.search :since => Date.today
|
118
119
|
end
|
119
120
|
|
120
121
|
should "not automatically add a end_date is there is a :before argument" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: harrisj-nytimes-articles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacob Harris
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-03-01 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|