alexandria-book-collection-manager 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -0
  3. data/.reek +3 -0
  4. data/.rubocop.yml +8 -0
  5. data/.rubocop_todo.yml +20 -23
  6. data/.simplecov +3 -0
  7. data/.yardopts +1 -0
  8. data/CHANGELOG.md +6 -0
  9. data/Gemfile +3 -2
  10. data/INSTALL.rdoc +0 -8
  11. data/README.md +72 -0
  12. data/Rakefile +4 -2
  13. data/TODO.md +26 -0
  14. data/alexandria-book-collection-manager.gemspec +6 -3
  15. data/bin/alexandria +1 -6
  16. data/dogtail/basic_run_test.py +9 -0
  17. data/lib/alexandria/book_providers.rb +2 -6
  18. data/lib/alexandria/book_providers/proxis.rb +1 -1
  19. data/lib/alexandria/book_providers/web.rb +1 -1
  20. data/lib/alexandria/book_providers/z3950.rb +4 -4
  21. data/lib/alexandria/export_library.rb +20 -27
  22. data/lib/alexandria/import_library.rb +7 -5
  23. data/lib/alexandria/models/book.rb +11 -1
  24. data/lib/alexandria/models/library.rb +4 -17
  25. data/lib/alexandria/preferences.rb +5 -5
  26. data/lib/alexandria/smart_library.rb +2 -8
  27. data/lib/alexandria/ui/callbacks.rb +1 -1
  28. data/lib/alexandria/ui/columns.rb +9 -0
  29. data/lib/alexandria/ui/completion_models.rb +1 -29
  30. data/lib/alexandria/ui/dialogs/acquire_dialog.rb +2 -3
  31. data/lib/alexandria/ui/dialogs/book_properties_dialog_base.rb +1 -2
  32. data/lib/alexandria/ui/dialogs/new_book_dialog_manual.rb +3 -2
  33. data/lib/alexandria/ui/iconview.rb +1 -6
  34. data/lib/alexandria/ui/libraries_combo.rb +1 -0
  35. data/lib/alexandria/ui/listview.rb +5 -10
  36. data/lib/alexandria/ui/main_app.rb +0 -1
  37. data/lib/alexandria/ui/sidepane.rb +1 -1
  38. data/lib/alexandria/ui/sound.rb +3 -3
  39. data/lib/alexandria/ui/ui_manager.rb +5 -13
  40. data/lib/alexandria/version.rb +2 -2
  41. data/spec/alexandria/book_providers_spec.rb +0 -17
  42. data/spec/alexandria/book_spec.rb +23 -0
  43. data/spec/alexandria/library_spec.rb +26 -0
  44. data/spec/alexandria/smart_library_spec.rb +11 -1
  45. data/spec/alexandria/ui/main_app_spec.rb +0 -11
  46. data/spec/spec_helper.rb +0 -1
  47. data/tasks/dogtail.rake +4 -0
  48. data/tasks/spec.rake +3 -3
  49. metadata +58 -12
  50. data/TODO +0 -24
  51. data/spec/alexandria/ui/listview_spec.rb +0 -28
  52. data/tasks/rdoc.rake +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f036a94a542570c4cbd37330bc4e7a08cb4ef0e
4
- data.tar.gz: 61f6af24a98abc4281bea6558b3c70c2ece62e75
3
+ metadata.gz: 0ee9c80a67f5db92fba609abcc676763cea3caa7
4
+ data.tar.gz: 845f6aada1d8241f8b9401cee1964e0d5a411b7f
5
5
  SHA512:
