pbl 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,6 @@
1
1
  # https://github.com/travis-ci/travis-ci/wiki/.travis.yml-options
2
2
  language: ruby
3
3
  rvm:
4
- - 1.9.2
5
4
  - 1.9.3
6
5
  - 2.0.0
7
6
 
@@ -10,7 +9,6 @@ before_install:
10
9
 
11
10
  matrie:
12
11
  allow_failures:
13
- - rvm: 1.9.2
14
12
  - rvm: 1.9.3
15
13
  - rvm: 2.0.0
16
14
 
@@ -49,10 +49,15 @@ module Pbl
49
49
  end
50
50
 
51
51
  def run
52
- abort "Usage: pbl TAG" if @argv.empty?
53
52
  page unless $test_env
54
- @pinboard.posts(:tag => @argv.join(',')).each do |post|
55
- puts "[%s] %s %s" % [post[:time].strftime("%Y/%m/%d").cyan, post[:description].cut, post[0].green]
53
+ if @argv.empty?
54
+ @pinboard.posts(:results => 150).each do |post|
55
+ puts "[%s] %s %s" % [post[:time].strftime("%Y/%m/%d").cyan, post[:description].cut, post[0].green]
56
+ end
57
+ else
58
+ @pinboard.posts(:tag => @argv.join(',')).each do |post|
59
+ puts "[%s] %s %s" % [post[:time].strftime("%Y/%m/%d").cyan, post[:description].cut, post[0].green]
60
+ end
56
61
  end
57
62
  end
58
63
  end
@@ -1,3 +1,3 @@
1
1
  module Pbl
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -51,10 +51,11 @@ describe Pbl::CLI do
51
51
  @subject.instance_variable_set(:@argv, [])
52
52
  end
53
53
 
54
- it "should raise SystemExit error" do
55
- expect {
54
+ it "should invoke $stdout.puts at least once" do
55
+ VCR.use_cassette 'pinboard_empty_requests' do
56
+ $stdout.should_receive(:puts).at_least(:once)
56
57
  @subject.run
57
- }.to raise_error SystemExit
58
+ end
58
59
  end
59
60
  end
60
61
 
@@ -0,0 +1,34 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://foo:bar@api.pinboard.in/v1/posts/all?results=150
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ""
9
+ headers: {}
10
+
11
+ response:
12
+ status:
13
+ code: 200
14
+ message: OK
15
+ headers:
16
+ Date:
17
+ - Tue, 29 Oct 2013 02:54:19 GMT
18
+ Server:
19
+ - Apache/2.2.22 (Ubuntu)
20
+ Vary:
21
+ - Accept-Encoding
22
+ Content-Length:
23
+ - "462"
24
+ Content-Type:
25
+ - text/xml; charset=utf-8
26
+ body:
27
+ encoding: ASCII-8BIT
28
+ string: "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n\
29
+ <posts user=\"glidenote\">\n\
30
+ <post href=\"http://www.slideshare.net/winebarrel/gitroute53-25545015\" time=\"2013-10-29T00:32:30Z\" description=\"Git\xE3\x82\x92\xE4\xBD\xBF\xE3\x81\xA3\xE3\x81\x9FRoute53\xE3\x81\xAE\xE7\xAE\xA1\xE7\x90\x86\" extended=\"via \xE3\x81\xAF\xE3\x81\xA6\xE3\x81\xAA\xE3\x83\x96\xE3\x83\x83\xE3\x82\xAF\xE3\x83\x9E\xE3\x83\xBC\xE3\x82\xAF - \xE4\xBA\xBA\xE6\xB0\x97\xE3\x82\xA8\xE3\x83\xB3\xE3\x83\x88\xE3\x83\xAA\xE3\x83\xBC http://b.hatena.ne.jp/hotentry\" tag=\"IFTTT Feedly Recently Read Saved for Later\" hash=\"1055f3645fff581d0ba85eda2f1dc37e\" meta=\"717b38dc9f969cee7c2256e69971d073\" shared=\"no\" /></posts>\n\
31
+ \t"
32
+ http_version:
33
+ recorded_at: Tue, 29 Oct 2013 02:54:20 GMT
34
+ recorded_with: VCR 2.6.0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pbl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-31 00:00:00.000000000 Z
12
+ date: 2013-10-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pinboard
@@ -211,6 +211,7 @@ files:
211
211
  - spec/pbl/cli_spec.rb
212
212
  - spec/spec.opts
213
213
  - spec/spec_helper.rb
214
+ - spec/vcr_cassettes/pinboard_empty_requests.yml
214
215
  - spec/vcr_cassettes/pinboard_requests.yml
215
216
  homepage: https://github.com/glidenote/pbl
216
217
  licenses: []
@@ -240,4 +241,5 @@ test_files:
240
241
  - spec/pbl/cli_spec.rb
241
242
  - spec/spec.opts
242
243
  - spec/spec_helper.rb
244
+ - spec/vcr_cassettes/pinboard_empty_requests.yml
243
245
  - spec/vcr_cassettes/pinboard_requests.yml