alexandria-book-collection-manager 0.7.2 → 0.7.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (200) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +9 -0
  3. data/.github/workflows/ruby.yml +77 -0
  4. data/.gitignore +5 -1
  5. data/.hound.yml +2 -0
  6. data/.rubocop.yml +87 -37
  7. data/.rubocop_todo.yml +62 -191
  8. data/.simplecov +5 -2
  9. data/CHANGELOG.md +63 -0
  10. data/Gemfile +4 -3
  11. data/INSTALL.md +26 -14
  12. data/README.md +52 -42
  13. data/Rakefile +93 -109
  14. data/TODO.md +9 -1
  15. data/alexandria-book-collection-manager.gemspec +50 -43
  16. data/bin/alexandria +30 -53
  17. data/doc/FAQ +2 -6
  18. data/doc/dependency_decisions.yml +27 -8
  19. data/lib/alexandria.rb +27 -37
  20. data/lib/alexandria/about.rb +50 -50
  21. data/lib/alexandria/book_providers.rb +90 -97
  22. data/lib/alexandria/book_providers/adlibris.rb +41 -76
  23. data/lib/alexandria/book_providers/amazon_aws.rb +96 -100
  24. data/lib/alexandria/book_providers/amazon_ecs_util.rb +295 -322
  25. data/lib/alexandria/book_providers/barnes_and_noble.rb +48 -45
  26. data/lib/alexandria/book_providers/douban.rb +26 -42
  27. data/lib/alexandria/book_providers/proxis.rb +44 -55
  28. data/lib/alexandria/book_providers/pseudomarc.rb +77 -85
  29. data/lib/alexandria/book_providers/siciliano.rb +64 -65
  30. data/lib/alexandria/book_providers/thalia.rb +42 -41
  31. data/lib/alexandria/book_providers/web.rb +15 -33
  32. data/lib/alexandria/book_providers/worldcat.rb +70 -97
  33. data/lib/alexandria/book_providers/z3950.rb +160 -173
  34. data/lib/alexandria/config.rb +1 -1
  35. data/lib/alexandria/console.rb +8 -21
  36. data/lib/alexandria/default_preferences.rb +37 -0
  37. data/lib/alexandria/execution_queue.rb +15 -13
  38. data/lib/alexandria/export_format.rb +47 -0
  39. data/lib/alexandria/export_library.rb +193 -300
  40. data/lib/alexandria/import_library.rb +108 -141
  41. data/lib/alexandria/import_library_csv.rb +43 -46
  42. data/lib/alexandria/library_collection.rb +79 -0
  43. data/lib/alexandria/library_sort_order.rb +45 -0
  44. data/lib/alexandria/library_store.rb +233 -0
  45. data/lib/alexandria/logging.rb +11 -13
  46. data/lib/alexandria/models/book.rb +13 -20
  47. data/lib/alexandria/models/library.rb +81 -353
  48. data/lib/alexandria/net.rb +5 -6
  49. data/lib/alexandria/preferences.rb +73 -87
  50. data/lib/alexandria/scanners.rb +2 -2
  51. data/lib/alexandria/scanners/{cuecat.rb → cue_cat.rb} +20 -18
  52. data/lib/alexandria/scanners/keyboard.rb +8 -8
  53. data/lib/alexandria/smart_library.rb +133 -170
  54. data/lib/alexandria/ui.rb +15 -15
  55. data/lib/alexandria/ui/about_dialog.rb +49 -0
  56. data/lib/alexandria/ui/{dialogs/acquire_dialog.rb → acquire_dialog.rb} +119 -136
  57. data/lib/alexandria/ui/alert_dialog.rb +64 -0
  58. data/lib/alexandria/ui/bad_isbns_dialog.rb +41 -0
  59. data/lib/alexandria/ui/{dialogs/barcode_animation.rb → barcode_animation.rb} +16 -15
  60. data/lib/alexandria/ui/{dialogs/book_properties_dialog.rb → book_properties_dialog.rb} +39 -52
  61. data/lib/alexandria/ui/book_properties_dialog_base.rb +318 -0
  62. data/lib/alexandria/ui/builder_base.rb +7 -27
  63. data/lib/alexandria/ui/calendar_popup.rb +58 -0
  64. data/lib/alexandria/ui/callbacks.rb +189 -183
  65. data/lib/alexandria/ui/completion_models.rb +10 -23
  66. data/lib/alexandria/ui/confirm_erase_dialog.rb +33 -0
  67. data/lib/alexandria/ui/conflict_while_copying_dialog.rb +34 -0
  68. data/lib/alexandria/ui/dndable.rb +7 -7
  69. data/lib/alexandria/ui/error_dialog.rb +25 -0
  70. data/lib/alexandria/ui/export_dialog.rb +142 -0
  71. data/lib/alexandria/ui/icons.rb +47 -63
  72. data/lib/alexandria/ui/iconview.rb +12 -10
  73. data/lib/alexandria/ui/iconview_tooltips.rb +41 -54
  74. data/lib/alexandria/ui/import_dialog.rb +157 -0
  75. data/lib/alexandria/ui/init.rb +21 -33
  76. data/lib/alexandria/ui/keep_bad_isbn_dialog.rb +36 -0
  77. data/lib/alexandria/ui/libraries_combo.rb +16 -14
  78. data/lib/alexandria/ui/listview.rb +73 -87
  79. data/lib/alexandria/ui/main_app.rb +24 -26
  80. data/lib/alexandria/ui/misc_dialogs.rb +10 -0
  81. data/lib/alexandria/ui/multi_drag_treeview.rb +28 -41
  82. data/lib/alexandria/ui/{dialogs/new_book_dialog.rb → new_book_dialog.rb} +156 -194
  83. data/lib/alexandria/ui/new_book_dialog_manual.rb +139 -0
  84. data/lib/alexandria/ui/new_provider_dialog.rb +100 -0
  85. data/lib/alexandria/ui/new_smart_library_dialog.rb +74 -0
  86. data/lib/alexandria/ui/preferences_dialog.rb +313 -0
  87. data/lib/alexandria/ui/provider_preferences_base_dialog.rb +95 -0
  88. data/lib/alexandria/ui/provider_preferences_dialog.rb +35 -0
  89. data/lib/alexandria/ui/really_delete_dialog.rb +53 -0
  90. data/lib/alexandria/ui/{sidepane.rb → sidepane_manager.rb} +56 -68
  91. data/lib/alexandria/ui/skip_entry_dialog.rb +33 -0
  92. data/lib/alexandria/ui/smart_library_properties_dialog.rb +60 -0
  93. data/lib/alexandria/ui/smart_library_properties_dialog_base.rb +242 -0
  94. data/lib/alexandria/ui/smart_library_rule_box.rb +119 -0
  95. data/lib/alexandria/ui/sound.rb +11 -13
  96. data/lib/alexandria/ui/ui_manager.rb +236 -251
  97. data/lib/alexandria/undo_manager.rb +1 -0
  98. data/lib/alexandria/version.rb +4 -19
  99. data/lib/alexandria/web_themes.rb +22 -21
  100. data/po/Makefile +2 -2
  101. data/po/cs.po +993 -880
  102. data/po/cy.po +957 -874
  103. data/po/de.po +990 -869
  104. data/po/el.po +989 -869
  105. data/po/es.po +985 -865
  106. data/po/fr.po +986 -870
  107. data/po/ga.po +907 -823
  108. data/po/gl.po +981 -865
  109. data/po/it.po +986 -868
  110. data/po/ja.po +969 -853
  111. data/po/mk.po +983 -863
  112. data/po/nb.po +979 -863
  113. data/po/nl.po +983 -864
  114. data/po/pl.po +1017 -974
  115. data/po/pt.po +988 -861
  116. data/po/pt_BR.po +984 -868
  117. data/po/ru.po +992 -873
  118. data/po/sk.po +987 -869
  119. data/po/sv.po +977 -861
  120. data/po/uk.po +975 -865
  121. data/po/zh_TW.po +976 -860
  122. data/schemas/alexandria.schemas +25 -3
  123. data/share/alexandria/glade/acquire_dialog__builder.glade +15 -12
  124. data/share/alexandria/glade/book_properties_dialog__builder.glade +171 -299
  125. data/share/alexandria/glade/main_app__builder.glade +24 -33
  126. data/share/alexandria/glade/new_book_dialog__builder.glade +27 -59
  127. data/share/alexandria/glade/preferences_dialog__builder.glade +250 -290
  128. data/share/gnome/help/alexandria/C/introduction.xml +0 -8
  129. data/share/gnome/help/alexandria/C/searching.xml +1 -1
  130. data/share/gnome/help/alexandria/C/smart-libraries.xml +2 -2
  131. data/share/gnome/help/alexandria/C/working-with-libraries.xml +1 -1
  132. data/share/gnome/help/alexandria/fr/alexandria.xml +1 -1
  133. data/share/gnome/help/alexandria/ja/introduction.xml +0 -8
  134. data/share/gnome/help/alexandria/ja/smart-libraries.xml +1 -1
  135. data/spec/alexandria/book_providers/world_cat_provider_spec.rb +160 -0
  136. data/spec/alexandria/book_providers_spec.rb +75 -171
  137. data/spec/alexandria/book_spec.rb +12 -10
  138. data/spec/alexandria/console_spec.rb +27 -0
  139. data/spec/alexandria/export_library_spec.rb +130 -0
  140. data/spec/alexandria/library_spec.rb +128 -172
  141. data/spec/alexandria/library_store_spec.rb +37 -0
  142. data/spec/alexandria/preferences_spec.rb +44 -17
  143. data/spec/alexandria/scanners/cue_cat_spec.rb +52 -0
  144. data/spec/alexandria/smart_library_spec.rb +30 -25
  145. data/spec/alexandria/ui/about_dialog_spec.rb +14 -0
  146. data/spec/alexandria/ui/acquire_dialog_spec.rb +14 -0
  147. data/spec/alexandria/ui/alert_dialog_spec.rb +16 -0
  148. data/spec/alexandria/ui/bad_isbns_dialog_spec.rb +14 -0
  149. data/spec/alexandria/ui/book_properties_dialog_spec.rb +17 -0
  150. data/spec/alexandria/ui/confirm_erase_dialog_spec.rb +14 -0
  151. data/spec/alexandria/ui/conflict_while_copying_dialog_spec.rb +16 -0
  152. data/spec/alexandria/ui/error_dialog_spec.rb +14 -0
  153. data/spec/alexandria/ui/export_dialog_spec.rb +36 -0
  154. data/spec/alexandria/ui/icons_spec.rb +26 -0
  155. data/spec/alexandria/ui/iconview_spec.rb +7 -21
  156. data/spec/alexandria/ui/import_dialog_spec.rb +46 -0
  157. data/spec/alexandria/ui/keep_bad_isbn_dialog_spec.rb +17 -0
  158. data/spec/alexandria/ui/main_app_spec.rb +7 -34
  159. data/spec/alexandria/ui/new_book_dialog_manual_spec.rb +15 -0
  160. data/spec/alexandria/ui/new_book_dialog_spec.rb +22 -0
  161. data/spec/alexandria/ui/new_provider_dialog_spec.rb +30 -0
  162. data/spec/alexandria/ui/new_smart_library_dialog_spec.rb +39 -0
  163. data/spec/alexandria/ui/preferences_dialog_spec.rb +14 -0
  164. data/spec/alexandria/ui/provider_preferences_dialog_spec.rb +34 -0
  165. data/spec/alexandria/ui/really_delete_dialog_spec.rb +16 -0
  166. data/spec/alexandria/ui/sidepane_manager_spec.rb +15 -0
  167. data/spec/alexandria/ui/skip_entry_dialog_spec.rb +14 -0
  168. data/spec/alexandria/ui/smart_library_properties_dialog_spec.rb +49 -0
  169. data/spec/alexandria/ui/sound_spec.rb +2 -2
  170. data/spec/alexandria/ui/ui_manager_spec.rb +43 -20
  171. data/spec/end_to_end/basic_run_spec.rb +52 -0
  172. data/spec/spec_helper.rb +65 -33
  173. data/tasks/setup.rb +2 -2
  174. data/tasks/spec.rake +16 -3
  175. data/util/rake/fileinstall.rb +39 -35
  176. data/util/rake/gettextgenerate.rb +7 -7
  177. data/util/rake/omfgenerate.rb +7 -7
  178. metadata +178 -45
  179. data/dogtail/basic_run_test.py +0 -9
  180. data/lib/alexandria/book_providers/deastore.rb +0 -265
  181. data/lib/alexandria/book_providers/mcu.rb +0 -182
  182. data/lib/alexandria/book_providers/renaud.rb +0 -149
  183. data/lib/alexandria/ui/dialogs/about_dialog.rb +0 -61
  184. data/lib/alexandria/ui/dialogs/alert_dialog.rb +0 -72
  185. data/lib/alexandria/ui/dialogs/bad_isbns_dialog.rb +0 -51
  186. data/lib/alexandria/ui/dialogs/book_properties_dialog_base.rb +0 -426
  187. data/lib/alexandria/ui/dialogs/export_dialog.rb +0 -171
  188. data/lib/alexandria/ui/dialogs/import_dialog.rb +0 -196
  189. data/lib/alexandria/ui/dialogs/misc_dialogs.rb +0 -87
  190. data/lib/alexandria/ui/dialogs/new_book_dialog_manual.rb +0 -154
  191. data/lib/alexandria/ui/dialogs/new_smart_library_dialog.rb +0 -74
  192. data/lib/alexandria/ui/dialogs/preferences_dialog.rb +0 -568
  193. data/lib/alexandria/ui/dialogs/smart_library_properties_dialog.rb +0 -59
  194. data/lib/alexandria/ui/dialogs/smart_library_properties_dialog_base.rb +0 -420
  195. data/spec/alexandria/scanners/cuecat_spec.rb +0 -67
  196. data/spec/alexandria/ui/dialogs_spec.rb +0 -96
  197. data/spec/alexandria/ui/sidepane_spec.rb +0 -29
  198. data/spec/alexandria/ui/ui_utilities_spec.rb +0 -62
  199. data/spec/alexandria/utilities_spec.rb +0 -52
  200. data/tasks/dogtail.rake +0 -6
data/.simplecov CHANGED
@@ -1,4 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  SimpleCov.start do
2
- track_files 'lib/**/*.rb'
3
- add_filter '/spec/'
4
+ add_group "Main", "lib"
5
+ add_group "Specs", "spec"
6
+ enable_coverage :branch
4
7
  end
@@ -1,5 +1,55 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.7 / 2020-11-15
4
+
5
+ * Update Polish translation ([#88] by [Piotr Drąg][piotrdrag])
6
+ * Fix hiding of progress bar of import dialog
7
+ * Fix calendar popups in Smart Library and Book Properties dialogs
8
+ * Fix crashes when activating Export and Import menu items
9
+
10
+ ## 0.7.6 / 2020-11-01
11
+
12
+ * Make more strings translatable with help from rubocop-i18n
13
+ * Code quality and testing infrastructure improvements
14
+ * Update Polish translation ([#51] and [#64], by [Piotr Drąg][piotrdrag])
15
+ * Update Dutch translation
16
+ * Make several dialogs that stopped appearing appear again
17
+ * Remove ability to enable and disable providers through a pop-up menu
18
+ * Fix New Library functionality
19
+ * Update dependencies on gtk3, gstreamer, and psych
20
+ * Fix issues in preferences, smart library dialog, and book selection
21
+ * Improve installation instructions
22
+ * Improve README ([#83] by [Happy][HappyFacade])
23
+
24
+ ## 0.7.5 / 2020-05-11
25
+
26
+ * Avoid crash when opening Import dialog
27
+ * Avoid crash during export
28
+ * Add support for Ruby 2.7
29
+ * Drop support for Ruby 2.4
30
+ * Remove broken Renaud provider
31
+
32
+ ## 0.7.4 / 2019-10-24
33
+
34
+ * Drop support for Ruby 2.3
35
+ * Avoid passing nil to Gtk method #visible=, which expects a boolean
36
+ ([#22], by [Joseph Haig][jrmhaig])
37
+ * Update dependencies on gtk3 and gstreamer to 3.4.1
38
+ * Fix WorldCat provider to use https
39
+
40
+ ## 0.7.3 / 2019-02-27
41
+
42
+ * Remove DeaStore provider since the site is no longer online
43
+ * Remove MCU provider since the site is no longer online
44
+ * Various code cleanups
45
+ * Update dependencies on `gstreamer`, `gtk3` and `image_size`
46
+ * Call `#set_active` with `false` instead of `nil` (Fixes [#19])
47
+ * Spec and fix export functionality
48
+ * Do not hard-code storage location
49
+ * Silence some Gtk+ warnings
50
+ * Fix setup of default scanner when no scanner is configured
51
+ * Update `YAML.safe_load` calls to new API, silencing deprecation warnings
52
+
3
53
  ## 0.7.2 / 2018-03-18
4
54
 
5
55
  * Update dependencies
@@ -50,3 +100,16 @@
50
100
  * Amazon queries now use a Associate Tag, a new requirement of
51
101
  Amazon's Product Advertising API. Thanks to Stephen McCamant for
52
102
  providing the patch.
103
+
104
+ <!-- contributors -->
105
+ [jrmhaig]: https://github.com/jrmhaig
106
+ [piotrdrag]: https://github.com/piotrdrag
107
+ [HappyFacade]: https://github.com/HappyFacade
108
+
109
+ <!-- issues and pull requests -->
110
+ [#88]: https://github.com/mvz/alexandria-book-collection-manager/pull/88
111
+ [#83]: https://github.com/mvz/alexandria-book-collection-manager/pull/83
112
+ [#64]: https://github.com/mvz/alexandria-book-collection-manager/pull/64
113
+ [#51]: https://github.com/mvz/alexandria-book-collection-manager/pull/51
114
+ [#23]: https://github.com/mvz/alexandria-book-collection-manager/pull/23
115
+ [#19]: https://github.com/mvz/alexandria-book-collection-manager/issues/19
data/Gemfile CHANGED
@@ -1,11 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source 'https://rubygems.org'
3
+ source "https://rubygems.org"
4
4
 
5
5
  # The gem's dependencies are specified in the gemspec
6
6
  gemspec
7
7
 
8
8
  group :development, :test do
9
- gem 'simplecov'
10
- gem 'yard', '~> 0.9.5'
9
+ gem "pry"
10
+ gem "simplecov"
11
+ gem "yard", "~> 0.9.5"
11
12
  end
data/INSTALL.md CHANGED
@@ -26,13 +26,13 @@ Requires version `~> 3.1`.
26
26
  ### Hpricot
27
27
 
28
28
  Alexandria uses [hpricot](https://github.com/hpricot/hpricot) to
29
- parse the HTML from web pages for providers such as DeaStore and
30
- Siciliano. It is also used to parse the XML for the Amazon web
29
+ parse the HTML from web pages for providers such as Siciliano.
30
+ It is also used to parse the XML for the Amazon web
31
31
  service.
32
32
 
33
33
  ## HTMLEntities
34
34
 
35
- This is used by all website-based providers except MCU.
35
+ This is used by all website-based providers.
36
36
  [htmlentities](https://github.com/threedaymonk/htmlentities) is used to
37
37
  provide more flexible HTML parsing.
38
38
 
@@ -56,23 +56,35 @@ to merge translations into generated files (and to extract
56
56
  translatable string from xml files during development).
57
57
 
58
58
  Note that these files are pre-generated in tar.gz releases, so you'll
59
- only need them if you're building from the SVN version, or want to
59
+ only need them if you're building from the Git version, or want to
60
60
  change the translations.
61
61
 
62
+ For support of the Z38.50 protocol you will need the
63
+ [`yaz`](http://www.indexdata.dk/yaz) package.
64
+
65
+ Alexandria also uses the outdate gconf2 configuration storage system, so you'll
66
+ need to install `gconf2`.
67
+
68
+ On Debian/Ubuntu systems, you can install the needed dependencies by running
69
+
70
+ ```
71
+ apt-get install gettext intltool libyaz-dev gconf2
72
+ ```
73
+
62
74
  ### Ruby/ZOOM and Yaz
63
75
 
64
- For Z39.50 support and and the *Library of Congress* and
65
- *British Library* book providers you will need
66
- [`ruby-zoom`](http://ruby-zoom.rubyforge.org), which in turn
67
- requires the non-Ruby package [`yaz`](http://www.indexdata.dk/yaz).
76
+ For Z39.50 support and the *Library of Congress* and *British Library* book
77
+ providers you will need [`ruby-zoom`](http://ruby-zoom.rubyforge.org), which in
78
+ turn requires the non-Ruby package [`yaz`](http://www.indexdata.dk/yaz) (see
79
+ Native Dependencies above).
68
80
 
69
- Note that if you install the recent Ruby/ZOOM as the `zoom` gem, you
70
- will also need to install the `marc` gem. (Older implementations of
71
- ruby-zoom contained their own implementation of MARC.)
81
+ Note that if you install the recent Ruby/ZOOM as the `zoom` gem, you will also
82
+ need to install the `marc` gem. (Older implementations of ruby-zoom contained
83
+ their own implementation of MARC.)
72
84
 
73
- The Z39.50 Object-Orientation Model (ZOOM) is an international
74
- standard for communication between computer systems, particularly
75
- libraries and information-related systems.
85
+ The Z39.50 Object-Orientation Model (ZOOM) is an international standard for
86
+ communication between computer systems, particularly libraries and
87
+ information-related systems.
76
88
 
77
89
  ### image_size
78
90
 
data/README.md CHANGED
@@ -4,7 +4,7 @@ Alexandria is a GNOME application for managing collections of books.
4
4
 
5
5
  Alexandria is written in Ruby, and is free software, distributed under
6
6
  the terms of the GNU General Public License, version 2 or later. See
7
- the file COPYING for more information.
7
+ the file [COPYING](COPYING) for more information.
8
8
 
9
9
  What is Alexandria?
10
10
  ===================
@@ -39,50 +39,50 @@ Alexandria is a simple program designed to allow individuals to keep a
39
39
  catalogue of their book collection. In addition, it enables users to
40
40
  keep track of books which are on loan.
41
41
 
42
- * retrieves and displays book information (sometimes with cover
43
- pictures) from several online libraries and bookshops, such as
44
- o Amazon
45
- o Proxis
46
- o DeaStore
47
- o AdLibris
48
- o Spanish Ministry of Culture
49
- o Livraria Siciliano
50
- o WorldCat
51
- o US Library of Congress
52
- o British Library
53
- * allows books to be added and updated by hand
54
- * enables searches either by ISBN, title, author or keyword
55
- * supports the Z39.50 standard and allow you to manage your own
56
- sources (e.g. university libraries)
57
- * saves data using the plain-text YAML format
58
- * can import and export data into ONIX, Tellico, ISBN-list
59
- and GoodReads CSV formats
60
- * can export XHTML web pages of your libraries, themable with CSS
61
- * allows marking your books as loaned, each with the loan-date and
62
- the name of the person who has borrowed them
63
- * features a HIG-compliant user interface
64
- * shows books in different views (standard list or icons list),
65
- that can be filtered and/or sorted
66
- * handles book rating and notes
67
- * supports CueCat and standard "keyboard wedge" barcode readers
68
- * includes translations for several languages
69
- * is documented in a complete manual (at the moment only in
70
- English and Japanese)
71
-
72
- Alexandria is not without problems. See doc/BUGS for a summary of issues.
42
+ * retrieves and displays book information (sometimes with cover
43
+ pictures) from several online libraries and bookshops, such as
44
+ - Amazon
45
+ - Proxis
46
+ - AdLibris
47
+ - Spanish Ministry of Culture
48
+ - Livraria Siciliano
49
+ - WorldCat
50
+ - US Library of Congress
51
+ - British Library
52
+ * allows books to be added and updated by hand
53
+ * enables searches either by ISBN, title, author or keyword
54
+ * supports the Z39.50 standard and allow you to manage your own
55
+ sources (e.g. university libraries)
56
+ * saves data using the plain-text YAML format
57
+ * can import and export data into ONIX, Tellico, ISBN-list
58
+ and GoodReads CSV formats
59
+ * can export XHTML web pages of your libraries, themable with CSS
60
+ * allows marking your books as loaned, each with the loan-date and
61
+ the name of the person who has borrowed them
62
+ * features a HIG-compliant user interface
63
+ * shows books in different views (standard list or icons list),
64
+ that can be filtered and/or sorted
65
+ * handles book rating and notes
66
+ * supports CueCat and standard "keyboard wedge" barcode readers
67
+ * includes translations for several languages
68
+ * is documented in a complete manual (at the moment only in
69
+ English and Japanese)
70
+
71
+ Alexandria is not without problems. See [doc/BUGS](doc/BUGS) for a
72
+ summary of issues.
73
73
 
74
74
  ## Installation
75
75
 
76
76
  There are full instructions for installing Alexandria from source in the
77
- file INSTALL, including information about all the dependencies.
77
+ file [INSTALL](INSTALL), including information about all the dependencies.
78
78
 
79
79
  If you are installing on a Debian-based system, things should be
80
80
  easier as the dependencies can be handled automatically.
81
81
 
82
82
  To run the program, just type
83
- alexandria
83
+ `alexandria`
84
84
  or, to get verbose debugging information,
85
- alexandria --debug
85
+ `alexandria --debug`
86
86
 
87
87
  If you are running GNOME, Alexandria should appear under the
88
88
  'Applications > Office' menu.
@@ -100,6 +100,7 @@ The following people have contributed to Alexandria over the years:
100
100
  * Constantine Evans <cevans@costinet.org>
101
101
  * Dafydd Harries <daf@muse.19inch.net>
102
102
  * Javier Fernandez-Sanguino Pena <jfs@debian.org>
103
+ * Joseph Haig <josephhaig@gmail.com>
103
104
  * Joseph Method <tristil@gmail.com>
104
105
  * Kevin Schultz <schultkl@ieee.org>
105
106
  * Laurent Sansonetti <lrz@gnome.org>
@@ -120,6 +121,11 @@ The following people have contributed to Alexandria over the years:
120
121
  * Cathal Mc Ginley <cathal.alexandria@gnostai.org>
121
122
  * Liam Davison <registrations@liamjdavison.info>
122
123
 
124
+ ### Artists
125
+
126
+ * Andreas Nilsson <nisses.mail@home.se>
127
+ * Stefanie Dijoux <stefanie.dijoux@gmail.com>
128
+
123
129
  ### Translators
124
130
 
125
131
  * Adrián Chaves Fernández <adriyetichaves@gmail.com> (gl)
@@ -141,20 +147,24 @@ The following people have contributed to Alexandria over the years:
141
147
  * Piotr Drąg <piotrdrag@gmail.com> (pl)
142
148
  * Serhij Dubyk <dubyk@library.lviv.ua> (uk)
143
149
 
144
- ### Artists
145
-
146
- * Andreas Nilsson <nisses.mail@home.se>
147
- * Stefanie Dijoux <stefanie.dijoux@gmail.com>
150
+ ### Former translators
151
+ * David Weinehall <tao@debian.org> (sv)
152
+ * Jiří Pejchal <jiri.pejchal@gmail.com> (cs)
153
+ * Laurent Sansonetti <lrz@gnome.org> (fr)
154
+ * Lucas Rocha <lucasr@im.ufba.br> (pt_BR)
155
+ * Marco Costantini <costanti@science.unitn.it> (it)
156
+ * Masao Mutoh <mutoh@highway.ne.jp> (ja)
157
+ * Mirko Maischberger <mirko@lilik.it> (it)
148
158
 
149
159
  ## License
150
160
 
151
161
  Unless otherwise noted, the following license applies to all files that are
152
162
  part of Alexandria:
153
163
 
154
- Copyright (C) 2004-2006 Laurent Sansonetti
155
- Copyright (C) 2007-2010,2014-2016 Alexandria Contributors
164
+ Copyright (C) 2004 Laurent Sansonetti
165
+ Copyright (C) 2005-2010,2014-2020 Alexandria Contributors
156
166
 
157
167
  Alexandria is free software; you can redistribute it and/or modify it under the
158
168
  terms of the GNU General Public License as published by the Free Software
159
169
  Foundation; either version 2 of the License, or (at your option) any later
160
- version. See the file COPYING for details.
170
+ version. See the file [COPYING](COPYING) for details.
data/Rakefile CHANGED
@@ -1,81 +1,58 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # -*- ruby -*-
4
- #--
5
- # Copyright (C) 2009 Cathal Mc Ginley
6
- # Copyright (C) 2011, 2014, 2016 Matijs van Zuijlen
7
- #
8
3
  # This file is part of the Alexandria build system.
9
4
  #
10
- # Permission is hereby granted, free of charge, to any person obtaining
11
- # a copy of this software and associated documentation files (the
12
- # "Software"), to deal in the Software without restriction, including
13
- # without limitation the rights to use, copy, modify, merge, publish,
14
- # distribute, sublicense, and/or sell copies of the Software, and to
15
- # permit persons to whom the Software is furnished to do so, subject to
16
- # the following conditions:
17
- #
18
- # The above copyright notice and this permission notice shall be
19
- # included in all copies or substantial portions of the Software.
20
- #
21
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25
- # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26
- # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27
- # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
- #++
5
+ # See the file README.md for authorship and licensing information.
29
6
 
30
- load 'tasks/setup.rb'
7
+ load "tasks/setup.rb"
31
8
 
32
- require 'rake/packagetask'
9
+ require "rake/packagetask"
33
10
 
34
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'util/rake'))
35
- require 'fileinstall'
36
- require 'gettextgenerate'
37
- require 'omfgenerate'
11
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "util/rake"))
12
+ require "fileinstall"
13
+ require "gettextgenerate"
14
+ require "omfgenerate"
38
15
 
39
- require_relative 'lib/alexandria/version'
16
+ require_relative "lib/alexandria/version"
40
17
 
41
- stage_dir = ENV['DESTDIR'] || 'tmp'
42
- prefix_dir = ENV['PREFIX'] || '/usr'
18
+ stage_dir = ENV["DESTDIR"] || "tmp"
19
+ prefix_dir = ENV["PREFIX"] || "/usr"
43
20
 
44
- PROJECT = 'alexandria'
21
+ PROJECT = "alexandria"
45
22
  PREFIX = prefix_dir
46
- share_dir = ENV['SHARE'] || "#{PREFIX}/share"
23
+ share_dir = ENV["SHARE"] || "#{PREFIX}/share"
47
24
  SHARE = share_dir
48
25
 
49
26
  GettextGenerateTask.new(PROJECT) do |g|
50
- g.generate_po_files('po', 'po/*.po', 'share/locale')
51
- g.generate_desktop('alexandria.desktop.in', 'alexandria.desktop')
27
+ g.generate_po_files("po", "po/*.po", "share/locale")
28
+ g.generate_desktop("alexandria.desktop.in", "alexandria.desktop")
52
29
  end
53
30
 
54
31
  OmfGenerateTask.new(PROJECT) do |o|
55
32
  o.gnome_helpfiles_dir = "#{SHARE}/gnome/help"
56
- o.generate_omf('data/omf/alexandria', 'share/omf/alexandria/*.in')
33
+ o.generate_omf("data/omf/alexandria", "share/omf/alexandria/*.in")
57
34
  end
58
35
 
59
- SHARE_FILE_GLOBS = ['data/alexandria/**/*', 'data/gnome/**/*.*',
60
- 'data/locale/**/*.mo', 'data/omf/**/*.omf',
61
- 'data/sounds/**/*.ogg'].freeze # , 'data/menu/*']
36
+ SHARE_FILE_GLOBS = ["data/alexandria/**/*", "data/gnome/**/*.*",
37
+ "data/locale/**/*.mo", "data/omf/**/*.omf",
38
+ "data/sounds/**/*.ogg"].freeze # , 'data/menu/*']
62
39
 
63
- ICON_FILE_GLOBS = ['data/app-icon/**/*.png',
64
- 'data/app-icon/scalable/*.svg'].freeze
40
+ ICON_FILE_GLOBS = ["data/app-icon/**/*.png",
41
+ "data/app-icon/scalable/*.svg"].freeze
65
42
 
66
- PIXMAP_GLOBS = 'data/app-icon/32x32/*.xpm'
43
+ PIXMAP_GLOBS = "data/app-icon/32x32/*.xpm"
67
44
 
68
45
  def install_common(install_task)
69
- install_task.install_exe('bin', 'bin/*', "#{PREFIX}/bin")
70
- install_task.install('lib', 'lib/**/*.rb', install_task.rubylib)
46
+ install_task.install_exe("bin", "bin/*", "#{PREFIX}/bin")
47
+ install_task.install("lib", "lib/**/*.rb", install_task.rubylib)
71
48
 
72
- install_task.install('data', SHARE_FILE_GLOBS, SHARE)
49
+ install_task.install("data", SHARE_FILE_GLOBS, SHARE)
73
50
  install_task.install_icons(ICON_FILE_GLOBS, "#{SHARE}/icons")
74
- install_task.install('data/app-icon/32x32', PIXMAP_GLOBS, "#{SHARE}/pixmaps")
51
+ install_task.install("data/app-icon/32x32", PIXMAP_GLOBS, "#{SHARE}/pixmaps")
75
52
 
76
- install_task.install('', 'schemas/alexandria.schemas', "#{SHARE}/gconf")
77
- install_task.install('', 'alexandria.desktop', "#{SHARE}/applications")
78
- install_task.install('doc', 'doc/alexandria.1', "#{SHARE}/man/man1")
53
+ install_task.install("", "schemas/alexandria.schemas", "#{SHARE}/gconf")
54
+ install_task.install("", "alexandria.desktop", "#{SHARE}/applications")
55
+ install_task.install("doc", "doc/alexandria.1", "#{SHARE}/man/man1")
79
56
  end
80
57
 
81
58
  FileInstallTask.new(:package_staging, stage_dir, true) do |i|
@@ -88,10 +65,10 @@ FileInstallTask.new(:package) do |j|
88
65
  install_common(j)
89
66
 
90
67
  docs = %w(README.rdoc CHANGELOG.md INSTALL.md COPYING TODO.md)
91
- devel_docs = ['doc/AUTHORS', 'doc/BUGS', 'doc/FAQ',
92
- 'doc/cuecat_support.rdoc']
93
- j.install('', docs, "#{SHARE}/doc/#{PROJECT}")
94
- j.install('doc', devel_docs, "#{SHARE}/doc/#{PROJECT}")
68
+ devel_docs = ["doc/AUTHORS", "doc/BUGS", "doc/FAQ",
69
+ "doc/cuecat_support.rdoc"]
70
+ j.install("", docs, "#{SHARE}/doc/#{PROJECT}")
71
+ j.install("doc", devel_docs, "#{SHARE}/doc/#{PROJECT}")
95
72
 
96
73
  j.uninstall_empty_dirs(["#{SHARE}/**/#{PROJECT}/",
97
74
  "#{j.rubylib}/#{PROJECT}/"])
@@ -106,14 +83,14 @@ end
106
83
  def autogen_comment
107
84
  lines = [
108
85
  "This file is automatically generated by the #{PROJECT} installer.",
109
- 'Do not edit it directly.'
86
+ "Do not edit it directly."
110
87
  ]
111
88
  result = lines.map { |line| "# #{line}" }
112
89
  result.join("\n") + "\n\n"
113
90
  end
114
91
 
115
92
  def generate(filename)
116
- File.open(filename, 'w') do |file|
93
+ File.open(filename, "w") do |file|
117
94
  puts "Generating #{filename}"
118
95
  file.print autogen_comment
119
96
  file_contents = yield
@@ -124,71 +101,75 @@ end
124
101
  # generate default_preferences.rb
125
102
  def convert_with_type(value, type)
126
103
  case type
127
- when 'int'
104
+ when "int"
128
105
  value.to_i
129
- when 'float'
106
+ when "float"
130
107
  value.to_f
131
- when 'bool'
132
- value == 'true'
108
+ when "bool"
109
+ value == "true"
110
+ when "string"
111
+ value.to_s.strip
133
112
  else
134
- value.strip
113
+ raise NotImplementedError, "Unknown type #{type}"
135
114
  end
136
115
  end
137
116
 
138
- SCHEMA_PATH = 'schemas/alexandria.schemas'
117
+ SCHEMA_PATH = "schemas/alexandria.schemas"
139
118
 
140
119
  # This generates default_preferences.rb by copying over values from
141
120
  # providers_priority key in alexandria.schemas (necessary?)
142
121
 
143
- file 'lib/alexandria/default_preferences.rb' => [SCHEMA_PATH] do |f|
144
- require 'rexml/document'
122
+ file "lib/alexandria/default_preferences.rb" => ["Rakefile", SCHEMA_PATH] do |f|
123
+ require "rexml/document"
145
124
  generated_lines = []
146
125
 
147
126
  doc = REXML::Document.new(IO.read(SCHEMA_PATH))
148
- doc.elements.each('gconfschemafile/schemalist/schema') do |element|
149
- default = element.elements['default'].text
150
- next unless default
151
- varname = File.basename(element.elements['key'].text)
152
- type = element.elements['type'].text
153
-
154
- if (type == 'list') || (type == 'pair')
155
- ary = default[1..-2].split(',')
127
+ doc.elements.each("gconfschemafile/schemalist/schema") do |element|
128
+ default = element.elements["default"].text
129
+
130
+ varname = File.basename(element.elements["key"].text)
131
+ type = element.elements["type"].text
132
+
133
+ if (type == "list") || (type == "pair")
134
+ ary = default[1..-2].split(",")
156
135
  next if ary.empty?
157
- if type == 'list'
158
- list_type = element.elements['list_type'].text
136
+
137
+ case type
138
+ when "list"
139
+ list_type = element.elements["list_type"].text
159
140
  ary.map! { |x| convert_with_type(x, list_type) }
160
- elsif type == 'pair'
141
+ when "pair"
161
142
  next if ary.length != 2
143
+
162
144
  ary[0] = convert_with_type(ary[0],
163
- element.elements['car_type'].text)
145
+ element.elements["car_type"].text)
164
146
  ary[1] = convert_with_type(ary[1],
165
- element.elements['cdr_type'].text)
147
+ element.elements["cdr_type"].text)
166
148
  end
167
149
  default = ary.inspect
168
150
  else
169
151
  default = convert_with_type(default, type).inspect.to_s
170
152
  end
171
153
 
172
- generated_lines << varname.inspect + ' => ' + default
154
+ generated_lines << varname.inspect + " => " + default
173
155
  end
174
156
 
175
157
  generate(f.name) do
176
- <<EOS
177
- module Alexandria
178
- class Preferences
179
- DEFAULT_VALUES = {
180
- #{generated_lines.join(",\n ")}
181
- }
182
- end
183
- end
184
- EOS
158
+ <<~EOS
159
+ module Alexandria
160
+ class Preferences
161
+ DEFAULT_VALUES = {
162
+ #{generated_lines.join(",\n ")}
163
+ }
164
+ end
165
+ end
166
+ EOS
185
167
  end
186
168
  end
187
169
 
188
- autogenerated_files = ['lib/alexandria/config.rb',
189
- 'lib/alexandria/default_preferences.rb']
170
+ autogenerated_files = ["lib/alexandria/default_preferences.rb"]
190
171
 
191
- desc 'Generate ruby files needed for the installation'
172
+ desc "Generate ruby files needed for the installation"
192
173
  task autogen: autogenerated_files
193
174
 
194
175
  task :autogen_clobber do |_t|
@@ -217,13 +198,13 @@ end
217
198
 
218
199
  Rake::PackageTask.new(PROJECT, Alexandria::DISPLAY_VERSION) do |p|
219
200
  p.need_tar_gz = true
220
- p.package_files.include('README.md', 'COPYING', 'CHANGELOG.md', 'INSTALL.md',
221
- 'Rakefile', 'util/**/*',
222
- 'TODO.md', 'alexandria.desktop',
223
- 'alexandria.desktop.in',
224
- 'bin/**/*', 'data/**/*', 'misc/**/*',
225
- 'doc/**/*', 'lib/**/*', 'po/**/*',
226
- 'schemas/**/*', 'spec/**/*')
201
+ p.package_files.include("README.md", "COPYING", "CHANGELOG.md", "INSTALL.md",
202
+ "Rakefile", "util/**/*",
203
+ "TODO.md", "alexandria.desktop",
204
+ "alexandria.desktop.in",
205
+ "bin/**/*", "data/**/*", "misc/**/*",
206
+ "doc/**/*", "lib/**/*", "po/**/*",
207
+ "schemas/**/*", "spec/**/*")
227
208
  end
228
209
 
229
210
  task tgz: [:build] do
@@ -234,34 +215,37 @@ end
234
215
 
235
216
  task pre_install: [:build]
236
217
  task :scrollkeeper do
237
- unless system('which scrollkeeper-update')
238
- raise 'scrollkeeper-update cannot be found, is Scrollkeeper correctly installed?'
218
+ unless system("which scrollkeeper-update")
219
+ raise "scrollkeeper-update cannot be found, is Scrollkeeper correctly installed?"
239
220
  end
240
- system('scrollkeeper-update -q') || raise('Scrollkeeper update failed')
221
+
222
+ system("scrollkeeper-update -q") || raise("Scrollkeeper update failed")
241
223
  end
242
224
 
243
225
  task :gconf do
244
- return if ENV['GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL']
226
+ return if ENV["GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL"]
245
227
 
246
- raise 'gconftool-2 cannot be found, is GConf2 correctly installed?' unless system('which gconftool-2')
228
+ unless system("which gconftool-2")
229
+ raise "gconftool-2 cannot be found, is GConf2 correctly installed?"
230
+ end
247
231
 
248
- ENV['GCONF_CONFIG_SOURCE'] = `gconftool-2 --get-default-source`.chomp
249
- Dir['schemas/*.schemas'].each do |schema|
232
+ ENV["GCONF_CONFIG_SOURCE"] = `gconftool-2 --get-default-source`.chomp
233
+ Dir["schemas/*.schemas"].each do |schema|
250
234
  system("gconftool-2 --makefile-install-rule '#{schema}'")
251
235
  end
252
236
  # system("killall -HUP gconfd-2")
253
237
  end
254
238
 
255
239
  task :update_icon_cache do
256
- system('gtk-update-icon-cache -f -t /usr/share/icons/hicolor') # HACK
240
+ system("gtk-update-icon-cache -f -t /usr/share/icons/hicolor") # HACK
257
241
  end
258
242
 
259
243
  task post_install: [:scrollkeeper, :gconf, :update_icon_cache]
260
244
 
261
- desc 'Install Alexandria'
245
+ desc "Install Alexandria"
262
246
  task install: [:pre_install, :install_package, :post_install]
263
247
 
264
- desc 'Uninstall Alexandria'
248
+ desc "Uninstall Alexandria"
265
249
  task uninstall: [:uninstall_package] # TODO: gconf etc...
266
250
 
267
- task default: [:spec, :dogtail]
251
+ task default: [:spec]