tumblr4r 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/ChangeLog CHANGED
@@ -1,4 +1,9 @@
1
- == 0.0.1 / 2009-09-07
1
+ == 0.7.1 / 2009-09-11
2
+ * fix: missing Site#delete
3
+ * fix: the number of the records is wrong when finding with :limit and :offset options.
4
+
5
+
6
+ == 0.7.0 / 2009-09-09
2
7
 
3
8
  * initial release
4
9
 
data/lib/tumblr4r.rb CHANGED
@@ -5,7 +5,7 @@ require 'active_support'
5
5
  require 'logger'
6
6
  require 'cgi'
7
7
  module Tumblr4r
8
- VERSION = '0.7.0'
8
+ VERSION = '0.7.1'
9
9
  class TumblrError < StandardError
10
10
  end
11
11
 
@@ -78,7 +78,7 @@ module Tumblr4r
78
78
  total = self.count(options)
79
79
  if options[:limit]
80
80
  goal = [total - params[:start],
81
- options[:limit] - params[:start]].min
81
+ options[:limit]].min
82
82
  else
83
83
  goal = total - params[:start]
84
84
  end
@@ -150,6 +150,11 @@ module Tumblr4r
150
150
  return new_post
151
151
  end
152
152
 
153
+ # @param [Integer] post_id
154
+ def delete(post_id)
155
+ return @conn.delete(post_id)
156
+ end
157
+
153
158
  end
154
159
 
155
160
  # Postおよびその子クラスは原則として単なるData Transfer Objectとし、
@@ -359,7 +364,7 @@ module Tumblr4r
359
364
  end
360
365
  end
361
366
 
362
- # @params [Integer] post_id
367
+ # @param [Integer] post_id
363
368
  def delete(post_id)
364
369
  raise TumblrError.new("email or password is invalid") unless authenticated
365
370
  response = nil
@@ -22,7 +22,6 @@ class Tumblr4rTest < Test::Unit::TestCase
22
22
  def teardown
23
23
  end
24
24
 
25
-
26
25
  def test_initialize
27
26
  assert_equal READ_TEST_HOST, @site.hostname
28
27
  assert_nil @site.email
@@ -86,6 +85,11 @@ class Tumblr4rTest < Test::Unit::TestCase
86
85
  assert_equal TOTAL_COUNT-12, posts.size
87
86
  end
88
87
 
88
+ def test_find_all_with_limit_and_offset
89
+ posts = @large_site.find(:all, :offset => 1, :limit => 2)
90
+ assert_equal 2, posts.size
91
+ end
92
+
89
93
  # 実際に存在するよりも多いoffsetを指定した場合
90
94
  def test_find_all_over_offset
91
95
  posts = @large_site.find(:all, :type => "quote", :offset => TOTAL_COUNT + 1)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tumblr4r
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomoki MAEDA
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-09 00:00:00 +09:00
12
+ date: 2009-09-12 00:00:00 +09:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency