jordandobson-posterous 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.txt CHANGED
@@ -4,9 +4,9 @@ http://github.com/jordandobson/Posterous/tree/master
4
4
 
5
5
  == DESCRIPTION:
6
6
 
7
- The Posterous gem provides posting to Posterous.com using your email, password, site id(if you have multiple sites) and your blog content. With this gem, you have access to add an entry on posterous by providing these options a title, body text, date, tags, set to autopost, set private, posted by source name and a posted by source link to Posterous. You can include no options or all options.
7
+ The Posterous gem provides posting to Posterous.com using your email, password, site id(if you have multiple sites) and your blog content. With this gem, you have access to add an entry on posterous by providing these options a title, body text, date, tags, set to autopost, set private, posted by source name and a posted by source link to Posterous. You can include no options, all options or anything in between.
8
8
 
9
- Posting images with posts, posting only images and pulling down your posts will be available soon.
9
+ Posting images with posts, posting only images and pulling down your posts will be available very soon.
10
10
 
11
11
  == FEATURES/PROBLEMS:
12
12
 
data/lib/posterous.rb CHANGED
@@ -15,7 +15,7 @@ class PosterousSiteError < StandardError; end
15
15
 
16
16
  class Posterous
17
17
 
18
- VERSION = '0.1.3'
18
+ VERSION = '0.1.4'
19
19
  DOMAIN = 'posterous.com'
20
20
  POST_PATH = '/api/newpost'
21
21
  AUTH_PATH = '/api/getsites'
@@ -31,12 +31,13 @@ class Posterous
31
31
  !user.is_a?(String) || !pass.is_a?(String) || user == "" || pass == ""
32
32
  self.class.basic_auth user, pass
33
33
  @site_id = site_id ? site_id.to_s : site_id
34
- @source = @body = @title = @source_url = @date = @media = @tags = nil
34
+ @source = @body = @title = @source_url = @date = @media = @tags = @autopost = @private_post = nil
35
35
  end
36
36
 
37
37
  def site_id= id
38
38
  @site_id = id.to_s
39
39
  end
40
+
40
41
  def tags= ary
41
42
  raise PosterousTagError, 'Tags must add from be in an array' if !ary.is_a?(Array)
42
43
  @tags = ary.join(", ")
@@ -229,12 +229,7 @@ class TestPosterous < Test::Unit::TestCase
229
229
  assert_equal @new_obj.tags, "Glue"
230
230
  end
231
231
 
232
- def test_tags_single_is_correctly
233
- @new_obj.tags = ["Glue"]
234
- assert_equal @new_obj.tags, "Glue"
235
- end
236
-
237
- def test_tags_single_is_correctly_joined
232
+ def test_tags_multiple_is_correctly_joined
238
233
  @new_obj.tags = ["Glue", "Posterous", "Ruby on Rails"]
239
234
  assert_equal @new_obj.tags, "Glue, Posterous, Ruby on Rails"
240
235
  end
@@ -280,15 +275,6 @@ class TestPosterous < Test::Unit::TestCase
280
275
  assert_equal @resp_ok["rsp"]["site"]["id"], updated
281
276
  end
282
277
 
283
- def test_gets_primary_site_is_set_to_site_id
284
- Posterous.stubs(:post).returns(@resp_ok)
285
- original = @new_obj.site_id
286
- @new_obj.site_id = @new_obj.get_primary_site
287
- updated = @new_obj_with_id.site_id
288
- assert_not_equal original, updated
289
- assert_equal @resp_ok["rsp"]["site"]["id"], updated
290
- end
291
-
292
278
  def test_builds_query_without_site_id
293
279
  expected = { :source => nil, :title => nil, :body => nil, :sourceLink => nil}
294
280
  assert_equal expected, @new_obj.build_query
@@ -327,7 +313,7 @@ class TestPosterous < Test::Unit::TestCase
327
313
  assert_equal expected, @new_obj.build_query
328
314
  end
329
315
 
330
- def test_builds_query_with_site_id
316
+ def test_builds_query_with_integer_set_as_site_id
331
317
  @new_obj.site_id = 20
332
318
  expected = { :source => nil, :body => nil, :sourceLink => nil, :site_id => "20", :title => nil }
333
319
  assert_equal expected, @new_obj.build_query
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jordandobson-posterous
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Dobson