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 CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 2
3
- :patch: 0
3
+ :patch: 1
4
4
  :major: 0
@@ -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
- out_params['facets'] = in_params[:facets].to_a.map {|f| Facet.symbol_name(f)}.join(',')
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, Time.now)
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
- should "add a end_date of today if no :before or :end_date argument is provided" do
116
- Article.expects(:invoke).with(has_entry('end_date', Time.now.strftime("%Y%m%d")))
117
- Article.search :since => Time.now
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.0
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-02-27 00:00:00 -08:00
12
+ date: 2009-03-01 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency