klipbook 2.1.0 → 2.1.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: c23d7ac916e9878b64bdc8b0fdca59d0185cfe35
4
- data.tar.gz: 3e78a7b8f33b4b6f85c1f39470bd960b0293169a
3
+ metadata.gz: d3037bf853bd7bf7df5dbf9eaf706b5e2b2aca40
4
+ data.tar.gz: 17882844c725d1f2464b3320294252823b04d830
5
5
  SHA512:
6
- metadata.gz: 8c6a73d2e9e8c8f730a381edd767520a2341a4fbd28612a8ccee03b0d31fb36f5e72290adbcc2912e814a895c44bd443fec1a0d56c4b759b257c30bcb97946d0
7
- data.tar.gz: ed4cd0809d555814d5f4c83dfa8e3cafa19dbc9f9e3bcff6ab94841d7398d7831d1e37d734a8a98af72f6be9647a4ef140993c9ed7daa74990a1908686b1b9db
6
+ metadata.gz: 2b994c3ada7655bfacde42017cc9e94072912bb89c72dde3b7be1f1171fe22cbf6dcee61a28d99b536ade0e6308dfb292f4476601e414bf61f886311e34045f9
7
+ data.tar.gz: d7e099518000d5bdf4e95f9efff094aa92b15f959540f1adb1f690c6223a1a5e04c28543569dec54bdc0bae9beb72c151ec1de48504dd737c23826b2e725f9e3
data/CHANGELOG.txt CHANGED
@@ -1,3 +1,9 @@
1
+ == 2.1.0 / 2013-12-11
2
+
3
+ * Feature changes
4
+
5
+ * Reworked parameters for better clarity. tosjon and tohtml are now supported.
6
+
1
7
  == 2.0.0 / 2013-02-12
2
8
 
3
9
  * Feature changes
data/README.md CHANGED
@@ -110,7 +110,7 @@ them into a single JSON file.
110
110
  $ klipbook tojson -i "My Clippings.txt" -o books.json
111
111
  ```
112
112
 
113
- You can rerun collate on an existing JSON file to add new books. By default existing
113
+ You can rerun tojson on an existing JSON file to add new books. By default existing
114
114
  books in the JSON file will not be overwritten. This can be changed with the `--force`
115
115
  flag.
116
116
 
data/bin/klipbook CHANGED
@@ -72,7 +72,7 @@ rescue
72
72
  end
73
73
 
74
74
  def book_file(file_path)
75
- Klipbook::Collate::BookFile.from_json(raw_json_from_file(file_path))
75
+ Klipbook::ToJson::BookFile.from_json(raw_json_from_file(file_path))
76
76
  end
77
77
 
78
78
  #########
@@ -147,11 +147,12 @@ end
147
147
 
148
148
  opts = Slop.parse(help: true) do
149
149
  banner "Usage: klipbook <command> [options]\n\n" +
150
- "Klipbook pretty prints the clippings you've saved on your Kindle into JSON or pretty html.\n\n" +
150
+ "Klipbook writes the clippings you've saved on your Kindle into JSON or pretty html.\n\n" +
151
151
  CONFIG_HELP + "\n"
152
152
 
153
153
  on :v, :version, "Print the version." do
154
154
  puts "Klipbook version #{Klipbook::VERSION}"
155
+ exit 0
155
156
  end
156
157
 
157
158
  command "list" do
@@ -189,7 +190,7 @@ opts = Slop.parse(help: true) do
189
190
 
190
191
  books = fetch_books(opts)
191
192
 
192
- Klipbook::Commands::Collate.new(books, book_file(outfile_path)).call(outfile_path, opts[:force])
193
+ Klipbook::Commands::ToJson.new(books, book_file(outfile_path)).call(outfile_path, opts[:force])
193
194
  end
194
195
  end
195
196
 
@@ -211,7 +212,7 @@ opts = Slop.parse(help: true) do
211
212
 
212
213
  outdir_path = ensure_outdir(opts)
213
214
 
214
- Klipbook::Commands::PrettyPrint.new(books).call(outdir_path, opts[:force])
215
+ Klipbook::Commands::ToHtml.new(books).call(outdir_path, opts[:force])
215
216
  end
216
217
  end
217
218
 
@@ -7,6 +7,10 @@ $LOAD_PATH << File.expand_path('../../../lib', __FILE__)
7
7
  require 'klipbook'
8
8
  require 'fileutils'
9
9
 
10
+ Before do
11
+ @aruba_timeout_seconds = 40
12
+ end
13
+
10
14
  Before('@slow') do
11
15
  @aruba_io_wait_seconds = 40
12
16
  end
data/klipbook.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "klipbook"
8
- s.version = "2.1.0"
8
+ s.version = "2.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ray Grasso"]
12
- s.date = "2013-12-11"
12
+ s.date = "2013-12-12"
13
13
  s.description = "Process your Kindle clippings file to generate a nicely formatted compilation of the clippings of the books you've read"
14
14
  s.email = "ray.grasso@gmail.com"
15
15
  s.executables = ["klipbook"]
@@ -41,13 +41,10 @@ Gem::Specification.new do |s|
41
41
  "features/tojson.feature",
42
42
  "klipbook.gemspec",
43
43
  "lib/klipbook.rb",
44
- "lib/klipbook/collate/book_file.rb",
45
- "lib/klipbook/commands/collate.rb",
46
44
  "lib/klipbook/commands/list_books.rb",
47
- "lib/klipbook/commands/pretty_print.rb",
45
+ "lib/klipbook/commands/tohtml.rb",
46
+ "lib/klipbook/commands/tojson.rb",
48
47
  "lib/klipbook/config.rb",
49
- "lib/klipbook/pretty_print/html_book_summary.erb",
50
- "lib/klipbook/pretty_print/html_printer.rb",
51
48
  "lib/klipbook/sources/amazon_site/book_scraper.rb",
52
49
  "lib/klipbook/sources/amazon_site/site_scraper.rb",
53
50
  "lib/klipbook/sources/book.rb",
@@ -57,17 +54,20 @@ Gem::Specification.new do |s|
57
54
  "lib/klipbook/sources/kindle_device/entry_parser.rb",
58
55
  "lib/klipbook/sources/kindle_device/file.rb",
59
56
  "lib/klipbook/sources/kindle_device/file_parser.rb",
57
+ "lib/klipbook/tohtml/html_book_summary.erb",
58
+ "lib/klipbook/tohtml/html_printer.rb",
59
+ "lib/klipbook/tojson/book_file.rb",
60
60
  "lib/klipbook/util/blank.rb",
61
61
  "lib/klipbook/util/struct_to_json.rb",
62
62
  "lib/klipbook/version.rb",
63
- "spec/lib/klipbook/collate/book_file_spec.rb",
64
63
  "spec/lib/klipbook/commands/list_books_spec.rb",
65
- "spec/lib/klipbook/commands/pretty_print_spec.rb",
66
- "spec/lib/klipbook/pretty_print/html_printer_spec.rb",
64
+ "spec/lib/klipbook/commands/tohtml_spec.rb",
67
65
  "spec/lib/klipbook/sources/book_spec.rb",
68
66
  "spec/lib/klipbook/sources/kindle_device/entry_parser_spec.rb",
69
67
  "spec/lib/klipbook/sources/kindle_device/file_parser_spec.rb",
70
68
  "spec/lib/klipbook/sources/kindle_device/file_spec.rb",
69
+ "spec/lib/klipbook/tohtml/html_printer_spec.rb",
70
+ "spec/lib/klipbook/tojson/book_file_spec.rb",
71
71
  "spec/spec_helper.rb",
72
72
  "spec/support/rspec2.rb",
73
73
  "spec/support/with_rr.rb"
@@ -1,6 +1,6 @@
1
1
  module Klipbook::Commands
2
- class PrettyPrint
3
- def initialize(books, pretty_printer=Klipbook::PrettyPrint::HtmlPrinter.new)
2
+ class ToHtml
3
+ def initialize(books, pretty_printer=Klipbook::ToHtml::HtmlPrinter.new)
4
4
  @books = books
5
5
  @pretty_printer = pretty_printer
6
6
  end
@@ -1,5 +1,5 @@
1
1
  module Klipbook::Commands
2
- class Collate
2
+ class ToJson
3
3
  def initialize(books, book_file)
4
4
  @books = books
5
5
  @book_file = book_file
@@ -1,6 +1,6 @@
1
1
  require 'erb'
2
2
 
3
- module Klipbook::PrettyPrint
3
+ module Klipbook::ToHtml
4
4
  class HtmlPrinter
5
5
  def initialize(message_stream=$stdout)
6
6
  @message_stream = message_stream
@@ -1,7 +1,7 @@
1
1
  require 'json'
2
2
  require 'rainbow'
3
3
 
4
- module Klipbook::Collate
4
+ module Klipbook::ToJson
5
5
  class BookFile
6
6
  attr_reader :books
7
7
 
@@ -1,3 +1,3 @@
1
1
  module Klipbook
2
- VERSION = '2.1.0'
2
+ VERSION = '2.1.1'
3
3
  end
data/lib/klipbook.rb CHANGED
@@ -3,9 +3,9 @@ require 'klipbook/util/blank'
3
3
  require 'klipbook/util/struct_to_json'
4
4
  require 'klipbook/version'
5
5
 
6
- require 'klipbook/commands/collate'
6
+ require 'klipbook/commands/tojson'
7
7
  require 'klipbook/commands/list_books'
8
- require 'klipbook/commands/pretty_print'
8
+ require 'klipbook/commands/tohtml'
9
9
 
10
10
  require 'klipbook/sources/book'
11
11
  require 'klipbook/sources/clipping'
@@ -21,5 +21,5 @@ require 'klipbook/sources/amazon_site/book_scraper'
21
21
 
22
22
  require 'klipbook/config'
23
23
 
24
- require 'klipbook/pretty_print/html_printer'
25
- require 'klipbook/collate/book_file'
24
+ require 'klipbook/tohtml/html_printer'
25
+ require 'klipbook/tojson/book_file'
@@ -1,8 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Klipbook::Commands::PrettyPrint do
3
+ describe Klipbook::Commands::ToHtml do
4
4
 
5
- let (:it) { Klipbook::Commands::PrettyPrint.new(books, pretty_printer) }
5
+ let (:it) { Klipbook::Commands::ToHtml.new(books, pretty_printer) }
6
6
 
7
7
  let (:pretty_printer) do
8
8
  Object.new.tap do |fake_printer|
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  # This is more of an integration test but what the heck
4
4
  # it can live in here for now
5
5
 
6
- describe Klipbook::PrettyPrint::HtmlPrinter do
6
+ describe Klipbook::ToHtml::HtmlPrinter do
7
7
 
8
8
  before(:all) do
9
9
  @output_dir = Dir.mktmpdir
@@ -29,7 +29,7 @@ describe Klipbook::PrettyPrint::HtmlPrinter do
29
29
 
30
30
  describe '#print_to_file' do
31
31
 
32
- subject { Klipbook::PrettyPrint::HtmlPrinter.new(message_stream).print_to_file(book, @output_dir, force) }
32
+ subject { Klipbook::ToHtml::HtmlPrinter.new(message_stream).print_to_file(book, @output_dir, force) }
33
33
 
34
34
  let(:force) { false }
35
35
 
@@ -1,10 +1,10 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Klipbook::Collate::BookFile do
3
+ describe Klipbook::ToJson::BookFile do
4
4
 
5
5
  describe '.from_json' do
6
6
 
7
- subject { Klipbook::Collate::BookFile.from_json(json) }
7
+ subject { Klipbook::ToJson::BookFile.from_json(json) }
8
8
 
9
9
  context 'with empty json' do
10
10
 
@@ -32,7 +32,7 @@ describe Klipbook::Collate::BookFile do
32
32
  b.author = "Author two"
33
33
  end
34
34
  ]
35
- Klipbook::Collate::BookFile.new(books)
35
+ Klipbook::ToJson::BookFile.new(books)
36
36
  end
37
37
 
38
38
  it "adds any books that don't already exist" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: klipbook
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ray Grasso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-11 00:00:00.000000000 Z
11
+ date: 2013-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slop
@@ -225,13 +225,10 @@ files:
225
225
  - features/tojson.feature
226
226
  - klipbook.gemspec
227
227
  - lib/klipbook.rb
228
- - lib/klipbook/collate/book_file.rb
229
- - lib/klipbook/commands/collate.rb
230
228
  - lib/klipbook/commands/list_books.rb
231
- - lib/klipbook/commands/pretty_print.rb
229
+ - lib/klipbook/commands/tohtml.rb
230
+ - lib/klipbook/commands/tojson.rb
232
231
  - lib/klipbook/config.rb
233
- - lib/klipbook/pretty_print/html_book_summary.erb
234
- - lib/klipbook/pretty_print/html_printer.rb
235
232
  - lib/klipbook/sources/amazon_site/book_scraper.rb
236
233
  - lib/klipbook/sources/amazon_site/site_scraper.rb
237
234
  - lib/klipbook/sources/book.rb
@@ -241,17 +238,20 @@ files:
241
238
  - lib/klipbook/sources/kindle_device/entry_parser.rb
242
239
  - lib/klipbook/sources/kindle_device/file.rb
243
240
  - lib/klipbook/sources/kindle_device/file_parser.rb
241
+ - lib/klipbook/tohtml/html_book_summary.erb
242
+ - lib/klipbook/tohtml/html_printer.rb
243
+ - lib/klipbook/tojson/book_file.rb
244
244
  - lib/klipbook/util/blank.rb
245
245
  - lib/klipbook/util/struct_to_json.rb
246
246
  - lib/klipbook/version.rb
247
- - spec/lib/klipbook/collate/book_file_spec.rb
248
247
  - spec/lib/klipbook/commands/list_books_spec.rb
249
- - spec/lib/klipbook/commands/pretty_print_spec.rb
250
- - spec/lib/klipbook/pretty_print/html_printer_spec.rb
248
+ - spec/lib/klipbook/commands/tohtml_spec.rb
251
249
  - spec/lib/klipbook/sources/book_spec.rb
252
250
  - spec/lib/klipbook/sources/kindle_device/entry_parser_spec.rb
253
251
  - spec/lib/klipbook/sources/kindle_device/file_parser_spec.rb
254
252
  - spec/lib/klipbook/sources/kindle_device/file_spec.rb
253
+ - spec/lib/klipbook/tohtml/html_printer_spec.rb
254
+ - spec/lib/klipbook/tojson/book_file_spec.rb
255
255
  - spec/spec_helper.rb
256
256
  - spec/support/rspec2.rb
257
257
  - spec/support/with_rr.rb