alexandria-book-collection-manager 0.7.1 → 0.7.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/dependabot.yml +9 -0
- data/.gitignore +5 -2
- data/.hound.yml +2 -0
- data/.rubocop.yml +113 -45
- data/.rubocop_todo.yml +82 -170
- data/.simplecov +5 -1
- data/.travis.yml +45 -0
- data/.yardopts +1 -1
- data/CHANGELOG.md +60 -0
- data/ChangeLog.0 +33 -35
- data/Gemfile +6 -5
- data/INSTALL.md +164 -0
- data/README.md +52 -42
- data/Rakefile +95 -109
- data/TODO.md +9 -1
- data/alexandria-book-collection-manager.gemspec +52 -45
- data/bin/alexandria +31 -53
- data/doc/AUTHORS +61 -0
- data/doc/BUGS +31 -0
- data/doc/FAQ +365 -0
- data/doc/HACKING +19 -0
- data/doc/NEWS +341 -0
- data/doc/alexandria.1 +120 -0
- data/doc/cuecat_support.rdoc +67 -0
- data/doc/dependency_decisions.yml +80 -0
- data/lib/alexandria.rb +29 -37
- data/lib/alexandria/about.rb +52 -51
- data/lib/alexandria/book_providers.rb +94 -101
- data/lib/alexandria/book_providers/adlibris.rb +45 -85
- data/lib/alexandria/book_providers/amazon_aws.rb +105 -113
- data/lib/alexandria/book_providers/amazon_ecs_util.rb +293 -324
- data/lib/alexandria/book_providers/barnes_and_noble.rb +54 -53
- data/lib/alexandria/book_providers/douban.rb +29 -51
- data/lib/alexandria/book_providers/proxis.rb +42 -59
- data/lib/alexandria/book_providers/pseudomarc.rb +79 -99
- data/lib/alexandria/book_providers/siciliano.rb +68 -70
- data/lib/alexandria/book_providers/thalia.rb +46 -45
- data/lib/alexandria/book_providers/web.rb +17 -33
- data/lib/alexandria/book_providers/worldcat.rb +74 -102
- data/lib/alexandria/book_providers/z3950.rb +170 -174
- data/lib/alexandria/config.rb +5 -3
- data/lib/alexandria/console.rb +10 -21
- data/lib/alexandria/default_preferences.rb +37 -0
- data/lib/alexandria/execution_queue.rb +17 -15
- data/lib/alexandria/export_format.rb +47 -0
- data/lib/alexandria/export_library.rb +188 -302
- data/lib/alexandria/import_library.rb +114 -155
- data/lib/alexandria/import_library_csv.rb +46 -96
- data/lib/alexandria/library_collection.rb +79 -0
- data/lib/alexandria/library_sort_order.rb +45 -0
- data/lib/alexandria/library_store.rb +233 -0
- data/lib/alexandria/logging.rb +15 -19
- data/lib/alexandria/models/book.rb +15 -20
- data/lib/alexandria/models/library.rb +81 -363
- data/lib/alexandria/net.rb +7 -6
- data/lib/alexandria/preferences.rb +73 -91
- data/lib/alexandria/scanners.rb +4 -2
- data/lib/alexandria/scanners/{cuecat.rb → cue_cat.rb} +24 -20
- data/lib/alexandria/scanners/keyboard.rb +10 -8
- data/lib/alexandria/smart_library.rb +135 -171
- data/lib/alexandria/ui.rb +17 -15
- data/lib/alexandria/ui/about_dialog.rb +49 -0
- data/lib/alexandria/ui/{dialogs/acquire_dialog.rb → acquire_dialog.rb} +129 -152
- data/lib/alexandria/ui/alert_dialog.rb +64 -0
- data/lib/alexandria/ui/bad_isbns_dialog.rb +41 -0
- data/lib/alexandria/ui/{dialogs/barcode_animation.rb → barcode_animation.rb} +18 -15
- data/lib/alexandria/ui/{dialogs/book_properties_dialog.rb → book_properties_dialog.rb} +44 -61
- data/lib/alexandria/ui/{dialogs/book_properties_dialog_base.rb → book_properties_dialog_base.rb} +84 -89
- data/lib/alexandria/ui/builder_base.rb +9 -27
- data/lib/alexandria/ui/callbacks.rb +188 -186
- data/lib/alexandria/ui/columns.rb +2 -0
- data/lib/alexandria/ui/completion_models.rb +12 -23
- data/lib/alexandria/ui/confirm_erase_dialog.rb +33 -0
- data/lib/alexandria/ui/conflict_while_copying_dialog.rb +34 -0
- data/lib/alexandria/ui/dndable.rb +10 -8
- data/lib/alexandria/ui/error_dialog.rb +25 -0
- data/lib/alexandria/ui/export_dialog.rb +139 -0
- data/lib/alexandria/ui/icons.rb +49 -65
- data/lib/alexandria/ui/iconview.rb +15 -13
- data/lib/alexandria/ui/iconview_tooltips.rb +43 -58
- data/lib/alexandria/ui/import_dialog.rb +157 -0
- data/lib/alexandria/ui/init.rb +23 -33
- data/lib/alexandria/ui/keep_bad_isbn_dialog.rb +36 -0
- data/lib/alexandria/ui/libraries_combo.rb +18 -14
- data/lib/alexandria/ui/listview.rb +77 -88
- data/lib/alexandria/ui/main_app.rb +26 -26
- data/lib/alexandria/ui/misc_dialogs.rb +10 -0
- data/lib/alexandria/ui/multi_drag_treeview.rb +30 -41
- data/lib/alexandria/ui/{dialogs/new_book_dialog.rb → new_book_dialog.rb} +168 -215
- data/lib/alexandria/ui/new_book_dialog_manual.rb +139 -0
- data/lib/alexandria/ui/new_provider_dialog.rb +100 -0
- data/lib/alexandria/ui/new_smart_library_dialog.rb +74 -0
- data/lib/alexandria/ui/preferences_dialog.rb +313 -0
- data/lib/alexandria/ui/provider_preferences_base_dialog.rb +95 -0
- data/lib/alexandria/ui/provider_preferences_dialog.rb +35 -0
- data/lib/alexandria/ui/really_delete_dialog.rb +53 -0
- data/lib/alexandria/ui/{sidepane.rb → sidepane_manager.rb} +62 -72
- data/lib/alexandria/ui/skip_entry_dialog.rb +33 -0
- data/lib/alexandria/ui/smart_library_properties_dialog.rb +60 -0
- data/lib/alexandria/ui/{dialogs/smart_library_properties_dialog_base.rb → smart_library_properties_dialog_base.rb} +96 -172
- data/lib/alexandria/ui/smart_library_rule_box.rb +119 -0
- data/lib/alexandria/ui/sound.rb +13 -13
- data/lib/alexandria/ui/ui_manager.rb +262 -283
- data/lib/alexandria/undo_manager.rb +3 -0
- data/lib/alexandria/version.rb +6 -19
- data/lib/alexandria/web_themes.rb +24 -21
- data/po/Makefile +2 -2
- data/po/cs.po +993 -880
- data/po/cy.po +957 -874
- data/po/de.po +990 -869
- data/po/el.po +989 -869
- data/po/es.po +985 -865
- data/po/fr.po +986 -870
- data/po/ga.po +907 -823
- data/po/gl.po +981 -865
- data/po/it.po +986 -868
- data/po/ja.po +969 -853
- data/po/mk.po +983 -863
- data/po/nb.po +979 -863
- data/po/nl.po +983 -864
- data/po/pl.po +1020 -969
- data/po/pt.po +988 -861
- data/po/pt_BR.po +984 -868
- data/po/ru.po +992 -873
- data/po/sk.po +987 -869
- data/po/sv.po +977 -861
- data/po/uk.po +975 -865
- data/po/zh_TW.po +976 -860
- data/schemas/alexandria.schemas +25 -3
- data/share/alexandria/glade/acquire_dialog__builder.glade +15 -12
- data/share/alexandria/glade/book_properties_dialog__builder.glade +171 -299
- data/share/alexandria/glade/main_app__builder.glade +24 -33
- data/share/alexandria/glade/new_book_dialog__builder.glade +27 -59
- data/share/alexandria/glade/preferences_dialog__builder.glade +250 -290
- data/share/gnome/help/alexandria/C/introduction.xml +0 -8
- data/share/gnome/help/alexandria/C/searching.xml +1 -1
- data/share/gnome/help/alexandria/C/smart-libraries.xml +2 -2
- data/share/gnome/help/alexandria/C/working-with-libraries.xml +1 -1
- data/share/gnome/help/alexandria/fr/alexandria.xml +1 -1
- data/share/gnome/help/alexandria/ja/introduction.xml +0 -8
- data/share/gnome/help/alexandria/ja/smart-libraries.xml +1 -1
- data/spec/alexandria/book_providers/world_cat_provider_spec.rb +160 -0
- data/spec/alexandria/book_providers_spec.rb +77 -210
- data/spec/alexandria/book_spec.rb +16 -12
- data/spec/alexandria/console_spec.rb +27 -0
- data/spec/alexandria/export_library_spec.rb +130 -0
- data/spec/alexandria/library_spec.rb +130 -172
- data/spec/alexandria/library_store_spec.rb +37 -0
- data/spec/alexandria/preferences_spec.rb +46 -17
- data/spec/alexandria/scanners/cue_cat_spec.rb +52 -0
- data/spec/alexandria/smart_library_spec.rb +32 -25
- data/spec/alexandria/ui/about_dialog_spec.rb +14 -0
- data/spec/alexandria/ui/acquire_dialog_spec.rb +14 -0
- data/spec/alexandria/ui/alert_dialog_spec.rb +16 -0
- data/spec/alexandria/ui/bad_isbns_dialog_spec.rb +14 -0
- data/spec/alexandria/ui/book_properties_dialog_spec.rb +17 -0
- data/spec/alexandria/ui/confirm_erase_dialog_spec.rb +14 -0
- data/spec/alexandria/ui/conflict_while_copying_dialog_spec.rb +16 -0
- data/spec/alexandria/ui/error_dialog_spec.rb +14 -0
- data/spec/alexandria/ui/export_dialog_spec.rb +15 -0
- data/spec/alexandria/ui/icons_spec.rb +26 -0
- data/spec/alexandria/ui/iconview_spec.rb +9 -21
- data/spec/alexandria/ui/import_dialog_spec.rb +41 -0
- data/spec/alexandria/ui/keep_bad_isbn_dialog_spec.rb +17 -0
- data/spec/alexandria/ui/main_app_spec.rb +8 -33
- data/spec/alexandria/ui/new_book_dialog_manual_spec.rb +15 -0
- data/spec/alexandria/ui/new_book_dialog_spec.rb +22 -0
- data/spec/alexandria/ui/new_provider_dialog_spec.rb +30 -0
- data/spec/alexandria/ui/new_smart_library_dialog_spec.rb +39 -0
- data/spec/alexandria/ui/preferences_dialog_spec.rb +14 -0
- data/spec/alexandria/ui/provider_preferences_dialog_spec.rb +34 -0
- data/spec/alexandria/ui/really_delete_dialog_spec.rb +16 -0
- data/spec/alexandria/ui/sidepane_manager_spec.rb +15 -0
- data/spec/alexandria/ui/skip_entry_dialog_spec.rb +14 -0
- data/spec/alexandria/ui/smart_library_properties_dialog_spec.rb +32 -0
- data/spec/alexandria/ui/sound_spec.rb +4 -2
- data/spec/alexandria/ui/ui_manager_spec.rb +45 -20
- data/spec/end_to_end/basic_run_spec.rb +57 -0
- data/spec/spec_helper.rb +66 -33
- data/tasks/setup.rb +5 -3
- data/tasks/spec.rake +18 -3
- data/util/rake/fileinstall.rb +38 -40
- data/util/rake/gettextgenerate.rb +15 -70
- data/util/rake/omfgenerate.rb +10 -10
- metadata +176 -60
- data/INSTALL.rdoc +0 -148
- data/dogtail/basic_run_test.py +0 -9
- data/lib/alexandria/book_providers/bol_it.rb +0 -160
- data/lib/alexandria/book_providers/deastore.rb +0 -273
- data/lib/alexandria/book_providers/ibs_it.rb +0 -147
- data/lib/alexandria/book_providers/mcu.rb +0 -169
- data/lib/alexandria/book_providers/renaud.rb +0 -140
- data/lib/alexandria/book_providers/webster_it.rb +0 -167
- data/lib/alexandria/ui/dialogs/about_dialog.rb +0 -59
- data/lib/alexandria/ui/dialogs/alert_dialog.rb +0 -70
- data/lib/alexandria/ui/dialogs/bad_isbns_dialog.rb +0 -43
- data/lib/alexandria/ui/dialogs/export_dialog.rb +0 -171
- data/lib/alexandria/ui/dialogs/import_dialog.rb +0 -196
- data/lib/alexandria/ui/dialogs/misc_dialogs.rb +0 -85
- data/lib/alexandria/ui/dialogs/new_book_dialog_manual.rb +0 -154
- data/lib/alexandria/ui/dialogs/new_smart_library_dialog.rb +0 -74
- data/lib/alexandria/ui/dialogs/preferences_dialog.rb +0 -578
- data/lib/alexandria/ui/dialogs/smart_library_properties_dialog.rb +0 -57
- data/spec/alexandria/scanners/cuecat_spec.rb +0 -65
- data/spec/alexandria/ui/dialogs_spec.rb +0 -94
- data/spec/alexandria/ui/sidepane_spec.rb +0 -27
- data/spec/alexandria/ui/ui_utilities_spec.rb +0 -60
- data/spec/alexandria/utilities_spec.rb +0 -50
- data/tasks/dogtail.rake +0 -4
data/Rakefile
CHANGED
@@ -1,79 +1,58 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
# Copyright (C) 2009 Cathal Mc Ginley
|
4
|
-
# Copyright (C) 2011, 2014, 2016 Matijs van Zuijlen
|
5
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
6
3
|
# This file is part of the Alexandria build system.
|
7
4
|
#
|
8
|
-
#
|
9
|
-
# a copy of this software and associated documentation files (the
|
10
|
-
# "Software"), to deal in the Software without restriction, including
|
11
|
-
# without limitation the rights to use, copy, modify, merge, publish,
|
12
|
-
# distribute, sublicense, and/or sell copies of the Software, and to
|
13
|
-
# permit persons to whom the Software is furnished to do so, subject to
|
14
|
-
# the following conditions:
|
15
|
-
#
|
16
|
-
# The above copyright notice and this permission notice shall be
|
17
|
-
# included in all copies or substantial portions of the Software.
|
18
|
-
#
|
19
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
20
|
-
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
21
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
22
|
-
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
23
|
-
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
24
|
-
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
25
|
-
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
26
|
-
#++
|
5
|
+
# See the file README.md for authorship and licensing information.
|
27
6
|
|
28
|
-
load
|
7
|
+
load "tasks/setup.rb"
|
29
8
|
|
30
|
-
require
|
9
|
+
require "rake/packagetask"
|
31
10
|
|
32
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__),
|
33
|
-
require
|
34
|
-
require
|
35
|
-
require
|
11
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "util/rake"))
|
12
|
+
require "fileinstall"
|
13
|
+
require "gettextgenerate"
|
14
|
+
require "omfgenerate"
|
36
15
|
|
37
|
-
require_relative
|
16
|
+
require_relative "lib/alexandria/version"
|
38
17
|
|
39
|
-
stage_dir = ENV[
|
40
|
-
prefix_dir = ENV[
|
18
|
+
stage_dir = ENV["DESTDIR"] || "tmp"
|
19
|
+
prefix_dir = ENV["PREFIX"] || "/usr"
|
41
20
|
|
42
|
-
PROJECT =
|
21
|
+
PROJECT = "alexandria"
|
43
22
|
PREFIX = prefix_dir
|
44
|
-
share_dir = ENV[
|
23
|
+
share_dir = ENV["SHARE"] || "#{PREFIX}/share"
|
45
24
|
SHARE = share_dir
|
46
25
|
|
47
26
|
GettextGenerateTask.new(PROJECT) do |g|
|
48
|
-
g.generate_po_files(
|
49
|
-
g.generate_desktop(
|
27
|
+
g.generate_po_files("po", "po/*.po", "share/locale")
|
28
|
+
g.generate_desktop("alexandria.desktop.in", "alexandria.desktop")
|
50
29
|
end
|
51
30
|
|
52
31
|
OmfGenerateTask.new(PROJECT) do |o|
|
53
32
|
o.gnome_helpfiles_dir = "#{SHARE}/gnome/help"
|
54
|
-
o.generate_omf(
|
33
|
+
o.generate_omf("data/omf/alexandria", "share/omf/alexandria/*.in")
|
55
34
|
end
|
56
35
|
|
57
|
-
SHARE_FILE_GLOBS = [
|
58
|
-
|
59
|
-
|
36
|
+
SHARE_FILE_GLOBS = ["data/alexandria/**/*", "data/gnome/**/*.*",
|
37
|
+
"data/locale/**/*.mo", "data/omf/**/*.omf",
|
38
|
+
"data/sounds/**/*.ogg"].freeze # , 'data/menu/*']
|
60
39
|
|
61
|
-
ICON_FILE_GLOBS = [
|
62
|
-
|
40
|
+
ICON_FILE_GLOBS = ["data/app-icon/**/*.png",
|
41
|
+
"data/app-icon/scalable/*.svg"].freeze
|
63
42
|
|
64
|
-
PIXMAP_GLOBS =
|
43
|
+
PIXMAP_GLOBS = "data/app-icon/32x32/*.xpm"
|
65
44
|
|
66
45
|
def install_common(install_task)
|
67
|
-
install_task.install_exe(
|
68
|
-
install_task.install(
|
46
|
+
install_task.install_exe("bin", "bin/*", "#{PREFIX}/bin")
|
47
|
+
install_task.install("lib", "lib/**/*.rb", install_task.rubylib)
|
69
48
|
|
70
|
-
install_task.install(
|
49
|
+
install_task.install("data", SHARE_FILE_GLOBS, SHARE)
|
71
50
|
install_task.install_icons(ICON_FILE_GLOBS, "#{SHARE}/icons")
|
72
|
-
install_task.install(
|
51
|
+
install_task.install("data/app-icon/32x32", PIXMAP_GLOBS, "#{SHARE}/pixmaps")
|
73
52
|
|
74
|
-
install_task.install(
|
75
|
-
install_task.install(
|
76
|
-
install_task.install(
|
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")
|
77
56
|
end
|
78
57
|
|
79
58
|
FileInstallTask.new(:package_staging, stage_dir, true) do |i|
|
@@ -85,11 +64,11 @@ task debian_install: :install_package_staging
|
|
85
64
|
FileInstallTask.new(:package) do |j|
|
86
65
|
install_common(j)
|
87
66
|
|
88
|
-
docs = %w(README.rdoc
|
89
|
-
devel_docs = [
|
90
|
-
|
91
|
-
j.install(
|
92
|
-
j.install(
|
67
|
+
docs = %w(README.rdoc CHANGELOG.md INSTALL.md COPYING TODO.md)
|
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}")
|
93
72
|
|
94
73
|
j.uninstall_empty_dirs(["#{SHARE}/**/#{PROJECT}/",
|
95
74
|
"#{j.rubylib}/#{PROJECT}/"])
|
@@ -104,14 +83,14 @@ end
|
|
104
83
|
def autogen_comment
|
105
84
|
lines = [
|
106
85
|
"This file is automatically generated by the #{PROJECT} installer.",
|
107
|
-
|
86
|
+
"Do not edit it directly."
|
108
87
|
]
|
109
88
|
result = lines.map { |line| "# #{line}" }
|
110
89
|
result.join("\n") + "\n\n"
|
111
90
|
end
|
112
91
|
|
113
92
|
def generate(filename)
|
114
|
-
File.open(filename,
|
93
|
+
File.open(filename, "w") do |file|
|
115
94
|
puts "Generating #{filename}"
|
116
95
|
file.print autogen_comment
|
117
96
|
file_contents = yield
|
@@ -122,69 +101,75 @@ end
|
|
122
101
|
# generate default_preferences.rb
|
123
102
|
def convert_with_type(value, type)
|
124
103
|
case type
|
125
|
-
when
|
104
|
+
when "int"
|
126
105
|
value.to_i
|
127
|
-
when
|
106
|
+
when "float"
|
128
107
|
value.to_f
|
129
|
-
when
|
130
|
-
value ==
|
108
|
+
when "bool"
|
109
|
+
value == "true"
|
110
|
+
when "string"
|
111
|
+
value.to_s.strip
|
131
112
|
else
|
132
|
-
|
113
|
+
raise NotImplementedError, "Unknown type #{type}"
|
133
114
|
end
|
134
115
|
end
|
135
116
|
|
136
|
-
SCHEMA_PATH =
|
117
|
+
SCHEMA_PATH = "schemas/alexandria.schemas"
|
137
118
|
|
138
119
|
# This generates default_preferences.rb by copying over values from
|
139
120
|
# providers_priority key in alexandria.schemas (necessary?)
|
140
121
|
|
141
|
-
file
|
142
|
-
require
|
122
|
+
file "lib/alexandria/default_preferences.rb" => ["Rakefile", SCHEMA_PATH] do |f|
|
123
|
+
require "rexml/document"
|
143
124
|
generated_lines = []
|
144
125
|
|
145
126
|
doc = REXML::Document.new(IO.read(SCHEMA_PATH))
|
146
|
-
doc.elements.each(
|
147
|
-
default = element.elements[
|
148
|
-
|
149
|
-
varname = File.basename(element.elements[
|
150
|
-
type = element.elements[
|
151
|
-
|
152
|
-
if (type ==
|
153
|
-
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(",")
|
154
135
|
next if ary.empty?
|
155
|
-
|
156
|
-
|
136
|
+
|
137
|
+
case type
|
138
|
+
when "list"
|
139
|
+
list_type = element.elements["list_type"].text
|
157
140
|
ary.map! { |x| convert_with_type(x, list_type) }
|
158
|
-
|
141
|
+
when "pair"
|
159
142
|
next if ary.length != 2
|
143
|
+
|
160
144
|
ary[0] = convert_with_type(ary[0],
|
161
|
-
element.elements[
|
145
|
+
element.elements["car_type"].text)
|
162
146
|
ary[1] = convert_with_type(ary[1],
|
163
|
-
element.elements[
|
147
|
+
element.elements["cdr_type"].text)
|
164
148
|
end
|
165
149
|
default = ary.inspect
|
166
150
|
else
|
167
151
|
default = convert_with_type(default, type).inspect.to_s
|
168
152
|
end
|
169
153
|
|
170
|
-
generated_lines << varname.inspect +
|
154
|
+
generated_lines << varname.inspect + " => " + default
|
171
155
|
end
|
172
156
|
|
173
157
|
generate(f.name) do
|
174
|
-
|
175
|
-
module Alexandria
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
158
|
+
<<~EOS
|
159
|
+
module Alexandria
|
160
|
+
class Preferences
|
161
|
+
DEFAULT_VALUES = {
|
162
|
+
#{generated_lines.join(",\n ")}
|
163
|
+
}
|
164
|
+
end
|
165
|
+
end
|
166
|
+
EOS
|
181
167
|
end
|
182
168
|
end
|
183
169
|
|
184
|
-
autogenerated_files = [
|
185
|
-
'lib/alexandria/default_preferences.rb']
|
170
|
+
autogenerated_files = ["lib/alexandria/default_preferences.rb"]
|
186
171
|
|
187
|
-
desc
|
172
|
+
desc "Generate ruby files needed for the installation"
|
188
173
|
task autogen: autogenerated_files
|
189
174
|
|
190
175
|
task :autogen_clobber do |_t|
|
@@ -213,13 +198,13 @@ end
|
|
213
198
|
|
214
199
|
Rake::PackageTask.new(PROJECT, Alexandria::DISPLAY_VERSION) do |p|
|
215
200
|
p.need_tar_gz = true
|
216
|
-
p.package_files.include(
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
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/**/*")
|
223
208
|
end
|
224
209
|
|
225
210
|
task tgz: [:build] do
|
@@ -230,36 +215,37 @@ end
|
|
230
215
|
|
231
216
|
task pre_install: [:build]
|
232
217
|
task :scrollkeeper do
|
233
|
-
unless system(
|
234
|
-
raise
|
218
|
+
unless system("which scrollkeeper-update")
|
219
|
+
raise "scrollkeeper-update cannot be found, is Scrollkeeper correctly installed?"
|
235
220
|
end
|
236
|
-
|
221
|
+
|
222
|
+
system("scrollkeeper-update -q") || raise("Scrollkeeper update failed")
|
237
223
|
end
|
238
224
|
|
239
225
|
task :gconf do
|
240
|
-
return if ENV[
|
226
|
+
return if ENV["GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL"]
|
241
227
|
|
242
|
-
unless system(
|
243
|
-
raise
|
228
|
+
unless system("which gconftool-2")
|
229
|
+
raise "gconftool-2 cannot be found, is GConf2 correctly installed?"
|
244
230
|
end
|
245
231
|
|
246
|
-
ENV[
|
247
|
-
Dir[
|
232
|
+
ENV["GCONF_CONFIG_SOURCE"] = `gconftool-2 --get-default-source`.chomp
|
233
|
+
Dir["schemas/*.schemas"].each do |schema|
|
248
234
|
system("gconftool-2 --makefile-install-rule '#{schema}'")
|
249
235
|
end
|
250
236
|
# system("killall -HUP gconfd-2")
|
251
237
|
end
|
252
238
|
|
253
239
|
task :update_icon_cache do
|
254
|
-
system(
|
240
|
+
system("gtk-update-icon-cache -f -t /usr/share/icons/hicolor") # HACK
|
255
241
|
end
|
256
242
|
|
257
243
|
task post_install: [:scrollkeeper, :gconf, :update_icon_cache]
|
258
244
|
|
259
|
-
desc
|
245
|
+
desc "Install Alexandria"
|
260
246
|
task install: [:pre_install, :install_package, :post_install]
|
261
247
|
|
262
|
-
desc
|
248
|
+
desc "Uninstall Alexandria"
|
263
249
|
task uninstall: [:uninstall_package] # TODO: gconf etc...
|
264
250
|
|
265
|
-
task default: [:spec
|
251
|
+
task default: [:spec]
|
data/TODO.md
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
Alexandria's TODO list
|
2
2
|
======================
|
3
3
|
|
4
|
-
|
4
|
+
## New TODOs
|
5
|
+
|
6
|
+
* [ ] Clean up broken providers
|
7
|
+
* [ ] Add openlibrary provider
|
8
|
+
* [ ] Allow searching for cover image for existing books
|
9
|
+
|
10
|
+
## Old TODOs
|
11
|
+
|
12
|
+
This is an old list of TODO's that should be cleaned up.
|
5
13
|
|
6
14
|
For the next release:
|
7
15
|
|
@@ -1,61 +1,68 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/alexandria/version"
|
3
4
|
|
4
5
|
Gem::Specification.new do |s|
|
5
|
-
s.name =
|
6
|
+
s.name = "alexandria-book-collection-manager"
|
6
7
|
s.version = Alexandria::VERSION
|
7
8
|
|
8
|
-
s.summary =
|
9
|
-
s.required_ruby_version =
|
9
|
+
s.summary = "GNOME application for managing collections of books"
|
10
|
+
s.required_ruby_version = ">= 2.5.0"
|
10
11
|
|
11
12
|
s.authors = [
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
13
|
+
"Alexander McCormmach",
|
14
|
+
"Aymeric Nys",
|
15
|
+
"Cathal Mc Ginley",
|
16
|
+
"Claudio Belotti",
|
17
|
+
"Constantine Evans",
|
18
|
+
"Dafydd Harries",
|
19
|
+
"Javier Fernandez-Sanguino Pena",
|
20
|
+
"Joseph Method",
|
21
|
+
"Kevin Schultz",
|
22
|
+
"Laurent Sansonetti",
|
23
|
+
"Marco Costantini",
|
24
|
+
"Mathieu Leduc-Hamel",
|
25
|
+
"Matijs van Zuijlen",
|
26
|
+
"Owain Evans",
|
27
|
+
"Pascal Terjan",
|
28
|
+
"Rene Samselnig",
|
29
|
+
"Robby Stephenson",
|
30
|
+
"Sun Ning",
|
31
|
+
"Takayuki Kusano",
|
32
|
+
"Timothy Malone",
|
33
|
+
"Zachary P. Landau"
|
33
34
|
]
|
34
|
-
s.email = [
|
35
|
-
s.homepage =
|
35
|
+
s.email = ["matijs@matijs.net"]
|
36
|
+
s.homepage = "http://www.github.com/mvz/alexandria-book-collection-manager"
|
36
37
|
|
37
|
-
s.license =
|
38
|
+
s.license = "GPL-2"
|
38
39
|
|
39
40
|
s.files = `git ls-files -z`.split("\0") |
|
40
|
-
[
|
41
|
+
["lib/alexandria/default_preferences.rb"]
|
41
42
|
|
42
|
-
s.executables = [
|
43
|
+
s.executables = ["alexandria"]
|
43
44
|
|
44
|
-
s.rdoc_options = [
|
45
|
+
s.rdoc_options = ["--main", "README.md"]
|
45
46
|
|
46
|
-
s.add_runtime_dependency(
|
47
|
-
s.add_runtime_dependency(
|
48
|
-
s.add_runtime_dependency(
|
49
|
-
s.add_runtime_dependency(
|
50
|
-
s.add_runtime_dependency(
|
51
|
-
s.add_runtime_dependency(
|
52
|
-
s.add_runtime_dependency(
|
53
|
-
s.add_runtime_dependency(
|
54
|
-
s.add_runtime_dependency(
|
47
|
+
s.add_runtime_dependency("gettext", ["~> 3.1"])
|
48
|
+
s.add_runtime_dependency("gstreamer", ["~> 3.4.3"])
|
49
|
+
s.add_runtime_dependency("gtk3", ["~> 3.4.3"])
|
50
|
+
s.add_runtime_dependency("hpricot", ["~> 0.8.5"])
|
51
|
+
s.add_runtime_dependency("htmlentities", ["~> 4.3"])
|
52
|
+
s.add_runtime_dependency("image_size", ["~> 2.0"])
|
53
|
+
s.add_runtime_dependency("marc", ["~> 1.0.0"])
|
54
|
+
s.add_runtime_dependency("psych", ["~> 3.2.0"])
|
55
|
+
s.add_runtime_dependency("zoom", ["~> 0.5.0"])
|
55
56
|
|
56
|
-
s.add_development_dependency(
|
57
|
-
s.add_development_dependency(
|
58
|
-
s.add_development_dependency(
|
57
|
+
s.add_development_dependency("gnome_app_driver", ["~> 0.2.1"])
|
58
|
+
s.add_development_dependency("minitest", ["~> 5.0"])
|
59
|
+
s.add_development_dependency("rake", ["~> 13.0"])
|
60
|
+
s.add_development_dependency("rspec", ["~> 3.0"])
|
61
|
+
s.add_development_dependency("rubocop", "~> 0.93.1")
|
62
|
+
s.add_development_dependency("rubocop-i18n", ["~> 2.0.2"])
|
63
|
+
s.add_development_dependency("rubocop-performance", ["~> 1.8.0"])
|
64
|
+
s.add_development_dependency("rubocop-rspec", "~> 1.44.1")
|
65
|
+
s.add_development_dependency("webmock", "~> 3.9")
|
59
66
|
|
60
|
-
s.require_paths = [
|
67
|
+
s.require_paths = ["lib"]
|
61
68
|
end
|