alexandria-book-collection-manager 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.hound.yml +2 -0
- data/.rubocop.yml +4 -4
- data/.rubocop_todo.yml +55 -82
- data/CHANGELOG.md +17 -0
- data/INSTALL.md +3 -3
- data/README.md +1 -2
- data/Rakefile +14 -33
- data/TODO.md +9 -1
- data/alexandria-book-collection-manager.gemspec +4 -3
- data/bin/alexandria +21 -34
- data/doc/FAQ +2 -5
- data/lib/alexandria.rb +4 -16
- data/lib/alexandria/book_providers.rb +5 -7
- data/lib/alexandria/book_providers/adlibris.rb +5 -3
- data/lib/alexandria/book_providers/amazon_aws.rb +3 -1
- data/lib/alexandria/book_providers/amazon_ecs_util.rb +8 -0
- data/lib/alexandria/book_providers/barnes_and_noble.rb +7 -4
- data/lib/alexandria/book_providers/douban.rb +1 -1
- data/lib/alexandria/book_providers/proxis.rb +11 -27
- data/lib/alexandria/book_providers/renaud.rb +9 -3
- data/lib/alexandria/book_providers/siciliano.rb +7 -4
- data/lib/alexandria/book_providers/thalia.rb +5 -3
- data/lib/alexandria/book_providers/web.rb +11 -29
- data/lib/alexandria/book_providers/worldcat.rb +7 -5
- data/lib/alexandria/book_providers/z3950.rb +10 -7
- data/lib/alexandria/console.rb +5 -18
- data/lib/alexandria/execution_queue.rb +2 -1
- data/lib/alexandria/export_format.rb +47 -0
- data/lib/alexandria/export_library.rb +72 -180
- data/lib/alexandria/import_library.rb +14 -23
- data/lib/alexandria/import_library_csv.rb +3 -6
- data/lib/alexandria/library_collection.rb +78 -0
- data/lib/alexandria/library_sort_order.rb +43 -0
- data/lib/alexandria/library_store.rb +222 -0
- data/lib/alexandria/logging.rb +2 -0
- data/lib/alexandria/models/book.rb +8 -16
- data/lib/alexandria/models/library.rb +26 -308
- data/lib/alexandria/preferences.rb +7 -24
- data/lib/alexandria/scanners/cuecat.rb +3 -1
- data/lib/alexandria/smart_library.rb +32 -67
- data/lib/alexandria/ui/builder_base.rb +6 -26
- data/lib/alexandria/ui/callbacks.rb +8 -34
- data/lib/alexandria/ui/completion_models.rb +2 -1
- data/lib/alexandria/ui/dialogs/about_dialog.rb +35 -47
- data/lib/alexandria/ui/dialogs/acquire_dialog.rb +14 -30
- data/lib/alexandria/ui/dialogs/alert_dialog.rb +8 -17
- data/lib/alexandria/ui/dialogs/bad_isbns_dialog.rb +10 -24
- data/lib/alexandria/ui/dialogs/book_properties_dialog.rb +17 -18
- data/lib/alexandria/ui/dialogs/book_properties_dialog_base.rb +25 -41
- data/lib/alexandria/ui/dialogs/export_dialog.rb +48 -56
- data/lib/alexandria/ui/dialogs/import_dialog.rb +31 -51
- data/lib/alexandria/ui/dialogs/keep_bad_isbn_dialog.rb +33 -0
- data/lib/alexandria/ui/dialogs/misc_dialogs.rb +12 -25
- data/lib/alexandria/ui/dialogs/new_book_dialog.rb +57 -94
- data/lib/alexandria/ui/dialogs/new_book_dialog_manual.rb +24 -42
- data/lib/alexandria/ui/dialogs/new_smart_library_dialog.rb +9 -21
- data/lib/alexandria/ui/dialogs/preferences_dialog.rb +27 -32
- data/lib/alexandria/ui/dialogs/smart_library_properties_dialog.rb +5 -3
- data/lib/alexandria/ui/dialogs/smart_library_properties_dialog_base.rb +15 -12
- data/lib/alexandria/ui/icons.rb +11 -22
- data/lib/alexandria/ui/init.rb +3 -3
- data/lib/alexandria/ui/libraries_combo.rb +1 -0
- data/lib/alexandria/ui/listview.rb +5 -21
- data/lib/alexandria/ui/multi_drag_treeview.rb +20 -32
- data/lib/alexandria/ui/sidepane.rb +9 -24
- data/lib/alexandria/ui/ui_manager.rb +36 -60
- data/lib/alexandria/undo_manager.rb +1 -0
- data/lib/alexandria/version.rb +2 -2
- data/lib/alexandria/web_themes.rb +1 -0
- data/po/cs.po +0 -4
- data/po/cy.po +0 -4
- data/po/de.po +0 -4
- data/po/el.po +0 -4
- data/po/es.po +0 -4
- data/po/fr.po +0 -4
- data/po/ga.po +0 -4
- data/po/gl.po +0 -4
- data/po/it.po +0 -4
- data/po/ja.po +0 -4
- data/po/mk.po +0 -4
- data/po/nb.po +0 -4
- data/po/nl.po +0 -4
- data/po/pl.po +0 -4
- data/po/pt.po +0 -4
- data/po/pt_BR.po +0 -4
- data/po/ru.po +0 -4
- data/po/sk.po +0 -4
- data/po/sv.po +0 -4
- data/po/uk.po +0 -4
- data/po/zh_TW.po +0 -4
- data/schemas/alexandria.schemas +1 -1
- data/share/alexandria/glade/acquire_dialog__builder.glade +14 -11
- data/share/alexandria/glade/book_properties_dialog__builder.glade +170 -298
- data/share/alexandria/glade/main_app__builder.glade +22 -16
- data/share/alexandria/glade/new_book_dialog__builder.glade +26 -58
- data/share/alexandria/glade/preferences_dialog__builder.glade +249 -289
- data/share/gnome/help/alexandria/C/introduction.xml +0 -4
- data/share/gnome/help/alexandria/ja/introduction.xml +0 -4
- data/spec/alexandria/book_providers_spec.rb +1 -20
- data/spec/alexandria/console_spec.rb +32 -0
- data/spec/alexandria/export_library_spec.rb +141 -0
- data/spec/alexandria/library_spec.rb +24 -80
- data/spec/alexandria/library_store_spec.rb +37 -0
- data/spec/alexandria/smart_library_spec.rb +27 -22
- data/spec/alexandria/ui/dialogs/new_book_dialog_spec.rb +22 -0
- data/spec/alexandria/ui/dialogs_spec.rb +104 -38
- data/spec/end_to_end/basic_run_spec.rb +69 -0
- data/spec/spec_helper.rb +13 -25
- data/tasks/spec.rake +15 -2
- data/util/rake/fileinstall.rb +1 -0
- metadata +38 -16
- data/lib/alexandria/book_providers/deastore.rb +0 -265
- data/lib/alexandria/book_providers/mcu.rb +0 -182
@@ -1,34 +1,39 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
3
|
+
# This file is part of Alexandria.
|
4
4
|
#
|
5
|
-
#
|
6
|
-
# modify it under the terms of the GNU General Public License as
|
7
|
-
# published by the Free Software Foundation; either version 2 of the
|
8
|
-
# License, or (at your option) any later version.
|
9
|
-
#
|
10
|
-
# Alexandria is distributed in the hope that it will be useful,
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
-
# General Public License for more details.
|
14
|
-
#
|
15
|
-
# You should have received a copy of the GNU General Public
|
16
|
-
# License along with Alexandria; see the file COPYING. If not,
|
17
|
-
# write to the Free Software Foundation, Inc., 51 Franklin Street,
|
18
|
-
# Fifth Floor, Boston, MA 02110-1301 USA.
|
5
|
+
# See the file README.md for authorship and licensing information.
|
19
6
|
|
20
|
-
require
|
7
|
+
require 'spec_helper'
|
21
8
|
|
22
|
-
describe Alexandria::SmartLibrary do
|
9
|
+
RSpec.describe Alexandria::SmartLibrary do
|
23
10
|
it 'can be instantiated simply' do
|
24
11
|
lib = described_class.new('Hello', [], :all)
|
25
12
|
expect(lib.name).to eq 'Hello'
|
26
13
|
end
|
27
14
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
15
|
+
describe '#name' do
|
16
|
+
it 'normalizes the encoding' do
|
17
|
+
bad_name = (+'Prêts').force_encoding('ascii')
|
18
|
+
lib = described_class.new(bad_name, [], :all)
|
19
|
+
expect(lib.name.encoding.name).to eq 'UTF-8'
|
20
|
+
expect(bad_name.encoding.name).to eq 'US-ASCII'
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe '#update' do
|
25
|
+
let(:lib) { described_class.new('Hello', [], :all) }
|
26
|
+
|
27
|
+
it 'works when given no parameters' do
|
28
|
+
lib.update
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'works when given a LibraryCollection' do
|
32
|
+
lib.update Alexandria::LibraryCollection.instance
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'works when given a Library' do
|
36
|
+
lib.update Alexandria::Library.new('Hi')
|
37
|
+
end
|
33
38
|
end
|
34
39
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This file is part of Alexandria.
|
4
|
+
#
|
5
|
+
# See the file README.md for authorship and licensing information.
|
6
|
+
|
7
|
+
require 'spec_helper'
|
8
|
+
|
9
|
+
describe Alexandria::UI::NewBookDialog do
|
10
|
+
let(:parent) { Gtk::Window.new :toplevel }
|
11
|
+
let(:model) { Gtk::ListStore.new(String, String, GdkPixbuf::Pixbuf) }
|
12
|
+
|
13
|
+
it 'should work' do
|
14
|
+
described_class.new parent
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'can copy search results into result treeview' do
|
18
|
+
results = [[an_artist_of_the_floating_world, 'cover-url']]
|
19
|
+
dialog = described_class.new parent
|
20
|
+
dialog.copy_results_to_treeview_model results, model
|
21
|
+
end
|
22
|
+
end
|
@@ -1,96 +1,162 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
# Copyright (C) 2015, 2016 Matijs van Zuijlen
|
3
|
+
# This file is part of Alexandria.
|
5
4
|
#
|
6
|
-
#
|
7
|
-
# modify it under the terms of the GNU General Public License as
|
8
|
-
# published by the Free Software Foundation; either version 2 of the
|
9
|
-
# License, or (at your option) any later version.
|
10
|
-
#
|
11
|
-
# Alexandria is distributed in the hope that it will be useful,
|
12
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
-
# General Public License for more details.
|
15
|
-
#
|
16
|
-
# You should have received a copy of the GNU General Public
|
17
|
-
# License along with Alexandria; see the file COPYING. If not,
|
18
|
-
# write to the Free Software Foundation, Inc., 51 Franklin Street,
|
19
|
-
# Fifth Floor, Boston, MA 02110-1301 USA.
|
5
|
+
# See the file README.md for authorship and licensing information.
|
20
6
|
|
21
7
|
require File.dirname(__FILE__) + '/../../spec_helper'
|
22
8
|
|
23
9
|
describe Alexandria::UI::SmartLibraryPropertiesDialog do
|
24
|
-
it 'should work'
|
10
|
+
it 'should work' do
|
11
|
+
parent = Gtk::Window.new :toplevel
|
12
|
+
smart_library = instance_double(Alexandria::SmartLibrary,
|
13
|
+
name: 'Foo',
|
14
|
+
rules: [],
|
15
|
+
predicate_operator_rule: :any)
|
16
|
+
described_class.new parent, smart_library
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe Alexandria::UI::ProviderPreferencesDialog do
|
21
|
+
it 'should work' do
|
22
|
+
parent = Gtk::Window.new :toplevel
|
23
|
+
preferences = instance_double(Alexandria::BookProviders::Preferences,
|
24
|
+
length: 0, read: [])
|
25
|
+
provider = instance_double(Alexandria::BookProviders::GenericProvider,
|
26
|
+
fullname: 'FooProvider',
|
27
|
+
prefs: preferences)
|
28
|
+
described_class.new parent, provider
|
29
|
+
end
|
25
30
|
end
|
26
31
|
|
27
|
-
describe Alexandria::UI::
|
28
|
-
it 'should work'
|
32
|
+
describe Alexandria::UI::NewProviderDialog do
|
33
|
+
it 'should work' do
|
34
|
+
parent = Gtk::Window.new :toplevel
|
35
|
+
described_class.new parent
|
36
|
+
end
|
29
37
|
end
|
30
38
|
|
31
39
|
describe Alexandria::UI::PreferencesDialog do
|
32
|
-
it 'should
|
40
|
+
it 'should work' do
|
41
|
+
parent = Gtk::Window.new :toplevel
|
42
|
+
described_class.new(parent) {}
|
43
|
+
end
|
33
44
|
end
|
34
45
|
|
35
46
|
describe Alexandria::UI::NewSmartLibraryDialog do
|
36
|
-
it 'should work'
|
47
|
+
it 'should work' do
|
48
|
+
parent = Gtk::Window.new :toplevel
|
49
|
+
described_class.new parent
|
50
|
+
end
|
37
51
|
end
|
38
52
|
|
39
53
|
describe Alexandria::UI::NewBookDialogManual do
|
40
|
-
it 'should work'
|
54
|
+
it 'should work' do
|
55
|
+
parent = Gtk::Window.new :toplevel
|
56
|
+
library = instance_double(Alexandria::Library)
|
57
|
+
described_class.new parent, library
|
58
|
+
end
|
41
59
|
end
|
42
60
|
|
43
61
|
describe Alexandria::UI::KeepBadISBNDialog do
|
44
|
-
it 'should work'
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
62
|
+
it 'should work' do
|
63
|
+
parent = Gtk::Window.new :toplevel
|
64
|
+
book = instance_double(Alexandria::Book,
|
65
|
+
title: 'Foo Book',
|
66
|
+
isbn: '98765432')
|
67
|
+
described_class.new parent, book
|
68
|
+
end
|
49
69
|
end
|
50
70
|
|
51
71
|
describe Alexandria::UI::ConflictWhileCopyingDialog do
|
52
|
-
it 'should work'
|
72
|
+
it 'should work' do
|
73
|
+
parent = Gtk::Window.new :toplevel
|
74
|
+
library = instance_double(Alexandria::Library, name: 'Bar Library')
|
75
|
+
book = instance_double(Alexandria::Book, title: 'Foo Book')
|
76
|
+
described_class.new parent, library, book
|
77
|
+
end
|
53
78
|
end
|
54
79
|
|
55
80
|
describe Alexandria::UI::ReallyDeleteDialog do
|
56
|
-
it 'should work'
|
81
|
+
it 'should work' do
|
82
|
+
library = instance_double(Alexandria::Library, name: 'Bar Library', empty?: false, size: 12)
|
83
|
+
parent = Gtk::Window.new :toplevel
|
84
|
+
described_class.new parent, library
|
85
|
+
end
|
57
86
|
end
|
58
87
|
|
59
88
|
describe Alexandria::UI::SkipEntryDialog do
|
60
|
-
it 'should work'
|
89
|
+
it 'should work' do
|
90
|
+
parent = Gtk::Window.new :toplevel
|
91
|
+
described_class.new parent, 'Foo'
|
92
|
+
end
|
61
93
|
end
|
62
94
|
|
63
95
|
describe Alexandria::UI::ImportDialog do
|
64
|
-
it 'should work'
|
96
|
+
it 'should work' do
|
97
|
+
parent = Gtk::Window.new :toplevel
|
98
|
+
described_class.new parent
|
99
|
+
end
|
65
100
|
end
|
66
101
|
|
67
102
|
describe Alexandria::UI::ConfirmEraseDialog do
|
68
|
-
it 'should work'
|
103
|
+
it 'should work' do
|
104
|
+
parent = Gtk::Window.new :toplevel
|
105
|
+
described_class.new parent, 'foo-file'
|
106
|
+
end
|
69
107
|
end
|
70
108
|
|
71
109
|
describe Alexandria::UI::ExportDialog do
|
72
|
-
it 'should work'
|
110
|
+
it 'should work' do
|
111
|
+
parent = Gtk::Window.new :toplevel
|
112
|
+
library = instance_double(Alexandria::Library, name: 'Bar Library')
|
113
|
+
described_class.new parent, library, :ascending
|
114
|
+
end
|
73
115
|
end
|
74
116
|
|
75
117
|
describe Alexandria::UI::BookPropertiesDialog do
|
76
|
-
it 'should work'
|
118
|
+
it 'should work' do
|
119
|
+
parent = Gtk::Window.new :toplevel
|
120
|
+
library = instance_double(Alexandria::Library, name: 'Bar Library', cover: '')
|
121
|
+
book = Alexandria::Book.new('Foo Book', ['Jane Doe'], '98765432', 'Bar Publisher',
|
122
|
+
1972, 'edition')
|
123
|
+
described_class.new parent, library, book
|
124
|
+
end
|
77
125
|
end
|
78
126
|
|
79
127
|
describe Alexandria::UI::BadIsbnsDialog do
|
80
|
-
it 'should work'
|
128
|
+
it 'should work' do
|
129
|
+
parent = Gtk::Window.new :toplevel
|
130
|
+
described_class.new parent, 'Careful', []
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
describe Alexandria::UI::ErrorDialog do
|
135
|
+
it 'should work' do
|
136
|
+
parent = Gtk::Window.new :toplevel
|
137
|
+
described_class.new parent, 'Boom', 'It went boom'
|
138
|
+
end
|
81
139
|
end
|
82
140
|
|
83
141
|
describe Alexandria::UI::AlertDialog do
|
84
|
-
it 'should work'
|
142
|
+
it 'should work' do
|
143
|
+
parent = Gtk::Window.new :toplevel
|
144
|
+
described_class.new(parent, 'Hello',
|
145
|
+
Gtk::Stock::DIALOG_QUESTION,
|
146
|
+
[[Gtk::Stock::CANCEL, :cancel]], 'Hi there')
|
147
|
+
end
|
85
148
|
end
|
86
149
|
|
87
150
|
describe Alexandria::UI::AcquireDialog do
|
88
151
|
it 'should work' do
|
89
152
|
parent = Gtk::Window.new :toplevel
|
90
|
-
|
153
|
+
described_class.new parent
|
91
154
|
end
|
92
155
|
end
|
93
156
|
|
94
157
|
describe Alexandria::UI::AboutDialog do
|
95
|
-
it 'should work'
|
158
|
+
it 'should work' do
|
159
|
+
parent = Gtk::Window.new :toplevel
|
160
|
+
described_class.new parent
|
161
|
+
end
|
96
162
|
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (C) 2018 Matijs van Zuijlen
|
4
|
+
#
|
5
|
+
# Alexandria is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU General Public License as
|
7
|
+
# published by the Free Software Foundation; either version 2 of the
|
8
|
+
# License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# Alexandria is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU General Public
|
16
|
+
# License along with Alexandria; see the file COPYING. If not,
|
17
|
+
# write to the Free Software Foundation, Inc., 51 Franklin Street,
|
18
|
+
# Fifth Floor, Boston, MA 02110-1301 USA.
|
19
|
+
|
20
|
+
require 'gnome_app_driver'
|
21
|
+
require 'tmpdir'
|
22
|
+
|
23
|
+
describe 'The Alexandria application' do
|
24
|
+
before do
|
25
|
+
ENV['HOME'] = Dir.mktmpdir
|
26
|
+
@driver = GnomeAppDriver.new 'alexandria'
|
27
|
+
@driver.boot
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'starts and can be quit with Ctrl-q' do
|
31
|
+
@driver.press_ctrl_q
|
32
|
+
|
33
|
+
status = @driver.cleanup
|
34
|
+
expect(status.exitstatus).to eq 0
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'starts and can be quit with the menu' do
|
38
|
+
frame = @driver.frame
|
39
|
+
menu = frame.find_role :menu_item, /Quit/
|
40
|
+
menu.do_action 0
|
41
|
+
|
42
|
+
status = @driver.cleanup
|
43
|
+
expect(status.exitstatus).to eq 0
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'can be interacted with' do
|
47
|
+
frame = @driver.frame
|
48
|
+
frame.find_role(:menu_item, /Title contains/).do_action 0
|
49
|
+
frame.find_role(:menu_item, /View as Icons/).do_action 0
|
50
|
+
frame.find_role(:menu_item, /View as List/).do_action 0
|
51
|
+
frame.find_role(:table_column_header, /Title/).do_action 0
|
52
|
+
|
53
|
+
table_cell = frame.find_role(:table_cell)
|
54
|
+
|
55
|
+
table_cell.n_actions.times do |idx|
|
56
|
+
name = table_cell.get_action_name idx
|
57
|
+
table_cell.do_action idx if name == 'activate'
|
58
|
+
end
|
59
|
+
|
60
|
+
@driver.press_ctrl_q
|
61
|
+
|
62
|
+
status = @driver.cleanup
|
63
|
+
expect(status.exitstatus).to eq 0
|
64
|
+
end
|
65
|
+
|
66
|
+
after do
|
67
|
+
@driver.cleanup
|
68
|
+
end
|
69
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,22 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
# Copyright (C) 2014, 2016 Matijs van Zuijlen
|
3
|
+
# This file is part of Alexandria.
|
5
4
|
#
|
6
|
-
#
|
7
|
-
# modify it under the terms of the GNU General Public License as
|
8
|
-
# published by the Free Software Foundation; either version 2 of the
|
9
|
-
# License, or (at your option) any later version.
|
10
|
-
#
|
11
|
-
# Alexandria is distributed in the hope that it will be useful,
|
12
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
-
# General Public License for more details.
|
15
|
-
#
|
16
|
-
# You should have received a copy of the GNU General Public
|
17
|
-
# License along with Alexandria; see the file COPYING. If not,
|
18
|
-
# write to the Free Software Foundation, Inc., 51 Franklin Street,
|
19
|
-
# Fifth Floor, Boston, MA 02110-1301 USA.
|
5
|
+
# See the file README.md for authorship and licensing information.
|
20
6
|
|
21
7
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '/../lib'))
|
22
8
|
|
@@ -25,14 +11,9 @@ require 'alexandria'
|
|
25
11
|
LIBDIR = File.expand_path(File.join(File.dirname(__FILE__), '/data/libraries'))
|
26
12
|
TESTDIR = File.join(LIBDIR, 'test')
|
27
13
|
|
28
|
-
# def useTestLibrary(version)
|
29
|
-
# libVersion = File.join(LIBDIR, version)
|
30
|
-
# FileUtils.cp_r(libVersion, TESTDIR)
|
31
|
-
# end
|
32
|
-
|
33
14
|
def an_artist_of_the_floating_world
|
34
15
|
Alexandria::Book.new('An Artist of the Floating World',
|
35
|
-
'Kazuo Ishiguro',
|
16
|
+
['Kazuo Ishiguro'],
|
36
17
|
'9780571147168',
|
37
18
|
'Faber and Faber', 1999,
|
38
19
|
'Paperback')
|
@@ -40,8 +21,15 @@ end
|
|
40
21
|
|
41
22
|
Alexandria::UI::Icons.init
|
42
23
|
|
43
|
-
|
44
|
-
|
45
|
-
|
24
|
+
test_store = Alexandria::LibraryStore.new(TESTDIR)
|
25
|
+
Alexandria::LibraryCollection.instance.library_store = test_store
|
26
|
+
|
27
|
+
RSpec.configure do |config|
|
28
|
+
config.before do
|
29
|
+
FileUtils.rm_rf(TESTDIR)
|
30
|
+
end
|
31
|
+
|
32
|
+
config.after do
|
33
|
+
FileUtils.rm_rf(TESTDIR)
|
46
34
|
end
|
47
35
|
end
|
data/tasks/spec.rake
CHANGED
@@ -28,6 +28,19 @@
|
|
28
28
|
|
29
29
|
require 'rspec/core/rake_task'
|
30
30
|
|
31
|
-
|
32
|
-
|
31
|
+
namespace 'spec' do
|
32
|
+
RSpec::Core::RakeTask.new('unit') do |t|
|
33
|
+
t.pattern = 'spec/alexandria/**/*_spec.rb'
|
34
|
+
t.ruby_opts = ['-rbundler/setup -rsimplecov -Ilib -w']
|
35
|
+
end
|
36
|
+
|
37
|
+
RSpec::Core::RakeTask.new('end_to_end') do |t|
|
38
|
+
t.pattern = 'spec/end_to_end/**/*_spec.rb'
|
39
|
+
t.ruby_opts = ['-rbundler/setup -rsimplecov -Ilib -w']
|
40
|
+
end
|
41
|
+
|
42
|
+
desc 'Runs all unit and end-to-end specs'
|
43
|
+
task 'all' => ['spec:unit', 'spec:end_to_end']
|
33
44
|
end
|
45
|
+
|
46
|
+
task default: 'spec:all'
|
data/util/rake/fileinstall.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alexandria-book-collection-manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander McCormmach
|
@@ -28,7 +28,7 @@ authors:
|
|
28
28
|
autorequire:
|
29
29
|
bindir: bin
|
30
30
|
cert_chain: []
|
31
|
-
date:
|
31
|
+
date: 2019-02-27 00:00:00.000000000 Z
|
32
32
|
dependencies:
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: gettext
|
@@ -48,30 +48,30 @@ dependencies:
|
|
48
48
|
name: gstreamer
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- -
|
51
|
+
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 3.
|
53
|
+
version: 3.3.0
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- -
|
58
|
+
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 3.
|
60
|
+
version: 3.3.0
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: gtk3
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- -
|
65
|
+
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: 3.
|
67
|
+
version: 3.3.0
|
68
68
|
type: :runtime
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- -
|
72
|
+
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: 3.
|
74
|
+
version: 3.3.0
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: hpricot
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -106,14 +106,14 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - "~>"
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
109
|
+
version: '2.0'
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
114
|
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version:
|
116
|
+
version: '2.0'
|
117
117
|
- !ruby/object:Gem::Dependency
|
118
118
|
name: marc
|
119
119
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,6 +142,20 @@ dependencies:
|
|
142
142
|
- - "~>"
|
143
143
|
- !ruby/object:Gem::Version
|
144
144
|
version: 0.5.0
|
145
|
+
- !ruby/object:Gem::Dependency
|
146
|
+
name: gnome_app_driver
|
147
|
+
requirement: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - "~>"
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: 0.2.1
|
152
|
+
type: :development
|
153
|
+
prerelease: false
|
154
|
+
version_requirements: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - "~>"
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: 0.2.1
|
145
159
|
- !ruby/object:Gem::Dependency
|
146
160
|
name: minitest
|
147
161
|
requirement: !ruby/object:Gem::Requirement
|
@@ -193,6 +207,7 @@ extensions: []
|
|
193
207
|
extra_rdoc_files: []
|
194
208
|
files:
|
195
209
|
- ".gitignore"
|
210
|
+
- ".hound.yml"
|
196
211
|
- ".reek"
|
197
212
|
- ".rubocop.yml"
|
198
213
|
- ".rubocop_todo.yml"
|
@@ -227,9 +242,7 @@ files:
|
|
227
242
|
- lib/alexandria/book_providers/amazon_aws.rb
|
228
243
|
- lib/alexandria/book_providers/amazon_ecs_util.rb
|
229
244
|
- lib/alexandria/book_providers/barnes_and_noble.rb
|
230
|
-
- lib/alexandria/book_providers/deastore.rb
|
231
245
|
- lib/alexandria/book_providers/douban.rb
|
232
|
-
- lib/alexandria/book_providers/mcu.rb
|
233
246
|
- lib/alexandria/book_providers/proxis.rb
|
234
247
|
- lib/alexandria/book_providers/pseudomarc.rb
|
235
248
|
- lib/alexandria/book_providers/renaud.rb
|
@@ -242,9 +255,13 @@ files:
|
|
242
255
|
- lib/alexandria/console.rb
|
243
256
|
- lib/alexandria/default_preferences.rb
|
244
257
|
- lib/alexandria/execution_queue.rb
|
258
|
+
- lib/alexandria/export_format.rb
|
245
259
|
- lib/alexandria/export_library.rb
|
246
260
|
- lib/alexandria/import_library.rb
|
247
261
|
- lib/alexandria/import_library_csv.rb
|
262
|
+
- lib/alexandria/library_collection.rb
|
263
|
+
- lib/alexandria/library_sort_order.rb
|
264
|
+
- lib/alexandria/library_store.rb
|
248
265
|
- lib/alexandria/logging.rb
|
249
266
|
- lib/alexandria/models/book.rb
|
250
267
|
- lib/alexandria/models/library.rb
|
@@ -268,6 +285,7 @@ files:
|
|
268
285
|
- lib/alexandria/ui/dialogs/book_properties_dialog_base.rb
|
269
286
|
- lib/alexandria/ui/dialogs/export_dialog.rb
|
270
287
|
- lib/alexandria/ui/dialogs/import_dialog.rb
|
288
|
+
- lib/alexandria/ui/dialogs/keep_bad_isbn_dialog.rb
|
271
289
|
- lib/alexandria/ui/dialogs/misc_dialogs.rb
|
272
290
|
- lib/alexandria/ui/dialogs/new_book_dialog.rb
|
273
291
|
- lib/alexandria/ui/dialogs/new_book_dialog_manual.rb
|
@@ -445,10 +463,14 @@ files:
|
|
445
463
|
- share/sounds/alexandria/scanning.wav
|
446
464
|
- spec/alexandria/book_providers_spec.rb
|
447
465
|
- spec/alexandria/book_spec.rb
|
466
|
+
- spec/alexandria/console_spec.rb
|
467
|
+
- spec/alexandria/export_library_spec.rb
|
448
468
|
- spec/alexandria/library_spec.rb
|
469
|
+
- spec/alexandria/library_store_spec.rb
|
449
470
|
- spec/alexandria/preferences_spec.rb
|
450
471
|
- spec/alexandria/scanners/cuecat_spec.rb
|
451
472
|
- spec/alexandria/smart_library_spec.rb
|
473
|
+
- spec/alexandria/ui/dialogs/new_book_dialog_spec.rb
|
452
474
|
- spec/alexandria/ui/dialogs_spec.rb
|
453
475
|
- spec/alexandria/ui/iconview_spec.rb
|
454
476
|
- spec/alexandria/ui/main_app_spec.rb
|
@@ -474,6 +496,7 @@ files:
|
|
474
496
|
- spec/data/libraries/0.6.2/My Library/9780575079038.yaml
|
475
497
|
- spec/data/libraries/0.6.2/My Library/9780755322800.cover
|
476
498
|
- spec/data/libraries/0.6.2/My Library/9780755322800.yaml
|
499
|
+
- spec/end_to_end/basic_run_spec.rb
|
477
500
|
- spec/spec_helper.rb
|
478
501
|
- tasks/dogtail.rake
|
479
502
|
- tasks/setup.rb
|
@@ -502,8 +525,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
502
525
|
- !ruby/object:Gem::Version
|
503
526
|
version: '0'
|
504
527
|
requirements: []
|
505
|
-
|
506
|
-
rubygems_version: 2.7.6
|
528
|
+
rubygems_version: 3.0.1
|
507
529
|
signing_key:
|
508
530
|
specification_version: 4
|
509
531
|
summary: GNOME application for managing collections of books
|