alexandria-book-collection-manager 0.7.3 → 0.7.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) 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 +4 -1
  5. data/.rubocop.yml +86 -36
  6. data/.rubocop_todo.yml +58 -161
  7. data/.simplecov +5 -2
  8. data/CHANGELOG.md +56 -2
  9. data/Gemfile +4 -3
  10. data/INSTALL.md +23 -11
  11. data/README.md +52 -41
  12. data/Rakefile +78 -75
  13. data/alexandria-book-collection-manager.gemspec +50 -44
  14. data/bin/alexandria +12 -22
  15. data/doc/FAQ +1 -2
  16. data/doc/dependency_decisions.yml +27 -8
  17. data/lib/alexandria.rb +25 -23
  18. data/lib/alexandria/about.rb +50 -50
  19. data/lib/alexandria/book_providers.rb +86 -91
  20. data/lib/alexandria/book_providers/adlibris.rb +37 -74
  21. data/lib/alexandria/book_providers/amazon_aws.rb +94 -100
  22. data/lib/alexandria/book_providers/amazon_ecs_util.rb +289 -324
  23. data/lib/alexandria/book_providers/barnes_and_noble.rb +42 -42
  24. data/lib/alexandria/book_providers/douban.rb +25 -41
  25. data/lib/alexandria/book_providers/proxis.rb +34 -29
  26. data/lib/alexandria/book_providers/pseudomarc.rb +77 -85
  27. data/lib/alexandria/book_providers/siciliano.rb +60 -64
  28. data/lib/alexandria/book_providers/thalia_provider.rb +161 -0
  29. data/lib/alexandria/book_providers/web.rb +5 -5
  30. data/lib/alexandria/book_providers/worldcat.rb +66 -95
  31. data/lib/alexandria/book_providers/z3950.rb +153 -169
  32. data/lib/alexandria/config.rb +1 -1
  33. data/lib/alexandria/console.rb +3 -3
  34. data/lib/alexandria/default_preferences.rb +37 -0
  35. data/lib/alexandria/execution_queue.rb +13 -12
  36. data/lib/alexandria/export_format.rb +8 -8
  37. data/lib/alexandria/export_library.rb +128 -127
  38. data/lib/alexandria/import_library.rb +102 -126
  39. data/lib/alexandria/import_library_csv.rb +41 -41
  40. data/lib/alexandria/library_collection.rb +6 -5
  41. data/lib/alexandria/library_sort_order.rb +4 -2
  42. data/lib/alexandria/library_store.rb +39 -28
  43. data/lib/alexandria/logging.rb +10 -14
  44. data/lib/alexandria/models/book.rb +5 -4
  45. data/lib/alexandria/models/library.rb +63 -53
  46. data/lib/alexandria/net.rb +5 -6
  47. data/lib/alexandria/preferences.rb +66 -63
  48. data/lib/alexandria/scanners.rb +2 -2
  49. data/lib/alexandria/scanners/{cuecat.rb → cue_cat.rb} +17 -17
  50. data/lib/alexandria/scanners/keyboard.rb +8 -8
  51. data/lib/alexandria/smart_library.rb +110 -112
  52. data/lib/alexandria/ui.rb +15 -15
  53. data/lib/alexandria/ui/{dialogs/about_dialog.rb → about_dialog.rb} +2 -2
  54. data/lib/alexandria/ui/{dialogs/acquire_dialog.rb → acquire_dialog.rb} +108 -109
  55. data/lib/alexandria/ui/alert_dialog.rb +66 -0
  56. data/lib/alexandria/ui/{dialogs/bad_isbns_dialog.rb → bad_isbns_dialog.rb} +13 -9
  57. data/lib/alexandria/ui/{dialogs/barcode_animation.rb → barcode_animation.rb} +16 -15
  58. data/lib/alexandria/ui/{dialogs/book_properties_dialog.rb → book_properties_dialog.rb} +25 -38
  59. data/lib/alexandria/ui/{dialogs/book_properties_dialog_base.rb → book_properties_dialog_base.rb} +64 -157
  60. data/lib/alexandria/ui/builder_base.rb +1 -1
  61. data/lib/alexandria/ui/calendar_popup.rb +58 -0
  62. data/lib/alexandria/ui/callbacks.rb +187 -155
  63. data/lib/alexandria/ui/completion_models.rb +8 -22
  64. data/lib/alexandria/ui/confirm_erase_dialog.rb +33 -0
  65. data/lib/alexandria/ui/conflict_while_copying_dialog.rb +34 -0
  66. data/lib/alexandria/ui/dndable.rb +7 -7
  67. data/lib/alexandria/ui/error_dialog.rb +25 -0
  68. data/lib/alexandria/ui/{dialogs/export_dialog.rb → export_dialog.rb} +37 -58
  69. data/lib/alexandria/ui/icons.rb +38 -43
  70. data/lib/alexandria/ui/iconview.rb +12 -10
  71. data/lib/alexandria/ui/iconview_tooltips.rb +41 -54
  72. data/lib/alexandria/ui/import_dialog.rb +157 -0
  73. data/lib/alexandria/ui/init.rb +30 -41
  74. data/lib/alexandria/ui/{dialogs/keep_bad_isbn_dialog.rb → keep_bad_isbn_dialog.rb} +9 -6
  75. data/lib/alexandria/ui/libraries_combo.rb +15 -14
  76. data/lib/alexandria/ui/listview.rb +69 -67
  77. data/lib/alexandria/ui/main_app.rb +24 -26
  78. data/lib/alexandria/ui/misc_dialogs.rb +10 -0
  79. data/lib/alexandria/ui/multi_drag_treeview.rb +8 -9
  80. data/lib/alexandria/ui/{dialogs/new_book_dialog.rb → new_book_dialog.rb} +113 -114
  81. data/lib/alexandria/ui/{dialogs/new_book_dialog_manual.rb → new_book_dialog_manual.rb} +22 -19
  82. data/lib/alexandria/ui/new_provider_dialog.rb +100 -0
  83. data/lib/alexandria/ui/new_smart_library_dialog.rb +74 -0
  84. data/lib/alexandria/ui/preferences_dialog.rb +313 -0
  85. data/lib/alexandria/ui/provider_preferences_base_dialog.rb +95 -0
  86. data/lib/alexandria/ui/provider_preferences_dialog.rb +35 -0
  87. data/lib/alexandria/ui/{dialogs/misc_dialogs.rb → really_delete_dialog.rb} +7 -28
  88. data/lib/alexandria/ui/{sidepane.rb → sidepane_manager.rb} +53 -48
  89. data/lib/alexandria/ui/skip_entry_dialog.rb +33 -0
  90. data/lib/alexandria/ui/smart_library_properties_dialog.rb +60 -0
  91. data/lib/alexandria/ui/smart_library_properties_dialog_base.rb +242 -0
  92. data/lib/alexandria/ui/smart_library_rule_box.rb +119 -0
  93. data/lib/alexandria/ui/sound.rb +11 -13
  94. data/lib/alexandria/ui/ui_manager.rb +216 -200
  95. data/lib/alexandria/version.rb +4 -19
  96. data/lib/alexandria/web_themes.rb +21 -21
  97. data/po/Makefile +2 -2
  98. data/po/cs.po +992 -875
  99. data/po/cy.po +961 -874
  100. data/po/de.po +990 -865
  101. data/po/el.po +989 -865
  102. data/po/es.po +985 -861
  103. data/po/fr.po +987 -867
  104. data/po/ga.po +908 -820
  105. data/po/gl.po +980 -860
  106. data/po/it.po +986 -864
  107. data/po/ja.po +969 -849
  108. data/po/mk.po +984 -860
  109. data/po/nb.po +979 -859
  110. data/po/nl.po +983 -860
  111. data/po/pl.po +1018 -971
  112. data/po/pt.po +988 -857
  113. data/po/pt_BR.po +983 -863
  114. data/po/ru.po +994 -871
  115. data/po/sk.po +989 -867
  116. data/po/sv.po +976 -856
  117. data/po/uk.po +972 -858
  118. data/po/zh_TW.po +974 -854
  119. data/schemas/alexandria.schemas +24 -2
  120. data/share/alexandria/glade/acquire_dialog__builder.glade +1 -1
  121. data/share/alexandria/glade/book_properties_dialog__builder.glade +1 -1
  122. data/share/alexandria/glade/main_app__builder.glade +6 -21
  123. data/share/alexandria/glade/new_book_dialog__builder.glade +1 -1
  124. data/share/alexandria/glade/preferences_dialog__builder.glade +1 -1
  125. data/share/gnome/help/alexandria/C/introduction.xml +0 -4
  126. data/share/gnome/help/alexandria/C/searching.xml +1 -1
  127. data/share/gnome/help/alexandria/C/smart-libraries.xml +2 -2
  128. data/share/gnome/help/alexandria/C/working-with-libraries.xml +1 -1
  129. data/share/gnome/help/alexandria/fr/alexandria.xml +1 -1
  130. data/share/gnome/help/alexandria/ja/introduction.xml +0 -4
  131. data/share/gnome/help/alexandria/ja/smart-libraries.xml +1 -1
  132. data/spec/alexandria/book_providers/thalia_provider_spec.rb +119 -0
  133. data/spec/alexandria/book_providers/world_cat_provider_spec.rb +160 -0
  134. data/spec/alexandria/book_providers_spec.rb +62 -156
  135. data/spec/alexandria/book_spec.rb +12 -10
  136. data/spec/alexandria/console_spec.rb +6 -11
  137. data/spec/alexandria/export_library_spec.rb +47 -58
  138. data/spec/alexandria/library_spec.rb +121 -109
  139. data/spec/alexandria/library_store_spec.rb +8 -8
  140. data/spec/alexandria/preferences_spec.rb +44 -17
  141. data/spec/alexandria/scanners/cue_cat_spec.rb +52 -0
  142. data/spec/alexandria/smart_library_spec.rb +15 -15
  143. data/spec/alexandria/ui/about_dialog_spec.rb +14 -0
  144. data/spec/alexandria/ui/acquire_dialog_spec.rb +14 -0
  145. data/spec/alexandria/ui/alert_dialog_spec.rb +16 -0
  146. data/spec/alexandria/ui/bad_isbns_dialog_spec.rb +14 -0
  147. data/spec/alexandria/ui/book_properties_dialog_spec.rb +59 -0
  148. data/spec/alexandria/ui/confirm_erase_dialog_spec.rb +14 -0
  149. data/spec/alexandria/ui/conflict_while_copying_dialog_spec.rb +16 -0
  150. data/spec/alexandria/ui/error_dialog_spec.rb +14 -0
  151. data/spec/alexandria/ui/export_dialog_spec.rb +36 -0
  152. data/spec/alexandria/ui/icons_spec.rb +26 -0
  153. data/spec/alexandria/ui/iconview_spec.rb +7 -21
  154. data/spec/alexandria/ui/import_dialog_spec.rb +46 -0
  155. data/spec/alexandria/ui/keep_bad_isbn_dialog_spec.rb +17 -0
  156. data/spec/alexandria/ui/main_app_spec.rb +7 -34
  157. data/spec/alexandria/ui/new_book_dialog_manual_spec.rb +51 -0
  158. data/spec/alexandria/ui/{dialogs/new_book_dialog_spec.rb → new_book_dialog_spec.rb} +4 -4
  159. data/spec/alexandria/ui/new_provider_dialog_spec.rb +30 -0
  160. data/spec/alexandria/ui/new_smart_library_dialog_spec.rb +39 -0
  161. data/spec/alexandria/ui/preferences_dialog_spec.rb +14 -0
  162. data/spec/alexandria/ui/provider_preferences_dialog_spec.rb +34 -0
  163. data/spec/alexandria/ui/really_delete_dialog_spec.rb +16 -0
  164. data/spec/alexandria/ui/sidepane_manager_spec.rb +15 -0
  165. data/spec/alexandria/ui/skip_entry_dialog_spec.rb +14 -0
  166. data/spec/alexandria/ui/smart_library_properties_dialog_spec.rb +49 -0
  167. data/spec/alexandria/ui/sound_spec.rb +2 -2
  168. data/spec/alexandria/ui/ui_manager_spec.rb +44 -20
  169. data/spec/end_to_end/basic_run_spec.rb +21 -38
  170. data/spec/fixtures/cover.jpg +0 -0
  171. data/spec/spec_helper.rb +54 -10
  172. data/tasks/setup.rb +2 -2
  173. data/tasks/spec.rake +11 -11
  174. data/util/rake/fileinstall.rb +38 -35
  175. data/util/rake/gettextgenerate.rb +7 -7
  176. data/util/rake/omfgenerate.rb +7 -7
  177. metadata +158 -45
  178. data/dogtail/basic_run_test.py +0 -9
  179. data/lib/alexandria/book_providers/renaud.rb +0 -155
  180. data/lib/alexandria/book_providers/thalia.rb +0 -198
  181. data/lib/alexandria/ui/dialogs/alert_dialog.rb +0 -63
  182. data/lib/alexandria/ui/dialogs/import_dialog.rb +0 -176
  183. data/lib/alexandria/ui/dialogs/new_smart_library_dialog.rb +0 -62
  184. data/lib/alexandria/ui/dialogs/preferences_dialog.rb +0 -563
  185. data/lib/alexandria/ui/dialogs/smart_library_properties_dialog.rb +0 -61
  186. data/lib/alexandria/ui/dialogs/smart_library_properties_dialog_base.rb +0 -423
  187. data/spec/alexandria/scanners/cuecat_spec.rb +0 -67
  188. data/spec/alexandria/ui/dialogs_spec.rb +0 -162
  189. data/spec/alexandria/ui/sidepane_spec.rb +0 -29
  190. data/spec/alexandria/ui/ui_utilities_spec.rb +0 -62
  191. data/spec/alexandria/utilities_spec.rb +0 -52
  192. data/tasks/dogtail.rake +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5ce199935fd434ee40793e79cf4f8ad31c4f140e26844ae0bad7f6d111d5486
4
- data.tar.gz: 76f857b281f0b11c6485d4196b2f47e3980eb4ff8ea7fe89797e7321388f0cf2
3
+ metadata.gz: 86ff53adf7e1792c32534b149370ab80a99a24c8a363273a1ca3d3f83e2c73c0
4
+ data.tar.gz: 6a38d050f6cf13a9d86e0c387cdbe472442a02c33f74563f4902f4338deac228
5
5
  SHA512:
6
- metadata.gz: 4f49799facc13291bac2d34f82af36fc2cd9461eddf21b0f2cb30fa089517f4f5f2ed41713cba354c72a9143df5273059614969257834836ea604213fe05f47a
7
- data.tar.gz: 89ab1a4b55b5df6b1ae9c2ec5f0ebcf82ad79e10208c6ff51572f59ccfa59ebeed51dfecac96b15e4442ffe081c5f717b2491478d3cad870aa1ae9be0012572e
6
+ metadata.gz: fbd36ea7f9caaabff7979e3ab57471e27a6a1a5daa33ce140d4a8df590b07d91f4302267db64c601281f3513401e5726a1874dba622a4d9e72a361c7898c1284
7
+ data.tar.gz: 87c17e9d9bc4c4bd057a1013068d034a48ca38e3fcd5784a743a1c1d971671165df4347bcb2aa710dd4a636ecc3d1bfdbee1f0bfe7a4eb7fccd7d4fb8acddd77
@@ -0,0 +1,9 @@
1
+ # Documentation for all configuration options:
2
+ # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3
+
4
+ version: 2
5
+ updates:
6
+ - package-ecosystem: "bundler"
7
+ directory: "/"
8
+ schedule:
9
+ interval: "daily"
@@ -0,0 +1,77 @@
1
+ # This workflow will download a prebuilt Ruby version, install dependencies and
2
+ # run tests with Rake
3
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
4
+
5
+ name: Ruby
6
+
7
+ on:
8
+ push:
9
+ branches: [ master ]
10
+ pull_request:
11
+ branches: [ master ]
12
+
13
+ jobs:
14
+ test:
15
+
16
+ runs-on: ubuntu-latest
17
+
18
+ strategy:
19
+ matrix:
20
+ ruby: [2.5, 2.6, 2.7]
21
+
22
+ steps:
23
+ - uses: actions/checkout@v2
24
+ - name: Install non-ruby dependencies
25
+ run: |
26
+ # Needed for gtk3 gem
27
+ sudo apt-get install libgtk-3-dev
28
+ # Needed for gstreamer gem
29
+ sudo apt-get install libgstreamer1.0-dev
30
+ # Needed for GooCanvas::Canvas widget
31
+ sudo apt-get install libgoocanvas-2.0-dev
32
+ # Needed for zoom gem
33
+ sudo apt-get install libyaz-dev
34
+ # Needed for intltool-merge executable
35
+ sudo apt-get install intltool
36
+ # Needed for gconftool-2 executable
37
+ sudo apt-get install gconf2
38
+ # Needed to provide A11y dbus service to silence warnings
39
+ sudo apt-get install at-spi2-core
40
+ # Needed to set up sound player pipeline
41
+ sudo apt-get install gstreamer1.0-plugins-good
42
+ # Needed to play sound
43
+ sudo apt-get install pulseaudio
44
+ # Provides xvfb-run
45
+ sudo apt-get install xvfb
46
+
47
+ - name: Set up Ruby
48
+ uses: ruby/setup-ruby@v1
49
+ with:
50
+ ruby-version: ${{ matrix.ruby }}
51
+ bundler-cache: true
52
+ - name: Run unit tests
53
+ run: xvfb-run bundle exec rake spec:unit
54
+ - name: Run end-to-end tests in a dbus session
55
+ run: xvfb-run dbus-run-session bundle exec rake spec:end_to_end
56
+
57
+ rubocop:
58
+
59
+ runs-on: ubuntu-latest
60
+
61
+ steps:
62
+ - uses: actions/checkout@v2
63
+ - name: Install non-ruby dependencies
64
+ run: |
65
+ # Needed for gtk3 gem
66
+ sudo apt-get install libgtk-3-dev
67
+ # Needed for gstreamer gem
68
+ sudo apt-get install libgstreamer1.0-dev
69
+ # Needed for zoom gem
70
+ sudo apt-get install libyaz-dev
71
+ - name: Set up Ruby
72
+ uses: ruby/setup-ruby@v1
73
+ with:
74
+ ruby-version: 2.7
75
+ bundler-cache: true
76
+ - name: Run RuboCop
77
+ run: bundle exec rubocop -P
data/.gitignore CHANGED
@@ -3,13 +3,16 @@ config.save
3
3
  alexandria.desktop
