instapaper 0.3.0 → 1.0.0.pre2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.md +1 -1
- data/README.md +62 -38
- data/instapaper.gemspec +21 -30
- data/lib/instapaper.rb +0 -25
- data/lib/instapaper/api.rb +15 -0
- data/lib/instapaper/{client/account.rb → api/accounts.rb} +5 -5
- data/lib/instapaper/api/bookmarks.rb +77 -0
- data/lib/instapaper/{client/folder.rb → api/folders.rb} +12 -11
- data/lib/instapaper/api/highlights.rb +33 -0
- data/lib/instapaper/api/oauth.rb +17 -0
- data/lib/instapaper/bookmark.rb +21 -0
- data/lib/instapaper/bookmark_list.rb +20 -0
- data/lib/instapaper/client.rb +40 -28
- data/lib/instapaper/credentials.rb +12 -0
- data/lib/instapaper/error.rb +78 -0
- data/lib/instapaper/folder.rb +17 -0
- data/lib/instapaper/highlight.rb +16 -0
- data/lib/instapaper/http/headers.rb +45 -0
- data/lib/instapaper/http/qline_parser.rb +9 -0
- data/lib/instapaper/http/request.rb +84 -0
- data/lib/instapaper/http/utils.rb +67 -0
- data/lib/instapaper/user.rb +14 -0
- data/lib/instapaper/version.rb +1 -1
- metadata +63 -209
- data/.gemtest +0 -0
- data/.gitignore +0 -11
- data/.rspec +0 -3
- data/.travis.yml +0 -8
- data/.yardopts +0 -3
- data/Gemfile +0 -7
- data/Rakefile +0 -13
- data/lib/faraday/response/raise_http_1xxx.rb +0 -65
- data/lib/instapaper/authentication.rb +0 -32
- data/lib/instapaper/client/bookmark.rb +0 -81
- data/lib/instapaper/client/user.rb +0 -19
- data/lib/instapaper/configuration.rb +0 -88
- data/lib/instapaper/connection.rb +0 -35
- data/lib/instapaper/request.rb +0 -22
- data/spec/faraday/response_spec.rb +0 -22
- data/spec/fixtures/access_token.qline +0 -1
- data/spec/fixtures/bookmarks_add.json +0 -1
- data/spec/fixtures/bookmarks_archive.json +0 -1
- data/spec/fixtures/bookmarks_get_text.txt +0 -299
- data/spec/fixtures/bookmarks_list.json +0 -5
- data/spec/fixtures/bookmarks_move.json +0 -1
- data/spec/fixtures/bookmarks_star.json +0 -1
- data/spec/fixtures/bookmarks_unarchive.json +0 -1
- data/spec/fixtures/bookmarks_unstar.json +0 -1
- data/spec/fixtures/bookmarks_update_read_progress.json +0 -1
- data/spec/fixtures/folders_add.json +0 -1
- data/spec/fixtures/folders_delete.json +0 -1
- data/spec/fixtures/folders_list.json +0 -1
- data/spec/fixtures/folders_set_order.json +0 -1
- data/spec/fixtures/invalid_credentials.qline +0 -1
- data/spec/fixtures/verify_credentials.json +0 -1
- data/spec/instapaper/client/account_spec.rb +0 -27
- data/spec/instapaper/client/bookmark_spec.rb +0 -234
- data/spec/instapaper/client/folder_spec.rb +0 -89
- data/spec/instapaper/client/user_spec.rb +0 -36
- data/spec/instapaper/client_spec.rb +0 -65
- data/spec/instapaper_spec.rb +0 -85
- data/spec/spec_helper.rb +0 -52
data/spec/instapaper_spec.rb
DELETED
@@ -1,85 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Instapaper do
|
4
|
-
after do
|
5
|
-
Instapaper.reset
|
6
|
-
end
|
7
|
-
|
8
|
-
describe '.respond_to?' do
|
9
|
-
it 'takes an optional include private argument' do
|
10
|
-
Instapaper.respond_to?(:client, true).should be_true
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
describe ".client" do
|
15
|
-
it "should be a Instapaper::Client" do
|
16
|
-
Instapaper.client.should be_a Instapaper::Client
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
describe ".adapter" do
|
21
|
-
it "should return the default adapter" do
|
22
|
-
Instapaper.adapter.should == Instapaper::Configuration::DEFAULT_ADAPTER
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
describe ".adapter=" do
|
27
|
-
it "should set the adapter" do
|
28
|
-
Instapaper.adapter = :typhoeus
|
29
|
-
Instapaper.adapter.should == :typhoeus
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
describe ".endpoint" do
|
34
|
-
it "should return the default endpoint" do
|
35
|
-
Instapaper.endpoint.should == Instapaper::Configuration::DEFAULT_ENDPOINT
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
describe ".endpoint=" do
|
40
|
-
it "should set the endpoint" do
|
41
|
-
Instapaper.endpoint = 'http://tumblr.com/'
|
42
|
-
Instapaper.endpoint.should == 'http://tumblr.com/'
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
describe ".user_agent" do
|
47
|
-
it "should return the default user agent" do
|
48
|
-
Instapaper.user_agent.should == Instapaper::Configuration::DEFAULT_USER_AGENT
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
describe ".user_agent=" do
|
53
|
-
it "should set the user_agent" do
|
54
|
-
Instapaper.user_agent = 'Custom User Agent'
|
55
|
-
Instapaper.user_agent.should == 'Custom User Agent'
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
describe ".version" do
|
60
|
-
it "should return the default version" do
|
61
|
-
Instapaper.version.should == Instapaper::Configuration::DEFAULT_VERSION
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
describe ".version=" do
|
66
|
-
it "should set the user_agent" do
|
67
|
-
Instapaper.version = '2'
|
68
|
-
Instapaper.version.should == '2'
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
describe ".configure" do
|
73
|
-
|
74
|
-
Instapaper::Configuration::VALID_OPTIONS_KEYS.each do |key|
|
75
|
-
|
76
|
-
it "should set the #{key}" do
|
77
|
-
Instapaper.configure do |config|
|
78
|
-
config.send("#{key}=", key)
|
79
|
-
Instapaper.send(key).should == key
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
unless ENV['CI']
|
2
|
-
require 'simplecov'
|
3
|
-
SimpleCov.start do
|
4
|
-
add_filter '.bundle'
|
5
|
-
add_group 'Instapaper', 'lib/instapaper'
|
6
|
-
add_group 'Specs', 'spec'
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
require 'instapaper'
|
11
|
-
require 'rspec'
|
12
|
-
require 'webmock/rspec'
|
13
|
-
|
14
|
-
def a_delete(path)
|
15
|
-
a_request(:delete, Instapaper.endpoint_with_prefix + path)
|
16
|
-
end
|
17
|
-
|
18
|
-
def a_get(path)
|
19
|
-
a_request(:get, Instapaper.endpoint_with_prefix + path)
|
20
|
-
end
|
21
|
-
|
22
|
-
def a_post(path)
|
23
|
-
a_request(:post, Instapaper.endpoint_with_prefix + path)
|
24
|
-
end
|
25
|
-
|
26
|
-
def a_put(path)
|
27
|
-
a_request(:put, Instapaper.endpoint_with_prefix + path)
|
28
|
-
end
|
29
|
-
|
30
|
-
def stub_delete(path)
|
31
|
-
stub_request(:delete, Instapaper.endpoint_with_prefix + path)
|
32
|
-
end
|
33
|
-
|
34
|
-
def stub_get(path)
|
35
|
-
stub_request(:get, Instapaper.endpoint_with_prefix + path)
|
36
|
-
end
|
37
|
-
|
38
|
-
def stub_post(path)
|
39
|
-
stub_request(:post, Instapaper.endpoint_with_prefix + path)
|
40
|
-
end
|
41
|
-
|
42
|
-
def stub_put(path)
|
43
|
-
stub_request(:put, Instapaper.endpoint_with_prefix + path)
|
44
|
-
end
|
45
|
-
|
46
|
-
def fixture_path
|
47
|
-
File.expand_path("../fixtures", __FILE__)
|
48
|
-
end
|
49
|
-
|
50
|
-
def fixture(file)
|
51
|
-
File.new(fixture_path + '/' + file)
|
52
|
-
end
|