6
- metadata.gz: b594225692a4cd2cfc511ab4e6835dff6cfe379d8e21a13694065d3b0eab20348766af0c9314230bdd15de8d2ab1ed2d21e82081c4ec77a20f26a8ebf4187a1a
7
- data.tar.gz: f8d35bbf4005a7d6b016bfdc0f7474397d602f4491d67470211667babd7a5bd93aa8f6e54312d45556cd6aea94a5c257fdeb287862a982943b655681b2d6cee2
6
+ metadata.gz: 6e4f738354ff4521abd4fafb0c70cb6467991083ca2b1d641070c2dbfaa0d516c93e79f98507c8500726447c9d03a284f94e3193b8e9c5d40c5fbd94a11a8f7a
7
+ data.tar.gz: cbf664f9496c5703da2892f935b93836f6eec3688ffc1f45c6772b28c35f036f4ca1a1744238a2b7f731821b25e9dd4e3bc433a12ed52046cee9ffa2ffaa2c9e
data/.gitignore CHANGED
@@ -5,7 +5,11 @@ alexandria.desktop.in.h
5
5
  .svn-authors
6
6
  lib/alexandria/default_preferences.rb
7
7
  Gemfile.lock
8
+ .yardoc/
8
9
  share/locale/
9
10
  share/omf/alexandria/*.omf
10
11
  pkg/
12
+ coverage/
13
+ doc/
14
+ tmp/
11
15
  *.gem
data/.reek ADDED
@@ -0,0 +1,3 @@
1
+ exclude_paths:
2
+ - spec
3
+ - util
@@ -48,6 +48,10 @@ Style/MultilineMethodCallBraceLayout:
48
48
  Style/MultilineMethodCallIndentation:
49
49
  EnforcedStyle: indented
50
50
 
51
+ # Not all objects that handle #== 0 also handle #zero?
52
+ Style/NumericPredicate:
53
+ Enabled: false
54
+
51
55
  # Sometimes an if statement just looks better than next with a guard clause
52
56
  Style/Next:
53
57
  Enabled: false
@@ -75,4 +79,8 @@ Style/TrailingCommaInLiteral:
75
79
  Style/WordArray:
76
80
  Enabled: false
77
81
 
82
+ # Not all objects that handle #length also handle #empty?
83
+ Style/ZeroLengthPredicate:
84
+ Enabled: false
85
+
78
86
  inherit_from: .rubocop_todo.yml
@@ -1,19 +1,18 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2016-10-01 20:35:02 +0200 using RuboCop version 0.43.0.
3
+ # on 2016-11-01 21:29:40 +0100 using RuboCop version 0.45.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 7
9
+ # Offense count: 6
10
10
  Lint/HandleExceptions:
11
11
  Exclude:
12
12
  - 'lib/alexandria/import_library_csv.rb'
13
13
  - 'lib/alexandria/models/library.rb'
14
14
  - 'lib/alexandria/ui/dialogs/book_properties_dialog.rb'
15
15
  - 'lib/alexandria/ui/dialogs/import_dialog.rb'
16
- - 'lib/alexandria/ui/sound.rb'
17
16
 
18
17
  # Offense count: 2
19
18
  Lint/IneffectiveAccessModifier:
@@ -37,30 +36,35 @@ Lint/UselessAccessModifier:
37
36
  Exclude:
38
37
  - 'lib/alexandria/logging.rb'
39
38
 
40
- # Offense count: 173
39
+ # Offense count: 172
41
40
  Metrics/AbcSize:
42
- Max: 163
41
+ Max: 161
42
+
43
+ # Offense count: 21
44
+ # Configuration parameters: CountComments.
45
+ Metrics/BlockLength:
46
+ Max: 68
43
47
 
44
48
  # Offense count: 14
45
49
  Metrics/BlockNesting:
46
50
  Max: 5
47
51
 
48
- # Offense count: 34
52
+ # Offense count: 33
49
53
  # Configuration parameters: CountComments.
50
54
  Metrics/ClassLength:
51
- Max: 1007
55
+ Max: 994
52
56
 
53
- # Offense count: 78
57
+ # Offense count: 75
54
58
  Metrics/CyclomaticComplexity:
55
59
  Max: 28
56
60
 
57
- # Offense count: 352
58
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
61
+ # Offense count: 353
62
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives.
59
63
  # URISchemes: http, https
60
64
  Metrics/LineLength:
61
- Max: 392
65
+ Max: 294
62
66
 
63
- # Offense count: 232
67
+ # Offense count: 228
64
68
  # Configuration parameters: CountComments.
65
69
  Metrics/MethodLength:
66
70
  Max: 113
@@ -75,7 +79,7 @@ Metrics/ModuleLength:
75
79
  Metrics/ParameterLists:
76
80
  Max: 7
77
81
 
78
- # Offense count: 76
82
+ # Offense count: 74
79
83
  Metrics/PerceivedComplexity:
80
84
  Max: 29
81
85
 
@@ -108,7 +112,7 @@ Style/ClassVars:
108
112
  - 'lib/alexandria/ui/dialogs/book_properties_dialog_base.rb'
109
113
  - 'lib/alexandria/ui/dialogs/new_book_dialog.rb'
110
114
 
111
- # Offense count: 126
115
+ # Offense count: 121
112
116
  Style/Documentation:
113
117
  Enabled: false
114
118
 
@@ -142,13 +146,7 @@ Style/FormatString:
142
146
  - 'lib/alexandria/ui/listview.rb'
143
147
  - 'lib/alexandria/ui/ui_manager.rb'
144
148
 
145
- # Offense count: 4
146
- # Configuration parameters: AllowedVariables.
147
- Style/GlobalVars:
148
- Exclude:
149
- - 'lib/alexandria/export_library.rb'
150
-
151
- # Offense count: 36
149
+ # Offense count: 34
152
150
  # Configuration parameters: MinBodyLength.
153
151
  Style/GuardClause:
154
152
  Enabled: false
@@ -185,10 +183,9 @@ Style/MultilineTernaryOperator:
185
183
  Exclude:
186
184
  - 'lib/alexandria/ui/listview.rb'
187
185
 
188
- # Offense count: 2
186
+ # Offense count: 1
189
187
  Style/NestedTernaryOperator:
190
188
  Exclude:
191
- - 'lib/alexandria/ui/completion_models.rb'
192
189
  - 'lib/alexandria/ui/ui_manager.rb'
193
190
 
194
191
  # Offense count: 8
@@ -0,0 +1,3 @@
1
+ SimpleCov.start do
2
+ track_files 'lib/**/*.rb'
3
+ end
@@ -0,0 +1 @@
1
+ - INSTALL.rdoc
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.1 / 2016-12-13
4
+
5
+ * Various code cleanups
6
+ * Update dependencies
7
+ * Don't crash if smart library name uses non-UTF-8 encoding
8
+
3
9
  ## 0.7.0