4
4
  alexandria.desktop.in.h
5
5
  .svn-authors
6
- lib/alexandria/default_preferences.rb
7
6
  Gemfile.lock
8
7
  .yardoc/
9
8
  share/locale/
10
9
  share/omf/alexandria/*.omf
10
+ spec/examples.txt
11
11
  pkg/
12
12
  coverage/
13
13
  tmp/
14
+ po/*.po~
15
+ po/*.mo
16
+ po/*.pot
14
17
  *.gem
15
18
  *.glade~
@@ -1,18 +1,47 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ require:
4
+ - rubocop-performance
5
+ - rubocop-rspec
6
+ - rubocop-i18n
7
+
1
8
  AllCops:
2
9
  Exclude:
3
10
  - 'lib/alexandria/default_preferences.rb'
4
11
  - 'pkg/**/*'
5
- TargetRubyVersion: 2.3
12
+ - 'vendor/bundle/**/*'
13
+ NewCops: enable
14
+ TargetRubyVersion: 2.5
15
+
16
+ # Choose GetText-style I18n cops
17
+ GetText:
18
+ Enabled: true
19
+ # Exclude non-user-facing code
20
+ Exclude:
21
+ - Rakefile
22
+ - 'util/**/*'
23
+ - 'spec/**/*'
24
+ RailsI18n:
25
+ Enabled: false
6
26
 
7
- # Dot at end of line makes it clearer that the line is not done
8
- Layout/DotPosition:
9
- EnforcedStyle: trailing
27
+ # This code has a lot of pre-existing translations with percent-style
28
+ # formatting. Maybe one day someone will re-do all of them ...
29
+ GetText/DecorateStringFormattingUsingPercent:
30
+ Enabled: false
10
31
 
11
- # Multi-line assignment should be simply indented. Aligning them makes it even
12
- # harder to keep a sane line length.
13
- Layout/MultilineOperationIndentation:
14
- EnforcedStyle: indented
32
+ # Make BeginEndAlignment behavior match EndAlignment
33
+ Layout/BeginEndAlignment:
34
+ EnforcedStyleAlignWith: begin
35
+
36
+ Layout/HashAlignment:
37
+ EnforcedColonStyle: key
38
+ EnforcedHashRocketStyle: table
39
+
40
+ # Be lenient with line length
41
+ Layout/LineLength:
42
+ Max: 92
15
43
 
44
+ # Don't force lonely closing parentheses
16
45
  Layout/MultilineMethodCallBraceLayout:
17
46
  EnforcedStyle: same_line
18
47
 
@@ -21,71 +50,98 @@ Layout/MultilineMethodCallBraceLayout:
21
50
  Layout/MultilineMethodCallIndentation:
22
51
  EnforcedStyle: indented
23
52
 
24
- # Make syntax for empty and filled blocks consistent
53
+ # Multi-line assignment should be simply indented. Aligning them makes it even
54
+ # harder to keep a sane line length.
55
+ Layout/MultilineOperationIndentation:
56
+ EnforcedStyle: indented
57
+
58
+ # Force consistent spacing independent of block contents
25
59
  Layout/SpaceBeforeBlockBraces:
26
60
  EnforcedStyleForEmptyBraces: space
27
61
 
28
- Layout/AlignHash:
29
- EnforcedColonStyle: key
30
- EnforcedHashRocketStyle: table
62
+ # Assume the programmer knows how bracketed block syntax works
63
+ Lint/AmbiguousBlockAssociation:
64
+ Enabled: false
31
65
 
32
66
  # Allow if (foo = get_foo) style
33
67
  Lint/AssignmentInCondition:
34
68
  AllowSafeAssignment: true
35
69
 
70
+ # This cop's reach is too broad
71
+ # See https://github.com/rubocop-hq/rubocop/pull/8480
72
+ Lint/MissingSuper:
73
+ Enabled: false
74
+
36
75
  # Blocks in specs can be any size
37
76
  Metrics/BlockLength:
38
77
  Exclude:
39
78
  - 'spec/**/*'
40
79
 
41
- # Be lenient with line length
42
- Metrics/LineLength:
43
- Max: 110
44
-
45
80
  Naming/AccessorMethodName:
46
81
  Enabled: false
47
82
 
48
- # Allow multi-line blocks of all sorts
49
- Style/BlockDelimiters:
50
- Enabled: false
83
+ # Avoid one-letter exception variable name
84
+ Naming/RescuedExceptionsVariableName:
85
+ PreferredName: ex
86
+
87
+ Performance/EndWith:
88
+ AutoCorrect: true
89
+
90
+ Performance/StartWith:
91
+ AutoCorrect: true
92
+
93
+ # End-to-end specs do not describe classes
94
+ RSpec/DescribeClass:
95
+ Exclude:
96
+ - 'spec/end_to_end/**/*_spec.rb'
97
+
98
+ RSpec/ExampleLength:
99
+ Max: 8
100
+ Exclude:
101
+ - 'spec/end_to_end/**/*_spec.rb'
51
102
 
52
103
  # Allow and/or for control flow only
53
104
  Style/AndOr:
54
- Enabled: conditionals
105
+ EnforcedStyle: conditionals
55
106
 
56
107
  # Require at least two dependent lines before suggesting a guard clause
57
108
  Style/GuardClause:
58
109
  MinBodyLength: 2
59
110
 
60
- # Not all objects that handle #== 0 also handle #zero?
61
- Style/NumericPredicate:
62
- Enabled: false
63
-
64
111
  # Sometimes an if statement just looks better than next with a guard clause
65
112
  Style/Next:
66
113
  Enabled: false
67
114
 
115
+ # Not all objects that handle #== 0 also handle #zero?
116
+ Style/NumericPredicate:
117
+ Enabled: false
118
+
68
119
  # Use older RuboCop default
69
120
  Style/PercentLiteralDelimiters:
70
121
  PreferredDelimiters:
122
+ '%W': ()
71
123
  '%w': ()
72
124
 
73
125
  # Allow explicit return with multiple return values
74
126
  Style/RedundantReturn:
75
127
  AllowMultipleReturnValues: true
76
128
 
77
- # Always use raise to raise exceptions
78
- Style/SignalException:
79
- EnforcedStyle: only_raise
80
-
81
129
  Style/SingleLineBlockParams:
82
130
  Enabled: false
83
131
 
84
- # I like to have symbols always look like symbols
132
+ # Allow all ways to construct strings for now
133
+ Style/StringConcatenation:
134
+ Enabled: false
135
+
136
+ # Do not commit to use of interpolation
137
+ Style/StringLiterals:
138
+ EnforcedStyle: double_quotes
139
+
140
+ # Prefer symbols to look like symbols
85
141
  Style/SymbolArray:
86
142
  EnforcedStyle: brackets
87
143
 
88
- # Accessors are only trivial if they match the ivar name.
144
+ # Accessors are only trivial if they match the ivar name
89
145
  Style/TrivialAccessors:
90
146
  ExactNameMatch: true
91
147
 
@@ -96,9 +152,3 @@ Style/TrailingCommaInArrayLiteral:
96
152
  # Alexandria uses regular arrays
97
153
  Style/WordArray:
98
154
  Enabled: false
99
-
100
- # Not all objects that handle #length also handle #empty?
101
- Style/ZeroLengthPredicate:
102
- Enabled: false
103
-
104
- inherit_from: .rubocop_todo.yml
@@ -1,136 +1,100 @@
1
1
  # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2019-02-27 08:50:25 +0100 using RuboCop version 0.65.0.
2
+ # `rubocop --auto-gen-config --no-offense-counts --no-auto-gen-timestamp`
3
+ # using RuboCop version 0.93.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 2
10
- Lint/IneffectiveAccessModifier:
11
- Exclude:
12
- - 'lib/alexandria/logging.rb'
13
- - 'lib/alexandria/web_themes.rb'
14
-
15
- # Offense count: 1
16
- Lint/UriEscapeUnescape:
17
- Exclude:
18
- - 'lib/alexandria/book_providers/amazon_ecs_util.rb'
19
-
20
- # Offense count: 2
21
- # Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
22
- Lint/UselessAccessModifier:
23
- Exclude:
24
- - 'lib/alexandria/logging.rb'
25
-
26
- # Offense count: 165
9
+ # Configuration parameters: IgnoredMethods.
27
10
  Metrics/AbcSize:
28
- Max: 161
11
+ Max: 111
29
12
 
30
- # Offense count: 21
31
- # Configuration parameters: CountComments, ExcludedMethods.
13
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
32
14
  # ExcludedMethods: refine
33
15
  Metrics/BlockLength:
34
- Max: 66
16
+ Max: 64
35
17
 
36
- # Offense count: 13
37
18
  # Configuration parameters: CountBlocks.
38
19
  Metrics/BlockNesting:
39
20
  Max: 5
40
21
 
41
- # Offense count: 32
42
- # Configuration parameters: CountComments.
22
+ # Configuration parameters: CountComments, CountAsOne.
43
23
  Metrics/ClassLength:
44
- Max: 985
24
+ Max: 997
45
25
 
46
- # Offense count: 65
26
+ # Configuration parameters: IgnoredMethods.
47
27
  Metrics/CyclomaticComplexity:
48
- Max: 22
28
+ Max: 27
49
29
 
50
- # Offense count: 212
51
- # Configuration parameters: CountComments, ExcludedMethods.
30
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
52
31
  Metrics/MethodLength:
53
- Max: 109
32
+ Max: 98
54
33
 
55
- # Offense count: 1
56
- # Configuration parameters: CountComments.
34
+ # Configuration parameters: CountComments, CountAsOne.
57
35
  Metrics/ModuleLength:
58
- Max: 338
36
+ Max: 361
59
37
 
60
- # Offense count: 10
61
38
  # Configuration parameters: CountKeywordArgs.
62
39
  Metrics/ParameterLists:
63
40
  Max: 7
64
41
 
65
- # Offense count: 62
42
+ # Configuration parameters: IgnoredMethods.
66
43
  Metrics/PerceivedComplexity:
67
- Max: 23
44
+ Max: 27
68
45
 
69
- # Offense count: 8
70
46
  Naming/BinaryOperatorParameterName:
71
47
  Exclude:
72
- - 'lib/alexandria/book_providers.rb'
73
48
  - 'lib/alexandria/book_providers/amazon_ecs_util.rb'
74
- - 'lib/alexandria/models/book.rb'
75
- - 'lib/alexandria/models/library.rb'
76
- - 'lib/alexandria/smart_library.rb'
77
- - 'lib/alexandria/ui/multi_drag_treeview.rb'
78
49
 
79
- # Offense count: 13
80
- # Configuration parameters: Blacklist.
81
- # Blacklist: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
50
+ # Configuration parameters: ForbiddenDelimiters.
51
+ # ForbiddenDelimiters: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
82
52
  Naming/HeredocDelimiterNaming:
83
53
  Exclude:
84
54
  - 'Rakefile'
85
55
  - 'bin/alexandria'
86
56
  - 'lib/alexandria/export_library.rb'
