pinboard 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -4,4 +4,5 @@ platforms :jruby do
4
4
  gem 'jruby-openssl', '~> 0.7'
5
5
  end
6
6
 
7
+
7
8
  gemspec
data/README.md CHANGED
@@ -11,23 +11,31 @@ Examples
11
11
 
12
12
  I'm currently exploring two API interfaces:
13
13
 
14
+ ```ruby
14
15
  pinboard = Pinboard::Client.new(:username => 'foo', :password => 'bar')
15
16
  posts = pinboard.posts
16
-
17
+ ```
17
18
  or:
18
19
 
20
+ ```ruby
19
21
  posts = Pinboard::Post.all(:username => 'foo', :password => 'bar')
20
-
22
+ ```
21
23
  Both examples work.
22
24
 
23
- Future Examples (I don't need them, so I haven't written them)
24
- --------------------------------------------------------------
25
+ Passing arguments: (works only for the Client API Interface)
25
26
 
26
- pinboard.posts(:tag => 'ruby') #all posts tagged 'ruby'
27
+ ```ruby
28
+ pinboard.posts(:tag => 'ruby') #all posts tagged 'ruby'
29
+ pinboard.posts(:tag => 'ruby,pinboard') #all posts tagged 'ruby' and 'pinboard'
27
30
  pinboard.posts(:start => 20) #starting on the 20th post
28
31
  pinboard.posts(:results => 20) #return only first 20 matching posts
29
- pinboard.posts(:from => 4.days.ago) #all posts in past 4 days
30
- pinboard.posts(:to => 4.days.ago) #all posts up to 4 days ago
32
+ pinboard.posts(:fromdt => 4.days.ago) #all posts in past 4 days
33
+ pinboard.posts(:todt => 4.days.ago) #all posts up to 4 days ago
34
+ ```
35
+
36
+ Future Examples (I don't need them, so I haven't written them)
37
+ --------------------------------------------------------------
38
+
31
39
  pinboard.posts(:meta => true) #include meta data in post models
32
40
 
33
41
  Ruby Support & Continuous Integration
@@ -10,10 +10,14 @@ module Pinboard
10
10
  :password => options[:password] }
11
11
  end
12
12
 
13
- def posts
14
- options = { :basic_auth => @auth }
13
+ def posts(params={})
14
+ options = {}
15
+ options[:basic_auth] = @auth
16
+ options[:query] = params
15
17
  posts = self.class.get('/posts/all', options)['posts']['post']
16
- posts.map { |p| Post.new(Util.symbolize_keys(p)) }
18
+ if !posts.nil?
19
+ posts.map { |p| Post.new(Util.symbolize_keys(p)) }
20
+ end
17
21
  end
18
22
  end
19
23
  end
data/pinboard.gemspec CHANGED
@@ -11,8 +11,8 @@ Gem::Specification.new do |s|
11
11
 
12
12
  s.add_runtime_dependency 'httparty', '~> 0.7'
13
13
  s.name = 'pinboard'
14
- s.version = '0.0.2'
15
- s.date = '2011-10-13'
14
+ s.version = '0.0.3'
15
+ s.date = '2011-12-14'
16
16
  s.summary = "Ruby wrapper for the Pinboard API"
17
17
  s.description = "Ruby wrapper for the Pinboard API"
18
18
  s.authors = ["Ryan Waker"]
@@ -5,7 +5,7 @@ describe Pinboard::Client do
5
5
  let(:client) { Pinboard::Client.new(auth_params) }
6
6
 
7
7
  before do
8
- stub_get("posts/all").
8
+ stub_get("posts/all?").
9
9
  to_return(:body => fixture("posts_all.xml"),
10
10
  :headers => { 'content-type' => 'text/xml' })
11
11
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pinboard
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Waker
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-13 00:00:00 Z
18
+ date: 2011-12-14 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: yard