4
10
 
5
11
  * Various small bug fixes
data/Gemfile CHANGED
@@ -4,7 +4,8 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  group :development, :test do
7
- gem 'rdoc', '~> 4.0'
8
7
  gem 'pry'
9
- gem 'rubocop', '~> 0.43.0'
8
+ gem 'rubocop', '~> 0.46.0'
9
+ gem 'simplecov'
10
+ gem 'yard', '~> 0.9.5'
10
11
  end
@@ -65,8 +65,6 @@ Note that these files are pre-generated in tar.gz releases, so you'll
65
65
  only need them if you're building from the SVN version, or want to
66
66
  change the translations.
67
67
 
68
- == Optional Dependencies
69
-
70
68
  === Ruby/ZOOM and Yaz
71
69
 
72
70
  For Z39.50 support and and the <b>Library of Congress</b> and
@@ -88,12 +86,6 @@ You will need
88
86
  <tt>image_size</tt>[http://rubyforge.org/projects/imagesize/] for
89
87
  optimizing the cover images in exported libraries.
90
88
 
91
- === Revolution
92
-
93
- If you want to auto-complete the names of people you loan books to
94
- from your Evolution contacts database, you can install
95
- +revolution+[ http://revolution.rubyforge.org/].
96
-
97
89
  == Build and Install
98
90
 
99
91
  To build Alexandria from a subversion checkout, go to the base project
data/README.md CHANGED
@@ -86,3 +86,75 @@ or, to get verbose debugging information,
86
86
 
87
87
  If you are running GNOME, Alexandria should appear under the
88
88
  'Applications > Office' menu.
89
+
90
+ ## Contributors
91
+
92
+ The following people have contributed to Alexandria over the years:
93
+
94
+ ### Authors
95
+
96
+ * Alexander McCormmach <alexander@tunicate.org>
97
+ * Aymeric Nys <aymeric@nnx.com>
98
+ * Cathal Mc Ginley <cathal.alexandria@gnostai.org>
99
+ * Claudio Belotti <bel8@lilik.it>
100
+ * Constantine Evans <cevans@costinet.org>
101
+ * Dafydd Harries <daf@muse.19inch.net>
102
+ * Javier Fernandez-Sanguino Pena <jfs@debian.org>
103
+ * Joseph Method <tristil@gmail.com>
104
+ * Kevin Schultz <schultkl@ieee.org>
105
+ * Laurent Sansonetti <lrz@gnome.org>
106
+ * Marco Costantini <costanti@science.unitn.it>
107
+ * Mathieu Leduc-Hamel <arrak@arrak.org>
108
+ * Matijs van Zuijlen <matijs@matijs.net>
109
+ * Owain Evans <o.evans@gmail.com>
110
+ * Pascal Terjan <pterjan@linuxfr.org>
111
+ * Rene Samselnig <sandman@sdm-net.org>
112
+ * Robby Stephenson <robby@periapsis.org>
113
+ * Sun Ning <classicning@gmail.com>
114
+ * Takayuki Kusano <AE5T-KSN@asahi-net.or.jp>
115
+ * Timothy Malone <timothy.malone@gmail.com>
116
+ * Zachary P. Landau <kapheine@hypa.net>
117
+
118
+ ### Documenters
119
+
120
+ * Cathal Mc Ginley <cathal.alexandria@gnostai.org>
121
+ * Liam Davison <registrations@liamjdavison.info>
122
+
123
+ ### Translators
124
+
125
+ * Adrián Chaves Fernández <adriyetichaves@gmail.com> (gl)
126
+ * Cathal Mc Ginley <cathal.alexandria@gnostai.org> (ga)
127
+ * CHIKAMA Masaki <masaki.chikama@gmail.com> (ja)
128
+ * Dafydd Harries <daf@muse.19inch.net> (cy)
129
+ * Damjan Dimitrioski <damjandimitrioski@gmail.com> (mk)
130
+ * Giacomo Margarito <giacomomargarito@gmail.com> (it)
131
+ * Jack Myrseh <jack@enkom.no> (nb)
132
+ * Joachim Breitner <mail@joachim-breitner.de> (de)
133
+ * José Ling <jlgdot369@gmail.com> (zh_TW)
134
+ * Lennart Karssen <lennart@karssen.org> (nl)
135
+ * Lígia Moreira <ligia.moreira@netvisao.pt> (fr, pt, pt_BR)
136
+ * Martin Karlsson <martinkarlsson81@hotmail.com> (sv)
137
+ * Michael Kotsarinis <mkotsari1@pre.forthnet.gr> (el)
138
+ * Miguel Ángel García <magmax@ieee.org> (es)
139
+ * Peter Kováč <kovac.peter@fotopriestor.sk> (sk)
140
+ * Petr Vanek <vanous@penguin.cz> (cs)
141
+ * Piotr Drąg <piotrdrag@gmail.com> (pl)
142
+ * Serhij Dubyk <dubyk@library.lviv.ua> (uk)
143
+
144
+ ### Artists
145
+
146
+ * Andreas Nilsson <nisses.mail@home.se>
147
+ * Stefanie Dijoux <stefanie.dijoux@gmail.com>
148
+
149
+ ## License
150
+
151
+ Unless otherwise noted, the following license applies to all files that are
152
+ part of Alexandria:
153
+
154
+ Copyright (C) 2004-2006 Laurent Sansonetti
155
+ Copyright (C) 2007-2010,2014-2016 Alexandria Contributors
156
+
157
+ Alexandria is free software; you can redistribute it and/or modify it under the
158
+ terms of the GNU General Public License as published by the Free Software
159
+ Foundation; either version 2 of the License, or (at your option) any later
160
+ version. See the file COPYING for details.
data/Rakefile CHANGED
@@ -85,7 +85,7 @@ task debian_install: :install_package_staging
85
85
  FileInstallTask.new(:package) do |j|
86
86
  install_common(j)
87
87
 
88
- docs = %w(README.rdoc NEWS INSTALL.rdoc COPYING TODO)
88
+ docs = %w(README.rdoc NEWS INSTALL.rdoc COPYING TODO.md)
89
89
  devel_docs = ['doc/AUTHORS', 'doc/BUGS', 'doc/FAQ',
90
90
  'doc/cuecat_support.rdoc']
91
91
  j.install('', docs, "#{SHARE}/doc/#{PROJECT}")
@@ -215,7 +215,7 @@ Rake::PackageTask.new(PROJECT, Alexandria::DISPLAY_VERSION) do |p|
215
215
  p.need_tar_gz = true
216
216
  p.package_files.include('README*', 'COPYING', 'CHANGELOG.md', 'INSTALL.rdoc',
217
217
  'NEWS', 'Rakefile', 'util/**/*',
218
- 'TODO', 'alexandria.desktop',
218
+ 'TODO.md', 'alexandria.desktop',
219
219
  'alexandria.desktop.in',
220
220
  'bin/**/*', 'data/**/*', 'misc/**/*',
221
221
  'doc/**/*', 'lib/**/*', 'po/**/*',
@@ -261,3 +261,5 @@ task install: [:pre_install, :install_package, :post_install]
261
261
 
262
262
  desc 'Uninstall Alexandria'
263
263
  task uninstall: [:uninstall_package] # TODO: gconf etc...
264
+
265
+ task default: [:spec, :dogtail]
data/TODO.md ADDED
@@ -0,0 +1,26 @@
1
+ Alexandria's TODO list
2
+ ======================
3
+
4
+ This is an old list of TODO's.
5
+
6
+ For the next release:
7
+
8
+ * [x] Drag-and-drop books within libraries
9
+ * [x] Infinite Undo/Redo
10
+ * [x] Smart libraries
11
+ * [x] CueCat userland support
12
+ * [ ] Threading of all operations
13
+
14
+ Future releases:
15
+
16
+ * [ ] Sort providers meaningfully according to the current locale
17
+ * [ ] ONIX import
18
+ * [ ] Import/export via GNOME-DB
19
+ * [ ] Zoom in the current view, giving more or less details
20
+ * [ ] PDA support
21
+ * [ ] Win32 MinGW port
22
+ * [ ] Show more details about books, like number of pages, price, topic, a user
23
+ defined field
24
+ * [ ] Printing
25
+ * [ ] Editable views; for icons, renaming their title, for list, editing each
26
+ field
@@ -46,12 +46,15 @@ Gem::Specification.new do |s|
46
46
  s.add_runtime_dependency('gettext', ['~> 3.1'])
47
47
  s.add_runtime_dependency('hpricot', ['~> 0.8.5'])
48
48
  s.add_runtime_dependency('htmlentities', ['~> 4.3'])
49
- s.add_runtime_dependency('gtk3', ['~> 3.0.9'])
50
- s.add_runtime_dependency('gio2', ['~> 3.0.9'])
49
+ s.add_runtime_dependency('gtk3', ['~> 3.1.0'])
50
+ s.add_runtime_dependency('gio2', ['~> 3.1.0'])
51
51
  s.add_runtime_dependency('gstreamer', ['~> 3.0'])
52
+ s.add_runtime_dependency('image_size', ['~> 1.5.0'])
53
+ s.add_runtime_dependency('marc', ['~> 1.0.0'])
54
+ s.add_runtime_dependency('zoom', ['~> 0.5.0'])
52
55
 
53
56
  s.add_development_dependency('minitest', ['~> 5.0'])
54
- s.add_development_dependency('rake', ['~> 11.1'])
57
+ s.add_development_dependency('rake', ['~> 12.0'])
55
58
  s.add_development_dependency('rspec', ['~> 3.0'])
56
59
 
57
60
  s.require_paths = ['lib']
@@ -20,12 +20,7 @@
20
20
  # write to the Free Software Foundation, Inc., 51 Franklin Street,
21
21
  # Fifth Floor, Boston, MA 02110-1301 USA.
22
22
 
23
- begin
24
- require 'gettext'
25
- rescue LoadError
26
- require 'rubygems'
27
- require 'gettext'
28
- end
23
+ require 'gettext'
29
24
  require 'alexandria'
30
25
  require 'optparse'
31
26
  require 'ostruct'
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env python
2
+
3
+ from dogtail.tree import *
4
+ from dogtail.utils import run
5
+
6
+ run('bin/alexandria', appName = 'alexandria')
7
+ app = root.application('alexandria')
8
+ quit_item = app.menuItem('Quit')
9
+ quit_item.doActionNamed('click')
@@ -307,12 +307,8 @@ module Alexandria
307
307
  require 'alexandria/book_providers/thalia'
308
308
  require 'alexandria/book_providers/worldcat'
309
309
 
310
- # Ruby/ZOOM is optional
311
- begin
312
- require 'alexandria/book_providers/z3950'
313
- rescue LoadError
314
- log.info { "Can't load Ruby/ZOOM, hence Z39.50 and providers Library of Congress, British Library not available" }
315
- end
310
+ # Z39.50 based providers
311
+ require 'alexandria/book_providers/z3950'
316
312
 
317
313
  attr_reader :abstract_classes
318
314
 
@@ -90,7 +90,7 @@ module Alexandria
90
90
  node.to_html
91
91
  elsif node.elem?
92
92
  if node.children.nil?
93
- return nil
93
+ nil
94
94
  else
95
95
  node_text = node.children.map { |n| text_of(n) }.join
96
96
  node_text.strip.squeeze(' ')
@@ -45,7 +45,7 @@ module Alexandria
45
45
  node.to_html
46
46
  elsif node.elem?
47
47
  if node.children.nil?
48
- return nil
48
+ nil
49
49
  else
50
50
  node_text = node.children.map { |n| text_of(n) }.join
51
51
  node_text.strip.squeeze(' ')
@@ -59,7 +59,7 @@ module Alexandria
59
59
  conn_count = type == SEARCH_BY_ISBN ? 1 : 10 # results to retrieve
60
60
  resultset = search_records(criterion, type, conn_count)
61
61
  log.debug { "total #{resultset.length}" }
62
- raise NoResultsError if resultset.empty?
62
+ raise NoResultsError if resultset.length == 0
63
63
  results = books_from_marc(resultset, isbn)
64
64
  type == SEARCH_BY_ISBN ? results.first : results
65
65
  end
@@ -214,7 +214,7 @@ module Alexandria
214
214
  prefs.variable_named('port').default_value = 7090
215
215
  prefs.variable_named('database').default_value = 'Voyager'
216
216
  prefs.variable_named('record_syntax').default_value = 'USMARC'
217
- prefs.variable_named('charset').default_value = 'ISO_6937'
217
+ prefs.variable_named('charset').default_value = 'ISO-8859-1'
218
218
  prefs.read
219
219
  end
220
220
 
@@ -257,7 +257,7 @@ module Alexandria
257
257
  conn_count = type == SEARCH_BY_ISBN ? 1 : 10 # results to retrieve
258
258
  resultset = search_records(criterion, type, conn_count)
259
259
  log.debug { "total #{resultset.length}" }
260
- raise NoResultsError if resultset.empty?
260
+ raise NoResultsError if resultset.length == 0
261
261
  results = books_from_sutrs(resultset)
262
262
  type == SEARCH_BY_ISBN ? results.first : results
263
263
  end
@@ -340,7 +340,7 @@ module Alexandria
340
340
  criterion = canonicalise_isbn_with_dashes(criterion)
341
341
  resultset = search_records(criterion, type, 0)
342
342
  log.debug { "total #{resultset.length}" }
343
- raise NoResultsError if resultset.empty?
343
+ raise NoResultsError if resultset.length == 0
344
344
  results = books_from_marc(resultset, isbn)
345
345
  type == SEARCH_BY_ISBN ? results.first : results
346
346
  end