87
- - 'lib/alexandria/ui/dialogs/about_dialog.rb'
88
-
89
- # Offense count: 2
90
- # Configuration parameters: EnforcedStyleForLeadingUnderscores.
91
- # SupportedStylesForLeadingUnderscores: disallowed, required, optional
92
- Naming/MemoizedInstanceVariableName:
93
- Exclude:
94
- - 'lib/alexandria/logging.rb'
57
+ - 'lib/alexandria/ui/about_dialog.rb'
95
58
 
96
- # Offense count: 4
97
- # Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist, MethodDefinitionMacros.
59
+ # Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
98
60
  # NamePrefix: is_, has_, have_
99
- # NamePrefixBlacklist: is_, has_, have_
100
- # NameWhitelist: is_a?
61
+ # ForbiddenPrefixes: is_, has_, have_
62
+ # AllowedMethods: is_a?
101
63
  # MethodDefinitionMacros: define_method, define_singleton_method
102
64
  Naming/PredicateName:
103
65
  Exclude:
104
66
  - 'spec/**/*'
105
67
  - 'lib/alexandria/book_providers/amazon_ecs_util.rb'
106
- - 'lib/alexandria/ui/dialogs/smart_library_properties_dialog_base.rb'
68
+ - 'lib/alexandria/ui/smart_library_properties_dialog_base.rb'
107
69
  - 'lib/alexandria/web_themes.rb'
108
70
 
109
- # Offense count: 10
110
- # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
111
- # AllowedNames: io, id, to, by, on, in, at, ip, db
112
- Naming/UncommunicativeMethodParamName:
71
+ # Configuration parameters: CustomTransform, IgnoreMethods, SpecSuffixOnly.
72
+ RSpec/FilePath:
113
73
  Exclude:
114
- - 'lib/alexandria/book_providers/amazon_ecs_util.rb'
115
- - 'lib/alexandria/book_providers/proxis.rb'
116
- - 'lib/alexandria/book_providers/pseudomarc.rb'
117
- - 'lib/alexandria/smart_library.rb'
118
- - 'lib/alexandria/ui/callbacks.rb'
119
- - 'lib/alexandria/ui/init.rb'
120
- - 'util/rake/fileinstall.rb'
74
+ - 'spec/alexandria/ui/iconview_spec.rb'
75
+ - 'spec/alexandria/ui/sound_spec.rb'
76
+
77
+ RSpec/MultipleExpectations:
78
+ Max: 7
121
79
 
122
- # Offense count: 8
123
80
  # Cop supports --auto-correct.
124
- # Configuration parameters: AutoCorrect, EnforcedStyle.
81
+ # Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers.
82
+ # SupportedStyles: inflected, explicit
83
+ RSpec/PredicateMatcher:
84
+ Exclude:
85
+ - 'spec/alexandria/export_library_spec.rb'
86
+ - 'spec/alexandria/library_spec.rb'
87
+ - 'spec/alexandria/library_store_spec.rb'
88
+ - 'spec/alexandria/scanners/cue_cat_spec.rb'
89
+
90
+ # Cop supports --auto-correct.
91
+ # Configuration parameters: EnforcedStyle.
125
92
  # SupportedStyles: nested, compact
126
93
  Style/ClassAndModuleChildren:
127
94
  Exclude:
128
- - 'lib/alexandria/ui/dialogs/import_dialog.rb'
129
- - 'lib/alexandria/ui/dialogs/preferences_dialog.rb'
130
- - 'lib/alexandria/ui/icons.rb'
131
95
  - 'lib/alexandria/ui/init.rb'
96
+ - 'lib/alexandria/ui/provider_preferences_base_dialog.rb'
132
97
 
133
- # Offense count: 17
134
98
  Style/ClassVars:
135
99
  Exclude:
136
100
  - 'lib/alexandria/book_providers/amazon_ecs_util.rb'
@@ -138,101 +102,34 @@ Style/ClassVars:
138
102
  - 'lib/alexandria/logging.rb'
139
103
  - 'lib/alexandria/models/library.rb'
140
104
  - 'lib/alexandria/smart_library.rb'
141
- - 'lib/alexandria/ui/dialogs/acquire_dialog.rb'
142
- - 'lib/alexandria/ui/dialogs/book_properties_dialog_base.rb'
143
- - 'lib/alexandria/ui/dialogs/new_book_dialog.rb'
144
-
145
- # Offense count: 11
146
- Style/CommentedKeyword:
147
- Exclude:
148
- - 'lib/alexandria/book_providers.rb'
149
- - 'lib/alexandria/book_providers/barnes_and_noble.rb'
150
- - 'lib/alexandria/book_providers/worldcat.rb'
151
- - 'lib/alexandria/ui/dialogs/new_book_dialog.rb'
152
- - 'util/rake/fileinstall.rb'
105
+ - 'lib/alexandria/ui/acquire_dialog.rb'
106
+ - 'lib/alexandria/ui/book_properties_dialog_base.rb'
107
+ - 'lib/alexandria/ui/new_book_dialog.rb'
153
108
 
154
- # Offense count: 112
155
109
  Style/Documentation:
156
110
  Enabled: false
157
111
 
