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.
- checksums.yaml +4 -4
- data/.rubocop.yml +28 -25
- data/.rubocop_todo.yml +87 -67
- data/CHANGELOG.md +12 -1
- data/Gemfile +4 -3
- data/README.md +16 -6
- data/Rakefile +71 -72
- data/alexandria-book-collection-manager.gemspec +44 -44
- data/bin/alexandria +12 -12
- data/lib/alexandria.rb +22 -22
- data/lib/alexandria/about.rb +50 -50
- data/lib/alexandria/book_providers.rb +50 -50
- data/lib/alexandria/book_providers/adlibris.rb +28 -44
- data/lib/alexandria/book_providers/amazon_aws.rb +64 -64
- data/lib/alexandria/book_providers/amazon_ecs_util.rb +52 -78
- data/lib/alexandria/book_providers/barnes_and_noble.rb +34 -34
- data/lib/alexandria/book_providers/douban.rb +21 -37
- data/lib/alexandria/book_providers/proxis.rb +24 -24
- data/lib/alexandria/book_providers/pseudomarc.rb +19 -19
- data/lib/alexandria/book_providers/renaud.rb +44 -57
- data/lib/alexandria/book_providers/siciliano.rb +39 -39
- data/lib/alexandria/book_providers/thalia.rb +33 -33
- data/lib/alexandria/book_providers/web.rb +5 -5
- data/lib/alexandria/book_providers/worldcat.rb +44 -69
- data/lib/alexandria/book_providers/z3950.rb +94 -109
- data/lib/alexandria/config.rb +1 -1
- data/lib/alexandria/console.rb +3 -3
- data/lib/alexandria/export_format.rb +8 -8
- data/lib/alexandria/export_library.rb +112 -113
- data/lib/alexandria/import_library.rb +45 -45
- data/lib/alexandria/import_library_csv.rb +30 -30
- data/lib/alexandria/library_collection.rb +4 -4
- data/lib/alexandria/library_sort_order.rb +1 -1
- data/lib/alexandria/library_store.rb +14 -14
- data/lib/alexandria/logging.rb +5 -5
- data/lib/alexandria/models/book.rb +1 -1
- data/lib/alexandria/models/library.rb +36 -36
- data/lib/alexandria/net.rb +5 -5
- data/lib/alexandria/preferences.rb +32 -32
- data/lib/alexandria/scanners/{cuecat.rb → cue_cat.rb} +13 -13
- data/lib/alexandria/scanners/keyboard.rb +5 -5
- data/lib/alexandria/smart_library.rb +53 -53
- data/lib/alexandria/ui.rb +15 -15
- data/lib/alexandria/ui/{dialogs/about_dialog.rb → about_dialog.rb} +1 -1
- data/lib/alexandria/ui/{dialogs/acquire_dialog.rb → acquire_dialog.rb} +66 -65
- data/lib/alexandria/ui/{dialogs/alert_dialog.rb → alert_dialog.rb} +1 -16
- data/lib/alexandria/ui/{dialogs/bad_isbns_dialog.rb → bad_isbns_dialog.rb} +0 -0
- data/lib/alexandria/ui/{dialogs/barcode_animation.rb → barcode_animation.rb} +7 -7
- data/lib/alexandria/ui/{dialogs/book_properties_dialog.rb → book_properties_dialog.rb} +25 -37
- data/lib/alexandria/ui/{dialogs/book_properties_dialog_base.rb → book_properties_dialog_base.rb} +38 -37
- data/lib/alexandria/ui/builder_base.rb +1 -1
- data/lib/alexandria/ui/callbacks.rb +95 -91
- data/lib/alexandria/ui/completion_models.rb +7 -21
- 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 +7 -7
- data/lib/alexandria/ui/error_dialog.rb +25 -0
- data/lib/alexandria/ui/{dialogs/export_dialog.rb → export_dialog.rb} +22 -42
- data/lib/alexandria/ui/icons.rb +6 -6
- data/lib/alexandria/ui/iconview.rb +7 -7
- data/lib/alexandria/ui/iconview_tooltips.rb +6 -6
- data/lib/alexandria/ui/{dialogs/import_dialog.rb → import_dialog.rb} +14 -32
- data/lib/alexandria/ui/init.rb +16 -29
- data/lib/alexandria/ui/{dialogs/keep_bad_isbn_dialog.rb → keep_bad_isbn_dialog.rb} +6 -4
- data/lib/alexandria/ui/libraries_combo.rb +7 -7
- data/lib/alexandria/ui/listview.rb +40 -40
- data/lib/alexandria/ui/main_app.rb +22 -24
- data/lib/alexandria/ui/misc_dialogs.rb +10 -0
- data/lib/alexandria/ui/multi_drag_treeview.rb +4 -4
- data/lib/alexandria/ui/{dialogs/new_book_dialog.rb → new_book_dialog.rb} +46 -45
- data/lib/alexandria/ui/{dialogs/new_book_dialog_manual.rb → new_book_dialog_manual.rb} +20 -19
- data/lib/alexandria/ui/new_provider_dialog.rb +99 -0
- data/lib/alexandria/ui/{dialogs/new_smart_library_dialog.rb → new_smart_library_dialog.rb} +4 -4
- data/lib/alexandria/ui/{dialogs/preferences_dialog.rb → preferences_dialog.rb} +44 -235
- data/lib/alexandria/ui/provider_preferences_base_dialog.rb +90 -0
- data/lib/alexandria/ui/provider_preferences_dialog.rb +35 -0
- data/lib/alexandria/ui/{dialogs/misc_dialogs.rb → really_delete_dialog.rb} +6 -27
- data/lib/alexandria/ui/{sidepane.rb → sidepane_manager.rb} +27 -25
- data/lib/alexandria/ui/skip_entry_dialog.rb +32 -0
- data/lib/alexandria/ui/{dialogs/smart_library_properties_dialog.rb → smart_library_properties_dialog.rb} +2 -2
- data/lib/alexandria/ui/{dialogs/smart_library_properties_dialog_base.rb → smart_library_properties_dialog_base.rb} +30 -30
- data/lib/alexandria/ui/sound.rb +8 -8
- data/lib/alexandria/ui/ui_manager.rb +136 -135
- data/lib/alexandria/version.rb +4 -19
- data/lib/alexandria/web_themes.rb +8 -8
- data/po/cs.po +97 -97
- data/po/cy.po +97 -97
- data/po/de.po +97 -97
- data/po/el.po +97 -97
- data/po/es.po +97 -97
- data/po/fr.po +97 -97
- data/po/ga.po +97 -97
- data/po/gl.po +97 -97
- data/po/it.po +97 -97
- data/po/ja.po +97 -97
- data/po/mk.po +97 -97
- data/po/nb.po +97 -97
- data/po/nl.po +97 -97
- data/po/pl.po +97 -97
- data/po/pt.po +97 -97
- data/po/pt_BR.po +97 -97
- data/po/ru.po +97 -97
- data/po/sk.po +97 -97
- data/po/sv.po +97 -97
- data/po/uk.po +97 -97
- data/po/zh_TW.po +97 -97
- data/schemas/alexandria.schemas +24 -2
- data/spec/alexandria/book_providers_spec.rb +65 -82
- data/spec/alexandria/book_spec.rb +12 -10
- data/spec/alexandria/console_spec.rb +9 -9
- data/spec/alexandria/export_library_spec.rb +31 -31
- data/spec/alexandria/library_spec.rb +86 -86
- data/spec/alexandria/library_store_spec.rb +8 -8
- data/spec/alexandria/preferences_spec.rb +18 -17
- data/spec/alexandria/scanners/cue_cat_spec.rb +52 -0
- data/spec/alexandria/smart_library_spec.rb +15 -15
- 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/iconview_spec.rb +7 -21
- data/spec/alexandria/ui/import_dialog_spec.rb +14 -0
- data/spec/alexandria/ui/keep_bad_isbn_dialog_spec.rb +17 -0
- data/spec/alexandria/ui/main_app_spec.rb +6 -6
- data/spec/alexandria/ui/new_book_dialog_manual_spec.rb +15 -0
- data/spec/alexandria/ui/{dialogs/new_book_dialog_spec.rb → new_book_dialog_spec.rb} +4 -4
- data/spec/alexandria/ui/new_provider_dialog_spec.rb +14 -0
- data/spec/alexandria/ui/new_smart_library_dialog_spec.rb +14 -0
- data/spec/alexandria/ui/preferences_dialog_spec.rb +14 -0
- data/spec/alexandria/ui/provider_preferences_dialog_spec.rb +19 -0
- data/spec/alexandria/ui/really_delete_dialog_spec.rb +15 -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 +18 -0
- data/spec/alexandria/ui/sound_spec.rb +2 -2
- data/spec/alexandria/ui/ui_manager_spec.rb +6 -20
- data/spec/alexandria/ui/ui_utilities_spec.rb +9 -9
- data/spec/alexandria/utilities_spec.rb +6 -6
- data/spec/end_to_end/basic_run_spec.rb +24 -36
- data/spec/spec_helper.rb +9 -9
- data/tasks/dogtail.rake +1 -1
- data/tasks/setup.rb +2 -2
- data/tasks/spec.rake +11 -11
- data/util/rake/fileinstall.rb +25 -25
- data/util/rake/gettextgenerate.rb +7 -7
- data/util/rake/omfgenerate.rb +7 -7
- metadata +59 -33
- data/spec/alexandria/scanners/cuecat_spec.rb +0 -67
- data/spec/alexandria/ui/dialogs_spec.rb +0 -162
- data/spec/alexandria/ui/sidepane_spec.rb +0 -29
data/Rakefile
CHANGED
@@ -4,55 +4,55 @@
|
|
4
4
|
#
|
5
5
|
# See the file README.md for authorship and licensing information.
|
6
6
|
|
7
|
-
load
|
7
|
+
load "tasks/setup.rb"
|
8
8
|
|
9
|
-
require
|
9
|
+
require "rake/packagetask"
|
10
10
|
|
11
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__),
|
12
|
-
require
|
13
|
-
require
|
14
|
-
require
|
11
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "util/rake"))
|
12
|
+
require "fileinstall"
|
13
|
+
require "gettextgenerate"
|
14
|
+
require "omfgenerate"
|
15
15
|
|
16
|
-
require_relative
|
16
|
+
require_relative "lib/alexandria/version"
|
17
17
|
|
18
|
-
stage_dir = ENV[
|
19
|
-
prefix_dir = ENV[
|
18
|
+
stage_dir = ENV["DESTDIR"] || "tmp"
|
19
|
+
prefix_dir = ENV["PREFIX"] || "/usr"
|
20
20
|
|
21
|
-
PROJECT =
|
21
|
+
PROJECT = "alexandria"
|
22
22
|
PREFIX = prefix_dir
|
23
|
-
share_dir = ENV[
|
23
|
+
share_dir = ENV["SHARE"] || "#{PREFIX}/share"
|
24
24
|
SHARE = share_dir
|
25
25
|
|
26
26
|
GettextGenerateTask.new(PROJECT) do |g|
|
27
|
-
g.generate_po_files(
|
28
|
-
g.generate_desktop(
|
27
|
+
g.generate_po_files("po", "po/*.po", "share/locale")
|
28
|
+
g.generate_desktop("alexandria.desktop.in", "alexandria.desktop")
|
29
29
|
end
|
30
30
|
|
31
31
|
OmfGenerateTask.new(PROJECT) do |o|
|
32
32
|
o.gnome_helpfiles_dir = "#{SHARE}/gnome/help"
|
33
|
-
o.generate_omf(
|
33
|
+
o.generate_omf("data/omf/alexandria", "share/omf/alexandria/*.in")
|
34
34
|
end
|
35
35
|
|
36
|
-
SHARE_FILE_GLOBS = [
|
37
|
-
|
38
|
-
|
36
|
+
SHARE_FILE_GLOBS = ["data/alexandria/**/*", "data/gnome/**/*.*",
|
37
|
+
"data/locale/**/*.mo", "data/omf/**/*.omf",
|
38
|
+
"data/sounds/**/*.ogg"].freeze # , 'data/menu/*']
|
39
39
|
|
40
|
-
ICON_FILE_GLOBS = [
|
41
|
-
|
40
|
+
ICON_FILE_GLOBS = ["data/app-icon/**/*.png",
|
41
|
+
"data/app-icon/scalable/*.svg"].freeze
|
42
42
|
|
43
|
-
PIXMAP_GLOBS =
|
43
|
+
PIXMAP_GLOBS = "data/app-icon/32x32/*.xpm"
|
44
44
|
|
45
45
|
def install_common(install_task)
|
46
|
-
install_task.install_exe(
|
47
|
-
install_task.install(
|
46
|
+
install_task.install_exe("bin", "bin/*", "#{PREFIX}/bin")
|
47
|
+
install_task.install("lib", "lib/**/*.rb", install_task.rubylib)
|
48
48
|
|
49
|
-
install_task.install(
|
49
|
+
install_task.install("data", SHARE_FILE_GLOBS, SHARE)
|
50
50
|
install_task.install_icons(ICON_FILE_GLOBS, "#{SHARE}/icons")
|
51
|
-
install_task.install(
|
51
|
+
install_task.install("data/app-icon/32x32", PIXMAP_GLOBS, "#{SHARE}/pixmaps")
|
52
52
|
|
53
|
-
install_task.install(
|
54
|
-
install_task.install(
|
55
|
-
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")
|
56
56
|
end
|
57
57
|
|
58
58
|
FileInstallTask.new(:package_staging, stage_dir, true) do |i|
|
@@ -65,10 +65,10 @@ FileInstallTask.new(:package) do |j|
|
|
65
65
|
install_common(j)
|
66
66
|
|
67
67
|
docs = %w(README.rdoc CHANGELOG.md INSTALL.md COPYING TODO.md)
|
68
|
-
devel_docs = [
|
69
|
-
|
70
|
-
j.install(
|
71
|
-
j.install(
|
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}")
|
72
72
|
|
73
73
|
j.uninstall_empty_dirs(["#{SHARE}/**/#{PROJECT}/",
|
74
74
|
"#{j.rubylib}/#{PROJECT}/"])
|
@@ -83,14 +83,14 @@ end
|
|
83
83
|
def autogen_comment
|
84
84
|
lines = [
|
85
85
|
"This file is automatically generated by the #{PROJECT} installer.",
|
86
|
-
|
86
|
+
"Do not edit it directly."
|
87
87
|
]
|
88
88
|
result = lines.map { |line| "# #{line}" }
|
89
89
|
result.join("\n") + "\n\n"
|
90
90
|
end
|
91
91
|
|
92
92
|
def generate(filename)
|
93
|
-
File.open(filename,
|
93
|
+
File.open(filename, "w") do |file|
|
94
94
|
puts "Generating #{filename}"
|
95
95
|
file.print autogen_comment
|
96
96
|
file_contents = yield
|
@@ -101,55 +101,55 @@ end
|
|
101
101
|
# generate default_preferences.rb
|
102
102
|
def convert_with_type(value, type)
|
103
103
|
case type
|
104
|
-
when
|
104
|
+
when "int"
|
105
105
|
value.to_i
|
106
|
-
when
|
106
|
+
when "float"
|
107
107
|
value.to_f
|
108
|
-
when
|
109
|
-
value ==
|
108
|
+
when "bool"
|
109
|
+
value == "true"
|
110
110
|
else
|
111
111
|
value.strip
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
115
|
-
SCHEMA_PATH =
|
115
|
+
SCHEMA_PATH = "schemas/alexandria.schemas"
|
116
116
|
|
117
117
|
# This generates default_preferences.rb by copying over values from
|
118
118
|
# providers_priority key in alexandria.schemas (necessary?)
|
119
119
|
|
120
|
-
file
|
121
|
-
require
|
120
|
+
file "lib/alexandria/default_preferences.rb" => [SCHEMA_PATH] do |f|
|
121
|
+
require "rexml/document"
|
122
122
|
generated_lines = []
|
123
123
|
|
124
124
|
doc = REXML::Document.new(IO.read(SCHEMA_PATH))
|
125
|
-
doc.elements.each(
|
126
|
-
default = element.elements[
|
125
|
+
doc.elements.each("gconfschemafile/schemalist/schema") do |element|
|
126
|
+
default = element.elements["default"].text
|
127
127
|
next unless default
|
128
128
|
|
129
|
-
varname = File.basename(element.elements[
|
130
|
-
type = element.elements[
|
129
|
+
varname = File.basename(element.elements["key"].text)
|
130
|
+
type = element.elements["type"].text
|
131
131
|
|
132
|
-
if (type ==
|
133
|
-
ary = default[1..-2].split(
|
132
|
+
if (type == "list") || (type == "pair")
|
133
|
+
ary = default[1..-2].split(",")
|
134
134
|
next if ary.empty?
|
135
135
|
|
136
|
-
if type ==
|
137
|
-
list_type = element.elements[
|
136
|
+
if type == "list"
|
137
|
+
list_type = element.elements["list_type"].text
|
138
138
|
ary.map! { |x| convert_with_type(x, list_type) }
|
139
|
-
elsif type ==
|
139
|
+
elsif type == "pair"
|
140
140
|
next if ary.length != 2
|
141
141
|
|
142
142
|
ary[0] = convert_with_type(ary[0],
|
143
|
-
element.elements[
|
143
|
+
element.elements["car_type"].text)
|
144
144
|
ary[1] = convert_with_type(ary[1],
|
145
|
-
element.elements[
|
145
|
+
element.elements["cdr_type"].text)
|
146
146
|
end
|
147
147
|
default = ary.inspect
|
148
148
|
else
|
149
149
|
default = convert_with_type(default, type).inspect.to_s
|
150
150
|
end
|
151
151
|
|
152
|
-
generated_lines << varname.inspect +
|
152
|
+
generated_lines << varname.inspect + " => " + default
|
153
153
|
end
|
154
154
|
|
155
155
|
generate(f.name) do
|
@@ -165,10 +165,9 @@ file 'lib/alexandria/default_preferences.rb' => [SCHEMA_PATH] do |f|
|
|
165
165
|
end
|
166
166
|
end
|
167
167
|
|
168
|
-
autogenerated_files = [
|
169
|
-
'lib/alexandria/default_preferences.rb']
|
168
|
+
autogenerated_files = ["lib/alexandria/default_preferences.rb"]
|
170
169
|
|
171
|
-
desc
|
170
|
+
desc "Generate ruby files needed for the installation"
|
172
171
|
task autogen: autogenerated_files
|
173
172
|
|
174
173
|
task :autogen_clobber do |_t|
|
@@ -197,13 +196,13 @@ end
|
|
197
196
|
|
198
197
|
Rake::PackageTask.new(PROJECT, Alexandria::DISPLAY_VERSION) do |p|
|
199
198
|
p.need_tar_gz = true
|
200
|
-
p.package_files.include(
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
199
|
+
p.package_files.include("README.md", "COPYING", "CHANGELOG.md", "INSTALL.md",
|
200
|
+
"Rakefile", "util/**/*",
|
201
|
+
"TODO.md", "alexandria.desktop",
|
202
|
+
"alexandria.desktop.in",
|
203
|
+
"bin/**/*", "data/**/*", "misc/**/*",
|
204
|
+
"doc/**/*", "lib/**/*", "po/**/*",
|
205
|
+
"schemas/**/*", "spec/**/*")
|
207
206
|
end
|
208
207
|
|
209
208
|
task tgz: [:build] do
|
@@ -214,35 +213,35 @@ end
|
|
214
213
|
|
215
214
|
task pre_install: [:build]
|
216
215
|
task :scrollkeeper do
|
217
|
-
unless system(
|
218
|
-
raise
|
216
|
+
unless system("which scrollkeeper-update")
|
217
|
+
raise "scrollkeeper-update cannot be found, is Scrollkeeper correctly installed?"
|
219
218
|
end
|
220
219
|
|
221
|
-
system(
|
220
|
+
system("scrollkeeper-update -q") || raise("Scrollkeeper update failed")
|
222
221
|
end
|
223
222
|
|
224
223
|
task :gconf do
|
225
|
-
return if ENV[
|
224
|
+
return if ENV["GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL"]
|
226
225
|
|
227
|
-
raise
|
226
|
+
raise "gconftool-2 cannot be found, is GConf2 correctly installed?" unless system("which gconftool-2")
|
228
227
|
|
229
|
-
ENV[
|
230
|
-
Dir[
|
228
|
+
ENV["GCONF_CONFIG_SOURCE"] = `gconftool-2 --get-default-source`.chomp
|
229
|
+
Dir["schemas/*.schemas"].each do |schema|
|
231
230
|
system("gconftool-2 --makefile-install-rule '#{schema}'")
|
232
231
|
end
|
233
232
|
# system("killall -HUP gconfd-2")
|
234
233
|
end
|
235
234
|
|
236
235
|
task :update_icon_cache do
|
237
|
-
system(
|
236
|
+
system("gtk-update-icon-cache -f -t /usr/share/icons/hicolor") # HACK
|
238
237
|
end
|
239
238
|
|
240
239
|
task post_install: [:scrollkeeper, :gconf, :update_icon_cache]
|
241
240
|
|
242
|
-
desc
|
241
|
+
desc "Install Alexandria"
|
243
242
|
task install: [:pre_install, :install_package, :post_install]
|
244
243
|
|
245
|
-
desc
|
244
|
+
desc "Uninstall Alexandria"
|
246
245
|
task uninstall: [:uninstall_package] # TODO: gconf etc...
|
247
246
|
|
248
247
|
task default: [:spec, :dogtail]
|
@@ -1,62 +1,62 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "lib/alexandria/version"
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
|
-
s.name =
|
6
|
+
s.name = "alexandria-book-collection-manager"
|
7
7
|
s.version = Alexandria::VERSION
|
8
8
|
|
9
|
-
s.summary =
|
10
|
-
s.required_ruby_version =
|
9
|
+
s.summary = "GNOME application for managing collections of books"
|
10
|
+
s.required_ruby_version = ">= 2.4.0"
|
11
11
|
|
12
12
|
s.authors = [
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
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"
|
34
34
|
]
|
35
|
-
s.email = [
|
36
|
-
s.homepage =
|
35
|
+
s.email = ["matijs@matijs.net"]
|
36
|
+
s.homepage = "http://www.github.com/mvz/alexandria-book-collection-manager"
|
37
37
|
|
38
|
-
s.license =
|
38
|
+
s.license = "GPL-2"
|
39
39
|
|
40
40
|
s.files = `git ls-files -z`.split("\0") |
|
41
|
-
[
|
41
|
+
["lib/alexandria/default_preferences.rb"]
|
42
42
|
|
43
|
-
s.executables = [
|
43
|
+
s.executables = ["alexandria"]
|
44
44
|
|
45
|
-
s.rdoc_options = [
|
45
|
+
s.rdoc_options = ["--main", "README.md"]
|
46
46
|
|
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.1"])
|
49
|
+
s.add_runtime_dependency("gtk3", ["~> 3.4.1"])
|
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("zoom", ["~> 0.5.0"])
|
55
55
|
|
56
|
-
s.add_development_dependency(
|
57
|
-
s.add_development_dependency(
|
58
|
-
s.add_development_dependency(
|
59
|
-
s.add_development_dependency(
|
56
|
+
s.add_development_dependency("gnome_app_driver", ["~> 0.2.1"])
|
57
|
+
s.add_development_dependency("minitest", ["~> 5.0"])
|
58
|
+
s.add_development_dependency("rake", ["~> 13.0"])
|
59
|
+
s.add_development_dependency("rspec", ["~> 3.0"])
|
60
60
|
|
61
|
-
s.require_paths = [
|
61
|
+
s.require_paths = ["lib"]
|
62
62
|
end
|
data/bin/alexandria
CHANGED
@@ -5,18 +5,18 @@
|
|
5
5
|
#
|
6
6
|
# See the file README.md for authorship and licensing information.
|
7
7
|
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
11
|
-
require
|
8
|
+
require "gettext"
|
9
|
+
require "alexandria"
|
10
|
+
require "optparse"
|
11
|
+
require "ostruct"
|
12
12
|
|
13
13
|
store = Alexandria::LibraryStore.new(Alexandria::Library::DEFAULT_DIR)
|
14
14
|
Alexandria::LibraryCollection.instance.library_store = store
|
15
15
|
|
16
16
|
# options = OpenStruct.new
|
17
17
|
OptionParser.new do |opts|
|
18
|
-
opts.banner =
|
19
|
-
opts.on(
|
18
|
+
opts.banner = "Usage: alexandria [options]"
|
19
|
+
opts.on("-l", "--list", "List libraries in numbered format") do
|
20
20
|
puts Alexandria.list_books_on_console
|
21
21
|
exit
|
22
22
|
end
|
@@ -30,14 +30,14 @@ OptionParser.new do |opts|
|
|
30
30
|
# options.library = val
|
31
31
|
# exit
|
32
32
|
# end
|
33
|
-
opts.on(
|
33
|
+
opts.on("-d", "--debug", "Run in debug mode") do
|
34
34
|
$DEBUG = true
|
35
35
|
end
|
36
|
-
opts.on(
|
36
|
+
opts.on("-h", "--help", "Show help options") do
|
37
37
|
puts opts
|
38
38
|
exit
|
39
39
|
end
|
40
|
-
opts.on(
|
40
|
+
opts.on("-v", "--version", "Get version number") do
|
41
41
|
puts Alexandria::VERSION
|
42
42
|
exit
|
43
43
|
end
|
@@ -45,15 +45,15 @@ end.parse!
|
|
45
45
|
|
46
46
|
begin
|
47
47
|
Alexandria.main
|
48
|
-
rescue StandardError =>
|
48
|
+
rescue StandardError => ex
|
49
49
|
warn <<~EOS
|
50
50
|
-----------------------
|
51
51
|
Alexandria just crashed
|
52
52
|
-----------------------
|
53
53
|
Timestamp: #{Time.now}
|
54
|
-
Message: #{
|
54
|
+
Message: #{ex.message}
|
55
55
|
Backtrace:
|
56
|
-
#{
|
56
|
+
#{ex.backtrace.join("\n")}
|
57
57
|
Release: #{Alexandria::VERSION}(#{Alexandria::DISPLAY_VERSION})
|
58
58
|
Uname -a: #{`uname -a`.chomp}
|
59
59
|
--
|
data/lib/alexandria.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
#
|
5
5
|
# See the file README.md for authorship and licensing information.
|
6
6
|
|
7
|
-
require
|
7
|
+
require "gettext"
|
8
8
|
|
9
9
|
# XXX: Gettext hotfix
|
10
10
|
module Gem
|
@@ -16,18 +16,18 @@ module Gem
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
require
|
20
|
-
require
|
21
|
-
require
|
19
|
+
require "logger"
|
20
|
+
require "alexandria/logging"
|
21
|
+
require "alexandria/about"
|
22
22
|
|
23
23
|
module Alexandria
|
24
24
|
def self.set_proxy
|
25
|
-
ENV[
|
25
|
+
ENV["http_proxy"] = nil if !ENV["http_proxy"].nil? && URI.parse(ENV["http_proxy"]).userinfo.nil?
|
26
26
|
end
|
27
27
|
|
28
28
|
def self.set_log_level
|
29
29
|
Alexandria.log.level = Logger::DEBUG if $DEBUG
|
30
|
-
Alexandria.log.debug {
|
30
|
+
Alexandria.log.debug { "Initializing Alexandria..." }
|
31
31
|
end
|
32
32
|
|
33
33
|
def self.main
|
@@ -39,8 +39,8 @@ end
|
|
39
39
|
|
40
40
|
# lrz says 'macui' is obsolete (may be supported again some day)
|
41
41
|
# unless $MACOSX
|
42
|
-
require
|
43
|
-
require
|
42
|
+
require "alexandria/config"
|
43
|
+
require "alexandria/version"
|
44
44
|
|
45
45
|
# else
|
46
46
|
# module Alexandria
|
@@ -51,22 +51,22 @@ require 'alexandria/version'
|
|
51
51
|
# end
|
52
52
|
# end
|
53
53
|
|
54
|
-
require
|
55
|
-
require
|
56
|
-
require
|
57
|
-
require
|
54
|
+
require "alexandria/models/book"
|
55
|
+
require "alexandria/library_store"
|
56
|
+
require "alexandria/library_collection"
|
57
|
+
require "alexandria/models/library"
|
58
58
|
|
59
|
-
require
|
60
|
-
require
|
61
|
-
require
|
62
|
-
require
|
63
|
-
require
|
64
|
-
require
|
65
|
-
require
|
66
|
-
require
|
59
|
+
require "alexandria/smart_library"
|
60
|
+
require "alexandria/execution_queue"
|
61
|
+
require "alexandria/import_library"
|
62
|
+
require "alexandria/export_library"
|
63
|
+
require "alexandria/book_providers"
|
64
|
+
require "alexandria/preferences"
|
65
|
+
require "alexandria/undo_manager"
|
66
|
+
require "alexandria/web_themes"
|
67
67
|
|
68
68
|
# lrz says 'macui' is obsolete (may be supported again some day)
|
69
69
|
# require $MACOSX ? 'alexandria/macui' : 'alexandria/ui'
|
70
70
|
|
71
|
-
require
|
72
|
-
require
|
71
|
+
require "alexandria/ui"
|
72
|
+
require "alexandria/console"
|