kindle_highlights_api 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d88880472a411d98de9d6c577f557a1f9a78c1b2
4
- data.tar.gz: 935b5303889bfb1ceeb38fbb134eef2ea7852288
3
+ metadata.gz: f4e7cb938f50e49b1b999361593a8b27dbb2b007
4
+ data.tar.gz: 7a14c53df9e9ae28e075f53452ca55ed3dcd5e24
5
5
  SHA512:
6
- metadata.gz: 68d8df2004c4ed1e6b975a27da214f5a334817c48eb3ff473850866295cfd2f620bf017b028e29ac93637a0c1328ffc829c08bbe6ed21830f44d10ac5ee2d706
7
- data.tar.gz: c2fdb6fb03d4b65b6010d3abbc8ac9659bc697923c09b3f76ae4b1070f950e39bd804e3dc855794cf8f00731a93e55fa120ccbf3a1c4150f41b882f77c9ad5ae
6
+ metadata.gz: c193931caa20708e278902e03e1ea2f2ed77df70a46d3197f7c29820c6b01871e30abddd41664176b89fc8da276827353ceda349f18379a6287bd793e8ccd6c7
7
+ data.tar.gz: d967ad43959d75dcb9bee2c634996abd68df00133bc1074447a1750514050c6919a46f0f34f72c5b9ac5ddfc8875984d49d6cad5187687cfe5e363f06ef3f594
data/README.md CHANGED
@@ -23,7 +23,7 @@ require 'kindle_highlights_api'
23
23
 
24
24
  fetcher = KindleHighlightsAPI::Fetcher.new("yourusername@gmail.com", "somepassword")
25
25
 
26
- books = fetcher.fetch
26
+ books = fetcher.fetch_all
27
27
 
28
28
  books.count # =>
29
29
  19
data/Rakefile CHANGED
@@ -4,8 +4,13 @@ require "rake/testtask"
4
4
  desc 'run all tests'
5
5
  Rake::TestTask.new(:test) do |t|
6
6
  t.libs << "test"
7
- t.test_files = FileList["test/**/*_test.rb"]
8
- t.verbose = true
7
+ t.test_files = FileList["test/**/*_test.rb"].exclude(/integration/)
8
+ end
9
+
10
+ desc 'run all integration tests'
11
+ Rake::TestTask.new(:integration) do |t|
12
+ t.libs << "test"
13
+ t.test_files = FileList["test/integration/*_test.rb"]
9
14
  end
10
15
 
11
16
  desc 'run kindle_highlights_api console'
@@ -45,8 +45,6 @@ module KindleHighlightsAPI
45
45
  a.user_agent_alias = 'Mac Safari'
46
46
  a.open_timeout = 10
47
47
  a.read_timeout = 10
48
- a.ssl_version = 'SSLv3'
49
- a.verify_mode = OpenSSL::SSL::VERIFY_NONE
50
48
  end
51
49
  end
52
50
  end
@@ -1,3 +1,3 @@
1
1
  module KindleHighlightsAPI
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -0,0 +1,26 @@
1
+ $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
2
+
3
+ require 'minitest/autorun'
4
+ require 'kindle_highlights_api'
5
+ require 'pry'
6
+
7
+ class FetcherIntegrationTest < MiniTest::Unit::TestCase
8
+ EMAIL = Base64.decode64("a2luZGxlLmhpZ2hsaWdodHMuYXBpQGdtYWlsLmNvbQ==\n")
9
+ PASS = Base64.decode64("aGlnaGxpZ2h0c2FwaTEyMw==\n")
10
+
11
+ def test_fetch_all
12
+ fetcher = KindleHighlightsAPI::Fetcher.new(EMAIL, PASS)
13
+ expected_titles = ["Les Misérables (English language)", "A Tale of Two Cities", "The Rámáyan of Válmíki"]
14
+
15
+ expected_highlights = ["The coffee-room had no other occupant, that forenoon, than the gentleman in brown.",
16
+ "A large cask of wine had been dropped and broken, in the street.",
17
+ "For, the time was to come, when the gaunt scarecrows of that region should have watched the lamplighter,",
18
+ "Then, as the darkness closed in, the daughter laid her head down on the hard ground close at the father's side, and watched him.",
19
+ "A woman of orderly and industrious appearance rose from her knees in a corner, with sufficient haste and trepidation to show that she was the person referred to."]
20
+
21
+ books = fetcher.fetch_all
22
+
23
+ assert_equal expected_titles, books.map(&:title)
24
+ assert_equal expected_highlights, books[1].highlights
25
+ end
26
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kindle_highlights_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gaurav Chande
@@ -87,6 +87,7 @@ files:
87
87
  - test/fixtures/html/kindle_home_page.html
88
88
  - test/fixtures/html/login_page.html
89
89
  - test/fixtures/html/signin_post_response.txt
90
+ - test/integration/fetcher_integration_test.rb
90
91
  - test/test_helper.rb
91
92
  homepage: https://github.com/gauravmc/kindle_highlights_api
92
93
  licenses:
@@ -125,5 +126,6 @@ test_files:
125
126
  - test/fixtures/html/kindle_home_page.html
126
127
  - test/fixtures/html/login_page.html
127
128
  - test/fixtures/html/signin_post_response.txt
129
+ - test/integration/fetcher_integration_test.rb
128
130
  - test/test_helper.rb
129
131
  has_rdoc: