alexandria-book-collection-manager 0.7.3 → 0.7.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +28 -25
  3. data/.rubocop_todo.yml +87 -67
  4. data/CHANGELOG.md +12 -1
  5. data/Gemfile +4 -3
  6. data/README.md +16 -6
  7. data/Rakefile +71 -72
  8. data/alexandria-book-collection-manager.gemspec +44 -44
  9. data/bin/alexandria +12 -12
  10. data/lib/alexandria.rb +22 -22
  11. data/lib/alexandria/about.rb +50 -50
  12. data/lib/alexandria/book_providers.rb +50 -50
  13. data/lib/alexandria/book_providers/adlibris.rb +28 -44
  14. data/lib/alexandria/book_providers/amazon_aws.rb +64 -64
  15. data/lib/alexandria/book_providers/amazon_ecs_util.rb +52 -78
  16. data/lib/alexandria/book_providers/barnes_and_noble.rb +34 -34
  17. data/lib/alexandria/book_providers/douban.rb +21 -37
  18. data/lib/alexandria/book_providers/proxis.rb +24 -24
  19. data/lib/alexandria/book_providers/pseudomarc.rb +19 -19
  20. data/lib/alexandria/book_providers/renaud.rb +44 -57
  21. data/lib/alexandria/book_providers/siciliano.rb +39 -39
  22. data/lib/alexandria/book_providers/thalia.rb +33 -33
  23. data/lib/alexandria/book_providers/web.rb +5 -5
  24. data/lib/alexandria/book_providers/worldcat.rb +44 -69
  25. data/lib/alexandria/book_providers/z3950.rb +94 -109
  26. data/lib/alexandria/config.rb +1 -1
  27. data/lib/alexandria/console.rb +3 -3
  28. data/lib/alexandria/export_format.rb +8 -8
  29. data/lib/alexandria/export_library.rb +112 -113
  30. data/lib/alexandria/import_library.rb +45 -45
  31. data/lib/alexandria/import_library_csv.rb +30 -30
  32. data/lib/alexandria/library_collection.rb +4 -4
  33. data/lib/alexandria/library_sort_order.rb +1 -1
  34. data/lib/alexandria/library_store.rb +14 -14
  35. data/lib/alexandria/logging.rb +5 -5
  36. data/lib/alexandria/models/book.rb +1 -1
  37. data/lib/alexandria/models/library.rb +36 -36
  38. data/lib/alexandria/net.rb +5 -5
  39. data/lib/alexandria/preferences.rb +32 -32
  40. data/lib/alexandria/scanners/{cuecat.rb → cue_cat.rb} +13 -13
  41. data/lib/alexandria/scanners/keyboard.rb +5 -5
  42. data/lib/alexandria/smart_library.rb +53 -53
  43. data/lib/alexandria/ui.rb +15 -15
  44. data/lib/alexandria/ui/{dialogs/about_dialog.rb → about_dialog.rb} +1 -1
  45. data/lib/alexandria/ui/{dialogs/acquire_dialog.rb → acquire_dialog.rb} +66 -65
  46. data/lib/alexandria/ui/{dialogs/alert_dialog.rb → alert_dialog.rb} +1 -16
  47. data/lib/alexandria/ui/{dialogs/bad_isbns_dialog.rb → bad_isbns_dialog.rb} +0 -0
  48. data/lib/alexandria/ui/{dialogs/barcode_animation.rb → barcode_animation.rb} +7 -7
  49. data/lib/alexandria/ui/{dialogs/book_properties_dialog.rb → book_properties_dialog.rb} +25 -37
  50. data/lib/alexandria/ui/{dialogs/book_properties_dialog_base.rb → book_properties_dialog_base.rb} +38 -37
  51. data/lib/alexandria/ui/builder_base.rb +1 -1
  52. data/lib/alexandria/ui/callbacks.rb +95 -91
  53. data/lib/alexandria/ui/completion_models.rb +7 -21
  54. data/lib/alexandria/ui/confirm_erase_dialog.rb +33 -0
  55. data/lib/alexandria/ui/conflict_while_copying_dialog.rb +34 -0
  56. data/lib/alexandria/ui/dndable.rb +7 -7
  57. data/lib/alexandria/ui/error_dialog.rb +25 -0
  58. data/lib/alexandria/ui/{dialogs/export_dialog.rb → export_dialog.rb} +22 -42
  59. data/lib/alexandria/ui/icons.rb +6 -6
  60. data/lib/alexandria/ui/iconview.rb +7 -7
  61. data/lib/alexandria/ui/iconview_tooltips.rb +6 -6
  62. data/lib/alexandria/ui/{dialogs/import_dialog.rb → import_dialog.rb} +14 -32
  63. data/lib/alexandria/ui/init.rb +16 -29
  64. data/lib/alexandria/ui/{dialogs/keep_bad_isbn_dialog.rb → keep_bad_isbn_dialog.rb} +6 -4
  65. data/lib/alexandria/ui/libraries_combo.rb +7 -7
  66. data/lib/alexandria/ui/listview.rb +40 -40
  67. data/lib/alexandria/ui/main_app.rb +22 -24
  68. data/lib/alexandria/ui/misc_dialogs.rb +10 -0
  69. data/lib/alexandria/ui/multi_drag_treeview.rb +4 -4
  70. data/lib/alexandria/ui/{dialogs/new_book_dialog.rb → new_book_dialog.rb} +46 -45
  71. data/lib/alexandria/ui/{dialogs/new_book_dialog_manual.rb → new_book_dialog_manual.rb} +20 -19
  72. data/lib/alexandria/ui/new_provider_dialog.rb +99 -0
  73. data/lib/alexandria/ui/{dialogs/new_smart_library_dialog.rb → new_smart_library_dialog.rb} +4 -4
  74. data/lib/alexandria/ui/{dialogs/preferences_dialog.rb → preferences_dialog.rb} +44 -235
  75. data/lib/alexandria/ui/provider_preferences_base_dialog.rb +90 -0
  76. data/lib/alexandria/ui/provider_preferences_dialog.rb +35 -0
  77. data/lib/alexandria/ui/{dialogs/misc_dialogs.rb → really_delete_dialog.rb} +6 -27
  78. data/lib/alexandria/ui/{sidepane.rb → sidepane_manager.rb} +27 -25
  79. data/lib/alexandria/ui/skip_entry_dialog.rb +32 -0
  80. data/lib/alexandria/ui/{dialogs/smart_library_properties_dialog.rb → smart_library_properties_dialog.rb} +2 -2
  81. data/lib/alexandria/ui/{dialogs/smart_library_properties_dialog_base.rb → smart_library_properties_dialog_base.rb} +30 -30
  82. data/lib/alexandria/ui/sound.rb +8 -8
  83. data/lib/alexandria/ui/ui_manager.rb +136 -135
  84. data/lib/alexandria/version.rb +4 -19
  85. data/lib/alexandria/web_themes.rb +8 -8
  86. data/po/cs.po +97 -97
  87. data/po/cy.po +97 -97
  88. data/po/de.po +97 -97
  89. data/po/el.po +97 -97
  90. data/po/es.po +97 -97
  91. data/po/fr.po +97 -97
  92. data/po/ga.po +97 -97
  93. data/po/gl.po +97 -97
  94. data/po/it.po +97 -97
  95. data/po/ja.po +97 -97
  96. data/po/mk.po +97 -97
  97. data/po/nb.po +97 -97
  98. data/po/nl.po +97 -97
  99. data/po/pl.po +97 -97
  100. data/po/pt.po +97 -97
  101. data/po/pt_BR.po +97 -97
  102. data/po/ru.po +97 -97
  103. data/po/sk.po +97 -97
  104. data/po/sv.po +97 -97
  105. data/po/uk.po +97 -97
  106. data/po/zh_TW.po +97 -97
  107. data/schemas/alexandria.schemas +24 -2
  108. data/spec/alexandria/book_providers_spec.rb +65 -82
  109. data/spec/alexandria/book_spec.rb +12 -10
  110. data/spec/alexandria/console_spec.rb +9 -9
  111. data/spec/alexandria/export_library_spec.rb +31 -31
  112. data/spec/alexandria/library_spec.rb +86 -86
  113. data/spec/alexandria/library_store_spec.rb +8 -8
  114. data/spec/alexandria/preferences_spec.rb +18 -17
  115. data/spec/alexandria/scanners/cue_cat_spec.rb +52 -0
  116. data/spec/alexandria/smart_library_spec.rb +15 -15
  117. data/spec/alexandria/ui/about_dialog_spec.rb +14 -0
  118. data/spec/alexandria/ui/acquire_dialog_spec.rb +14 -0
  119. data/spec/alexandria/ui/alert_dialog_spec.rb +16 -0
  120. data/spec/alexandria/ui/bad_isbns_dialog_spec.rb +14 -0
  121. data/spec/alexandria/ui/book_properties_dialog_spec.rb +17 -0
  122. data/spec/alexandria/ui/confirm_erase_dialog_spec.rb +14 -0
  123. data/spec/alexandria/ui/conflict_while_copying_dialog_spec.rb +16 -0
  124. data/spec/alexandria/ui/error_dialog_spec.rb +14 -0
  125. data/spec/alexandria/ui/export_dialog_spec.rb +15 -0
  126. data/spec/alexandria/ui/iconview_spec.rb +7 -21
  127. data/spec/alexandria/ui/import_dialog_spec.rb +14 -0
  128. data/spec/alexandria/ui/keep_bad_isbn_dialog_spec.rb +17 -0
  129. data/spec/alexandria/ui/main_app_spec.rb +6 -6
  130. data/spec/alexandria/ui/new_book_dialog_manual_spec.rb +15 -0
  131. data/spec/alexandria/ui/{dialogs/new_book_dialog_spec.rb → new_book_dialog_spec.rb} +4 -4
  132. data/spec/alexandria/ui/new_provider_dialog_spec.rb +14 -0
  133. data/spec/alexandria/ui/new_smart_library_dialog_spec.rb +14 -0
  134. data/spec/alexandria/ui/preferences_dialog_spec.rb +14 -0
  135. data/spec/alexandria/ui/provider_preferences_dialog_spec.rb +19 -0
  136. data/spec/alexandria/ui/really_delete_dialog_spec.rb +15 -0
  137. data/spec/alexandria/ui/sidepane_manager_spec.rb +15 -0
  138. data/spec/alexandria/ui/skip_entry_dialog_spec.rb +14 -0
  139. data/spec/alexandria/ui/smart_library_properties_dialog_spec.rb +18 -0
  140. data/spec/alexandria/ui/sound_spec.rb +2 -2
  141. data/spec/alexandria/ui/ui_manager_spec.rb +6 -20
  142. data/spec/alexandria/ui/ui_utilities_spec.rb +9 -9
  143. data/spec/alexandria/utilities_spec.rb +6 -6
  144. data/spec/end_to_end/basic_run_spec.rb +24 -36
  145. data/spec/spec_helper.rb +9 -9
  146. data/tasks/dogtail.rake +1 -1
  147. data/tasks/setup.rb +2 -2
  148. data/tasks/spec.rake +11 -11
  149. data/util/rake/fileinstall.rb +25 -25
  150. data/util/rake/gettextgenerate.rb +7 -7
  151. data/util/rake/omfgenerate.rb +7 -7
  152. metadata +59 -33
  153. data/spec/alexandria/scanners/cuecat_spec.rb +0 -67
  154. data/spec/alexandria/ui/dialogs_spec.rb +0 -162
  155. data/spec/alexandria/ui/sidepane_spec.rb +0 -29
@@ -26,9 +26,9 @@
26
26
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27
27
  #++
28
28
 
29
- require 'fileutils'
30
- require 'pathname'
31
- require 'rake/tasklib'
29
+ require "fileutils"
30
+ require "pathname"
31
+ require "rake/tasklib"
32
32
 
33
33
  class OmfGenerateTask < Rake::TaskLib
34
34
  def initialize(projectname)
@@ -39,7 +39,7 @@ class OmfGenerateTask < Rake::TaskLib
39
39
  end
40
40
 
41
41
  def make_task
42
- desc 'Generate Open Metadata Framework files'
42
+ desc "Generate Open Metadata Framework files"
43
43
  task omf: @generated_files
44
44
 
45
45
  @generated_files.each { |gen| CLOBBER << gen } if CLOBBER
@@ -55,7 +55,7 @@ class OmfGenerateTask < Rake::TaskLib
55
55
  end
56
56
 
57
57
  def omf_files
58
- in_files.map { |f| f.sub(/.omf.in/, '.omf') }
58
+ in_files.map { |f| f.sub(/.omf.in/, ".omf") }
59
59
  end
60
60
 
61
61
  attr_writer :gnome_helpfiles_dir
@@ -64,13 +64,13 @@ class OmfGenerateTask < Rake::TaskLib
64
64
  @source_dir = src_dir
65
65
  @source_files_glob = file_glob
66
66
 
67
- rule '.omf' => ['.omf.in'] do |t|
67
+ rule ".omf" => [".omf.in"] do |t|
68
68
  path = File.join(@gnome_helpfiles_dir, @projectname,
69
69
  locale_for(t.name), "#{@projectname}.xml")
70
70
  data = IO.read(t.source)
71
71
  data.sub!(/PATH_TO_DOC_FILE/, path)
72
72
  puts "Generating #{t.name}..."
73
- File.open(t.name, 'w') { |io| io.puts data }
73
+ File.open(t.name, "w") { |io| io.puts data }
74
74
  end
75
75
  omf_files.each { |o| @generated_files << o }
76
76
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alexandria-book-collection-manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander McCormmach
@@ -28,7 +28,7 @@ authors:
28
28
  autorequire:
29
29
  bindir: bin
30
30
  cert_chain: []
31
- date: 2019-02-27 00:00:00.000000000 Z
31
+ date: 2019-10-24 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: gettext
@@ -50,28 +50,28 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: 3.3.0
53
+ version: 3.4.1
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: 3.3.0
60
+ version: 3.4.1
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: gtk3
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: 3.3.0
67
+ version: 3.4.1
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: 3.3.0
74
+ version: 3.4.1
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: hpricot
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -176,14 +176,14 @@ dependencies:
176
176
  requirements:
177
177
  - - "~>"
178
178
  - !ruby/object:Gem::Version
179
- version: '12.0'
179
+ version: '13.0'
180
180
  type: :development
181
181
  prerelease: false
182
182
  version_requirements: !ruby/object:Gem::Requirement
183
183
  requirements:
184
184
  - - "~>"
185
185
  - !ruby/object:Gem::Version
186
- version: '12.0'
186
+ version: '13.0'
187
187
  - !ruby/object:Gem::Dependency
188
188
  name: rspec
189
189
  requirement: !ruby/object:Gem::Requirement
@@ -268,41 +268,49 @@ files:
268
268
  - lib/alexandria/net.rb
269
269
  - lib/alexandria/preferences.rb
270
270
  - lib/alexandria/scanners.rb
271
- - lib/alexandria/scanners/cuecat.rb
271
+ - lib/alexandria/scanners/cue_cat.rb
272
272
  - lib/alexandria/scanners/keyboard.rb
273
273
  - lib/alexandria/smart_library.rb
274
274
  - lib/alexandria/ui.rb
275
+ - lib/alexandria/ui/about_dialog.rb
276
+ - lib/alexandria/ui/acquire_dialog.rb
277
+ - lib/alexandria/ui/alert_dialog.rb
278
+ - lib/alexandria/ui/bad_isbns_dialog.rb
279
+ - lib/alexandria/ui/barcode_animation.rb
280
+ - lib/alexandria/ui/book_properties_dialog.rb
281
+ - lib/alexandria/ui/book_properties_dialog_base.rb
275
282
  - lib/alexandria/ui/builder_base.rb
276
283
  - lib/alexandria/ui/callbacks.rb
277
284
  - lib/alexandria/ui/columns.rb
278
285
  - lib/alexandria/ui/completion_models.rb
279
- - lib/alexandria/ui/dialogs/about_dialog.rb
280
- - lib/alexandria/ui/dialogs/acquire_dialog.rb
281
- - lib/alexandria/ui/dialogs/alert_dialog.rb
282
- - lib/alexandria/ui/dialogs/bad_isbns_dialog.rb
283
- - lib/alexandria/ui/dialogs/barcode_animation.rb
284
- - lib/alexandria/ui/dialogs/book_properties_dialog.rb
285
- - lib/alexandria/ui/dialogs/book_properties_dialog_base.rb
286
- - lib/alexandria/ui/dialogs/export_dialog.rb
287
- - lib/alexandria/ui/dialogs/import_dialog.rb
288
- - lib/alexandria/ui/dialogs/keep_bad_isbn_dialog.rb
289
- - lib/alexandria/ui/dialogs/misc_dialogs.rb
290
- - lib/alexandria/ui/dialogs/new_book_dialog.rb
291
- - lib/alexandria/ui/dialogs/new_book_dialog_manual.rb
292
- - lib/alexandria/ui/dialogs/new_smart_library_dialog.rb
293
- - lib/alexandria/ui/dialogs/preferences_dialog.rb
294
- - lib/alexandria/ui/dialogs/smart_library_properties_dialog.rb
295
- - lib/alexandria/ui/dialogs/smart_library_properties_dialog_base.rb
286
+ - lib/alexandria/ui/confirm_erase_dialog.rb
287
+ - lib/alexandria/ui/conflict_while_copying_dialog.rb
296
288
  - lib/alexandria/ui/dndable.rb
289
+ - lib/alexandria/ui/error_dialog.rb
290
+ - lib/alexandria/ui/export_dialog.rb
297
291
  - lib/alexandria/ui/icons.rb
298
292
  - lib/alexandria/ui/iconview.rb
299
293
  - lib/alexandria/ui/iconview_tooltips.rb
294
+ - lib/alexandria/ui/import_dialog.rb
300
295
  - lib/alexandria/ui/init.rb
296
+ - lib/alexandria/ui/keep_bad_isbn_dialog.rb
301
297
  - lib/alexandria/ui/libraries_combo.rb
302
298
  - lib/alexandria/ui/listview.rb
303
299
  - lib/alexandria/ui/main_app.rb
300
+ - lib/alexandria/ui/misc_dialogs.rb
304
301
  - lib/alexandria/ui/multi_drag_treeview.rb
305
- - lib/alexandria/ui/sidepane.rb
302
+ - lib/alexandria/ui/new_book_dialog.rb
303
+ - lib/alexandria/ui/new_book_dialog_manual.rb
304
+ - lib/alexandria/ui/new_provider_dialog.rb
305
+ - lib/alexandria/ui/new_smart_library_dialog.rb
306
+ - lib/alexandria/ui/preferences_dialog.rb
307
+ - lib/alexandria/ui/provider_preferences_base_dialog.rb
308
+ - lib/alexandria/ui/provider_preferences_dialog.rb
309
+ - lib/alexandria/ui/really_delete_dialog.rb
310
+ - lib/alexandria/ui/sidepane_manager.rb
311
+ - lib/alexandria/ui/skip_entry_dialog.rb
312
+ - lib/alexandria/ui/smart_library_properties_dialog.rb
313
+ - lib/alexandria/ui/smart_library_properties_dialog_base.rb
306
314
  - lib/alexandria/ui/sound.rb
307
315
  - lib/alexandria/ui/ui_manager.rb
308
316
  - lib/alexandria/undo_manager.rb
@@ -468,13 +476,31 @@ files:
468
476
  - spec/alexandria/library_spec.rb
469
477
  - spec/alexandria/library_store_spec.rb
470
478
  - spec/alexandria/preferences_spec.rb
471
- - spec/alexandria/scanners/cuecat_spec.rb
479
+ - spec/alexandria/scanners/cue_cat_spec.rb
472
480
  - spec/alexandria/smart_library_spec.rb
473
- - spec/alexandria/ui/dialogs/new_book_dialog_spec.rb
474
- - spec/alexandria/ui/dialogs_spec.rb
481
+ - spec/alexandria/ui/about_dialog_spec.rb
482
+ - spec/alexandria/ui/acquire_dialog_spec.rb
483
+ - spec/alexandria/ui/alert_dialog_spec.rb
484
+ - spec/alexandria/ui/bad_isbns_dialog_spec.rb
485
+ - spec/alexandria/ui/book_properties_dialog_spec.rb
486
+ - spec/alexandria/ui/confirm_erase_dialog_spec.rb
487
+ - spec/alexandria/ui/conflict_while_copying_dialog_spec.rb
488
+ - spec/alexandria/ui/error_dialog_spec.rb
489
+ - spec/alexandria/ui/export_dialog_spec.rb
475
490
  - spec/alexandria/ui/iconview_spec.rb
491
+ - spec/alexandria/ui/import_dialog_spec.rb
492
+ - spec/alexandria/ui/keep_bad_isbn_dialog_spec.rb
476
493
  - spec/alexandria/ui/main_app_spec.rb
477
- - spec/alexandria/ui/sidepane_spec.rb
494
+ - spec/alexandria/ui/new_book_dialog_manual_spec.rb
495
+ - spec/alexandria/ui/new_book_dialog_spec.rb
496
+ - spec/alexandria/ui/new_provider_dialog_spec.rb
497
+ - spec/alexandria/ui/new_smart_library_dialog_spec.rb
498
+ - spec/alexandria/ui/preferences_dialog_spec.rb
499
+ - spec/alexandria/ui/provider_preferences_dialog_spec.rb
500
+ - spec/alexandria/ui/really_delete_dialog_spec.rb
501
+ - spec/alexandria/ui/sidepane_manager_spec.rb
502
+ - spec/alexandria/ui/skip_entry_dialog_spec.rb
503
+ - spec/alexandria/ui/smart_library_properties_dialog_spec.rb
478
504
  - spec/alexandria/ui/sound_spec.rb
479
505
  - spec/alexandria/ui/ui_manager_spec.rb
480
506
  - spec/alexandria/ui/ui_utilities_spec.rb
@@ -518,14 +544,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
518
544
  requirements:
519
545
  - - ">="
520
546
  - !ruby/object:Gem::Version
521
- version: 2.3.0
547
+ version: 2.4.0
522
548
  required_rubygems_version: !ruby/object:Gem::Requirement
523
549
  requirements:
524
550
  - - ">="
525
551
  - !ruby/object:Gem::Version
526
552
  version: '0'
527
553
  requirements: []
528
- rubygems_version: 3.0.1
554
+ rubygems_version: 3.0.6
529
555
  signing_key:
530
556
  specification_version: 4
531
557
  summary: GNOME application for managing collections of books
@@ -1,67 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- #-- -*- ruby -*-
4
- # Copyright (C) 2007 Cathal Mc Ginley
5
- # Copyright (C) 2014 Matijs van Zuijlen
6
- #
7
- # Alexandria is free software; you can redistribute it and/or
8
- # modify it under the terms of the GNU General Public License as
9
- # published by the Free Software Foundation; either version 2 of the
10
- # License, or (at your option) any later version.
11
- #
12
- # Alexandria is distributed in the hope that it will be useful,
13
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- # General Public License for more details.
16
- #
17
- # You should have received a copy of the GNU General Public
18
- # License along with Alexandria; see the file COPYING. If not,
19
- # write to the Free Software Foundation, Inc., 51 Franklin Street,
20
- # Fifth Floor, Boston, MA 02110-1301 USA.
21
-
22
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '../../../lib'))
23
-
24
- require 'alexandria/scanners/cuecat'
25
-
26
- describe Alexandria::Scanners::CueCat do
27
- before :all do
28
- @cuecat = Alexandria::Scanners::CueCat.new
29
- @partials = ['.',
30
- '.C3nZC3nZC3n2ChnWENz7DxnY',
31
- '.C3nZC3nZC3n2ChnWENz7DxnY.',
32
- '.C3nZC3nZC3n2ChnWENz7DxnY.cGen',
33
- '.C3nZC3nZC3n2ChnWENz7DxnY.cGen.',
34
- '.C3nZC3nZC3n2ChnWENz7DxnY.cGen.ENr7C3z0CNj3Dhj1EW']
35
- @scans = {
36
- isbn: '.C3nZC3nZC3n2ChnWENz7DxnY.cGen.ENr7C3z0CNj3Dhj1EW.',
37
- ib5: '.C3nZC3nZC3n2ChnWENz7DxnY.cGf2.ENr7C3z0DNn0ENnWE3nZDhP6.'
38
- }
39
- end
40
-
41
- it 'is called CueCat' do
42
- expect(@cuecat.name).to match(/CueCat/i)
43
- end
44
-
45
- it 'should detect a complete scan only ' do
46
- @partials.each { |scan| expect(@cuecat.match?(scan)).not_to be_truthy }
47
- expect(@cuecat.match?(@scans[:isbn])).to be_truthy
48
- expect(@cuecat.match?(@scans[:ib5])).to be_truthy
49
- end
50
-
51
- it 'should decode ISBN barcodes' do
52
- expect(@cuecat.decode(@scans[:isbn])).to eq('9780571147168')
53
- end
54
-
55
- it 'should decode ISBN+5 barcodes' do
56
- expect(@cuecat.decode(@scans[:ib5])).to eq('9780575079038') # 00799
57
- # TODO are we supposed to keep the +5 bit?
58
- end
59
-
60
- it 'should decode ISSN barcodes' do
61
- skip 'Test scan ISSN'
62
- end
63
-
64
- it 'should decode UPC barcodes' do
65
- skip 'Test scan UPC'
66
- end
67
- end
@@ -1,162 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # This file is part of Alexandria.
4
- #
5
- # See the file README.md for authorship and licensing information.
6
-
7
- require File.dirname(__FILE__) + '/../../spec_helper'
8
-
9
- describe Alexandria::UI::SmartLibraryPropertiesDialog do
10
- it 'should work' do
11
- parent = Gtk::Window.new :toplevel
12
- smart_library = instance_double(Alexandria::SmartLibrary,
13
- name: 'Foo',
14
- rules: [],
15
- predicate_operator_rule: :any)
16
- described_class.new parent, smart_library
17
- end
18
- end
19
-
20
- describe Alexandria::UI::ProviderPreferencesDialog do
21
- it 'should work' do
22
- parent = Gtk::Window.new :toplevel
23
- preferences = instance_double(Alexandria::BookProviders::Preferences,
24
- length: 0, read: [])
25
- provider = instance_double(Alexandria::BookProviders::GenericProvider,
26
- fullname: 'FooProvider',
27
- prefs: preferences)
28
- described_class.new parent, provider
29
- end
30
- end
31
-
32
- describe Alexandria::UI::NewProviderDialog do
33
- it 'should work' do
34
- parent = Gtk::Window.new :toplevel
35
- described_class.new parent
36
- end
37
- end
38
-
39
- describe Alexandria::UI::PreferencesDialog do
40
- it 'should work' do
41
- parent = Gtk::Window.new :toplevel
42
- described_class.new(parent) {}
43
- end
44
- end
45
-
46
- describe Alexandria::UI::NewSmartLibraryDialog do
47
- it 'should work' do
48
- parent = Gtk::Window.new :toplevel
49
- described_class.new parent
50
- end
51
- end
52
-
53
- describe Alexandria::UI::NewBookDialogManual do
54
- it 'should work' do
55
- parent = Gtk::Window.new :toplevel
56
- library = instance_double(Alexandria::Library)
57
- described_class.new parent, library
58
- end
59
- end
60
-
61
- describe Alexandria::UI::KeepBadISBNDialog do
62
- it 'should work' do
63
- parent = Gtk::Window.new :toplevel
64
- book = instance_double(Alexandria::Book,
65
- title: 'Foo Book',
66
- isbn: '98765432')
67
- described_class.new parent, book
68
- end
69
- end
70
-
71
- describe Alexandria::UI::ConflictWhileCopyingDialog do
72
- it 'should work' do
73
- parent = Gtk::Window.new :toplevel
74
- library = instance_double(Alexandria::Library, name: 'Bar Library')
75
- book = instance_double(Alexandria::Book, title: 'Foo Book')
76
- described_class.new parent, library, book
77
- end
78
- end
79
-
80
- describe Alexandria::UI::ReallyDeleteDialog do
81
- it 'should work' do
82
- library = instance_double(Alexandria::Library, name: 'Bar Library', empty?: false, size: 12)
83
- parent = Gtk::Window.new :toplevel
84
- described_class.new parent, library
85
- end
86
- end
87
-
88
- describe Alexandria::UI::SkipEntryDialog do
89
- it 'should work' do
90
- parent = Gtk::Window.new :toplevel
91
- described_class.new parent, 'Foo'
92
- end
93
- end
94
-
95
- describe Alexandria::UI::ImportDialog do
96
- it 'should work' do
97
- parent = Gtk::Window.new :toplevel
98
- described_class.new parent
99
- end
100
- end
101
-
102
- describe Alexandria::UI::ConfirmEraseDialog do
103
- it 'should work' do
104
- parent = Gtk::Window.new :toplevel
105
- described_class.new parent, 'foo-file'
106
- end
107
- end
108
-
109
- describe Alexandria::UI::ExportDialog do
110
- it 'should work' do
111
- parent = Gtk::Window.new :toplevel
112
- library = instance_double(Alexandria::Library, name: 'Bar Library')
113
- described_class.new parent, library, :ascending
114
- end
115
- end
116
-
117
- describe Alexandria::UI::BookPropertiesDialog do
118
- it 'should work' do
119
- parent = Gtk::Window.new :toplevel
120
- library = instance_double(Alexandria::Library, name: 'Bar Library', cover: '')
121
- book = Alexandria::Book.new('Foo Book', ['Jane Doe'], '98765432', 'Bar Publisher',
122
- 1972, 'edition')
123
- described_class.new parent, library, book
124
- end
125
- end
126
-
127
- describe Alexandria::UI::BadIsbnsDialog do
128
- it 'should work' do
129
- parent = Gtk::Window.new :toplevel
130
- described_class.new parent, 'Careful', []
131
- end
132
- end
133
-
134
- describe Alexandria::UI::ErrorDialog do
135
- it 'should work' do
136
- parent = Gtk::Window.new :toplevel
137
- described_class.new parent, 'Boom', 'It went boom'
138
- end
139
- end
140
-
141
- describe Alexandria::UI::AlertDialog do
142
- it 'should work' do
143
- parent = Gtk::Window.new :toplevel
144
- described_class.new(parent, 'Hello',
145
- Gtk::Stock::DIALOG_QUESTION,
146
- [[Gtk::Stock::CANCEL, :cancel]], 'Hi there')
147
- end
148
- end
149
-
150
- describe Alexandria::UI::AcquireDialog do
151
- it 'should work' do
152
- parent = Gtk::Window.new :toplevel
153
- described_class.new parent
154
- end
155
- end
156
-
157
- describe Alexandria::UI::AboutDialog do
158
- it 'should work' do
159
- parent = Gtk::Window.new :toplevel
160
- described_class.new parent
161
- end
162
- end