posterboard 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -0
- data/VERSION +1 -1
- data/lib/posterboard/connection.rb +5 -3
- data/posterboard.gemspec +2 -2
- data/spec/posterboard/connection_spec.rb +2 -1
- metadata +4 -4
data/README.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'httparty'
|
2
2
|
require 'json'
|
3
3
|
require 'logger'
|
4
|
+
require 'time'
|
4
5
|
|
5
6
|
module Posterboard
|
6
7
|
class Connection
|
@@ -30,11 +31,12 @@ module Posterboard
|
|
30
31
|
raise MissingSiteIDError, "Is the Posterous service broken?" unless site.key? "id"
|
31
32
|
response = Connection.get("/users/me/sites/#{site["id"]}/posts")
|
32
33
|
posts = []
|
33
|
-
::JSON.parse(response.body).each do |
|
34
|
+
::JSON.parse(response.body).each do |content|
|
34
35
|
# => TODO: BlankSlate and define these as methods on post, i.e. post.title, or use OpenStruct
|
35
36
|
post = OpenStruct.new
|
36
|
-
post.title =
|
37
|
-
post.body =
|
37
|
+
post.title = content['title']
|
38
|
+
post.body = content['body_full']
|
39
|
+
post.date = Time.parse(content['display_date'])
|
38
40
|
posts << post
|
39
41
|
end
|
40
42
|
posts
|
data/posterboard.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{posterboard}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Waylon Calabrese"]
|
12
|
-
s.date = %q{2011-05-
|
12
|
+
s.date = %q{2011-05-13}
|
13
13
|
s.description = %q{Ruby API for reading posts from your Posterous account.}
|
14
14
|
s.email = %q{hiwaylon@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -11,7 +11,7 @@ describe Posterboard::Connection do
|
|
11
11
|
:body => [{"id" => "1234", "name" => "your_site_name"}, {"id" => "5678", "name" => "another_site_name"}])
|
12
12
|
stub_request(:get, "http://#{username}:#{password}@www.posterous.com/api/2/users/me/sites/1234/posts?api_token=").
|
13
13
|
to_return(:status => 200,
|
14
|
-
:body => [{:title => "ad litora", :body_full => "lorem ipsum"}, {:title => "sociosqu torquent", :body_full => "dolor set"}].to_json)
|
14
|
+
:body => [{:display_date => Time.now.to_s, :title => "ad litora", :body_full => "lorem ipsum"}, {:display_date => Time.now.to_s, :title => "sociosqu torquent", :body_full => "dolor set"}].to_json)
|
15
15
|
@connection = Posterboard::Connection.new(username, password)
|
16
16
|
end
|
17
17
|
|
@@ -32,6 +32,7 @@ describe Posterboard::Connection do
|
|
32
32
|
@connection.your_site_name.each do |post|
|
33
33
|
post.title.should_not be_nil
|
34
34
|
post.body.should_not be_nil
|
35
|
+
post.date.should_not be_nil
|
35
36
|
end
|
36
37
|
end
|
37
38
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: posterboard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Waylon Calabrese
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-05-
|
18
|
+
date: 2011-05-13 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|