158
- # Offense count: 6
159
- # Cop supports --auto-correct.
160
- # Configuration parameters: EnforcedStyle.
161
- # SupportedStyles: each, for
162
- Style/For:
163
- Exclude:
164
- - 'lib/alexandria/book_providers/amazon_ecs_util.rb'
165
- - 'lib/alexandria/book_providers/douban.rb'
166
- - 'lib/alexandria/book_providers/renaud.rb'
167
- - 'spec/alexandria/library_spec.rb'
168
-
169
- # Offense count: 65
170
112
  # Configuration parameters: EnforcedStyle.
171
113
  # SupportedStyles: annotated, template, unannotated
172
114
  Style/FormatStringToken:
173
115
  Exclude:
174
- - 'lib/alexandria/book_providers.rb'
175
- - 'lib/alexandria/ui/callbacks.rb'
176
- - 'lib/alexandria/ui/dialogs/acquire_dialog.rb'
177
- - 'lib/alexandria/ui/dialogs/book_properties_dialog_base.rb'
178
- - 'lib/alexandria/ui/dialogs/export_dialog.rb'
179
- - 'lib/alexandria/ui/dialogs/keep_bad_isbn_dialog.rb'
180
- - 'lib/alexandria/ui/dialogs/misc_dialogs.rb'
181
- - 'lib/alexandria/ui/dialogs/new_book_dialog.rb'
182
- - 'lib/alexandria/ui/dialogs/new_book_dialog_manual.rb'
183
- - 'lib/alexandria/ui/dialogs/preferences_dialog.rb'
184
- - 'lib/alexandria/ui/dialogs/smart_library_properties_dialog.rb'
116
+ - 'lib/alexandria/ui/acquire_dialog.rb'
185
117
  - 'lib/alexandria/ui/dndable.rb'
186
118
  - 'lib/alexandria/ui/listview.rb'
187
- - 'lib/alexandria/ui/sidepane.rb'
188
- - 'lib/alexandria/ui/ui_manager.rb'
189
-
190
- # Offense count: 34
191
- # Configuration parameters: MinBodyLength.
192
- Style/GuardClause:
193
- Enabled: false
194
-
195
- # Offense count: 2
196
- Style/IdenticalConditionalBranches:
197
- Exclude:
198
- - 'lib/alexandria/book_providers/amazon_aws.rb'
119
+ - 'lib/alexandria/ui/new_book_dialog.rb'
199
120
 
200
- # Offense count: 1
201
- Style/MethodMissingSuper:
202
- Exclude:
203
- - 'lib/alexandria/preferences.rb'
204
-
205
- # Offense count: 2
206
- Style/MissingRespondToMissing:
121
+ # Configuration parameters: AllowedMethods.
122
+ # AllowedMethods: respond_to_missing?
123
+ Style/OptionalBooleanParameter:
207
124
  Exclude:
208
125
  - 'lib/alexandria/book_providers.rb'
209
- - 'lib/alexandria/preferences.rb'
210
-
211
- # Offense count: 5
212
- # Cop supports --auto-correct.
213
- # Configuration parameters: Whitelist.
214
- # Whitelist: be, be_a, be_an, be_between, be_falsey, be_kind_of, be_instance_of, be_truthy, be_within, eq, eql, end_with, include, match, raise_error, respond_to, start_with
215
- Style/NestedParenthesizedCalls:
216
- Exclude:
217
- - 'spec/alexandria/library_spec.rb'
218
- - 'spec/alexandria/library_store_spec.rb'
219
-
220
- # Offense count: 21
221
- # Cop supports --auto-correct.
222
- # Configuration parameters: EnforcedStyle, AllowInnerSlashes.
223
- # SupportedStyles: slashes, percent_r, mixed
224
- Style/RegexpLiteral:
225
- Exclude:
226
- - 'lib/alexandria/book_providers/adlibris.rb'
227
- - 'lib/alexandria/book_providers/amazon_ecs_util.rb'
228
- - 'lib/alexandria/book_providers/douban.rb'
229
- - 'lib/alexandria/book_providers/proxis.rb'
230
- - 'lib/alexandria/book_providers/pseudomarc.rb'
231
- - 'lib/alexandria/book_providers/renaud.rb'
126
+ - 'lib/alexandria/book_providers/barnes_and_noble.rb'
232
127
  - 'lib/alexandria/book_providers/siciliano.rb'
233
- - 'lib/alexandria/book_providers/thalia.rb'
234
- - 'lib/alexandria/library_store.rb'
235
- - 'lib/alexandria/ui/dialogs/book_properties_dialog_base.rb'
236
- - 'lib/alexandria/ui/sidepane.rb'
128
+ - 'lib/alexandria/book_providers/worldcat.rb'
129
+ - 'lib/alexandria/console.rb'
130
+ - 'lib/alexandria/execution_queue.rb'
131
+ - 'lib/alexandria/export_format.rb'
132
+ - 'lib/alexandria/library_sort_order.rb'
133
+ - 'lib/alexandria/models/library.rb'
134
+ - 'lib/alexandria/ui/ui_manager.rb'
237
135
  - 'util/rake/fileinstall.rb'
238
- - 'util/rake/gettextgenerate.rb'