alexandria-book-collection-manager 0.6.9 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +34 -30
  4. data/.rubocop_todo.yml +139 -54
  5. data/CHANGELOG.md +10 -0
  6. data/Gemfile +1 -0
  7. data/Rakefile +10 -11
  8. data/alexandria-book-collection-manager.gemspec +3 -2
  9. data/bin/alexandria +1 -1
  10. data/lib/alexandria.rb +3 -6
  11. data/lib/alexandria/about.rb +9 -9
  12. data/lib/alexandria/book_providers.rb +12 -12
  13. data/lib/alexandria/book_providers/adlibris.rb +14 -18
  14. data/lib/alexandria/book_providers/amazon_aws.rb +17 -31
  15. data/lib/alexandria/book_providers/amazon_ecs_util.rb +5 -6
  16. data/lib/alexandria/book_providers/barnes_and_noble.rb +51 -76
  17. data/lib/alexandria/book_providers/bol_it.rb +12 -12
  18. data/lib/alexandria/book_providers/deastore.rb +27 -31
  19. data/lib/alexandria/book_providers/douban.rb +9 -13
  20. data/lib/alexandria/book_providers/ibs_it.rb +10 -10
  21. data/lib/alexandria/book_providers/mcu.rb +12 -18
  22. data/lib/alexandria/book_providers/proxis.rb +14 -22
  23. data/lib/alexandria/book_providers/pseudomarc.rb +8 -18
  24. data/lib/alexandria/book_providers/renaud.rb +16 -16
  25. data/lib/alexandria/book_providers/siciliano.rb +25 -38
  26. data/lib/alexandria/book_providers/thalia.rb +13 -16
  27. data/lib/alexandria/book_providers/webster_it.rb +14 -18
  28. data/lib/alexandria/book_providers/worldcat.rb +21 -25
  29. data/lib/alexandria/book_providers/z3950.rb +19 -23
  30. data/lib/alexandria/config.rb +2 -2
  31. data/lib/alexandria/execution_queue.rb +3 -1
  32. data/lib/alexandria/export_library.rb +19 -22
  33. data/lib/alexandria/import_library.rb +14 -18
  34. data/lib/alexandria/import_library_csv.rb +12 -30
  35. data/lib/alexandria/models/book.rb +7 -9
  36. data/lib/alexandria/models/library.rb +44 -44
  37. data/lib/alexandria/net.rb +1 -1
  38. data/lib/alexandria/preferences.rb +12 -57
  39. data/lib/alexandria/scanners.rb +10 -6
  40. data/lib/alexandria/scanners/cuecat.rb +2 -2
  41. data/lib/alexandria/smart_library.rb +12 -12
  42. data/lib/alexandria/ui.rb +5 -2
  43. data/lib/alexandria/ui/callbacks.rb +106 -65
  44. data/lib/alexandria/ui/completion_models.rb +55 -51
  45. data/lib/alexandria/ui/dialogs/about_dialog.rb +1 -1
  46. data/lib/alexandria/ui/dialogs/acquire_dialog.rb +25 -51
  47. data/lib/alexandria/ui/dialogs/alert_dialog.rb +13 -11
  48. data/lib/alexandria/ui/dialogs/bad_isbns_dialog.rb +2 -2
  49. data/lib/alexandria/ui/dialogs/barcode_animation.rb +39 -23
  50. data/lib/alexandria/ui/dialogs/book_properties_dialog.rb +16 -21
  51. data/lib/alexandria/ui/dialogs/book_properties_dialog_base.rb +23 -24
  52. data/lib/alexandria/ui/dialogs/export_dialog.rb +46 -45
  53. data/lib/alexandria/ui/dialogs/import_dialog.rb +26 -35
  54. data/lib/alexandria/ui/dialogs/misc_dialogs.rb +11 -11
  55. data/lib/alexandria/ui/dialogs/new_book_dialog.rb +47 -59
  56. data/lib/alexandria/ui/dialogs/new_book_dialog_manual.rb +14 -13
  57. data/lib/alexandria/ui/dialogs/new_smart_library_dialog.rb +12 -11
  58. data/lib/alexandria/ui/dialogs/preferences_dialog.rb +37 -43
  59. data/lib/alexandria/ui/dialogs/smart_library_properties_dialog.rb +9 -8
  60. data/lib/alexandria/ui/dialogs/smart_library_properties_dialog_base.rb +47 -53
  61. data/lib/alexandria/ui/dndable.rb +5 -4
  62. data/lib/alexandria/ui/icons.rb +19 -19
  63. data/lib/alexandria/ui/iconview.rb +7 -12
  64. data/lib/alexandria/ui/iconview_tooltips.rb +22 -109
  65. data/lib/alexandria/ui/init.rb +7 -15
  66. data/lib/alexandria/ui/libraries_combo.rb +54 -48
  67. data/lib/alexandria/ui/listview.rb +30 -85
  68. data/lib/alexandria/ui/multi_drag_treeview.rb +110 -107
  69. data/lib/alexandria/ui/sidepane.rb +23 -25
  70. data/lib/alexandria/ui/sound.rb +18 -27
  71. data/lib/alexandria/ui/ui_manager.rb +126 -204
  72. data/lib/alexandria/undo_manager.rb +2 -2
  73. data/lib/alexandria/version.rb +4 -4
  74. data/spec/alexandria/book_providers_spec.rb +7 -4
  75. data/spec/alexandria/library_spec.rb +13 -16
  76. data/spec/alexandria/scanners/cuecat_spec.rb +1 -2
  77. data/spec/alexandria/ui/dialogs_spec.rb +5 -1
  78. data/spec/alexandria/ui/main_app_spec.rb +3 -3
  79. data/{lib/alexandria/utils.rb → spec/alexandria/ui/sound_spec.rb} +6 -11
  80. data/spec/alexandria/ui/ui_utilities_spec.rb +3 -3
  81. data/spec/spec_helper.rb +2 -2
  82. data/util/rake/fileinstall.rb +17 -33
  83. data/util/rake/gettextgenerate.rb +2 -4
  84. data/util/rake/omfgenerate.rb +1 -3
  85. metadata +23 -11
  86. data/lib/alexandria/ui/gtk_thread_help.rb +0 -89
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61f908fe208ec98c1146db7ba2fd1ee4cdcc6f1a
4
- data.tar.gz: 8ab9bcc4418de8c7059feeb91fa5e92c7b210cc1
3
+ metadata.gz: 3f036a94a542570c4cbd37330bc4e7a08cb4ef0e
4
+ data.tar.gz: 61f6af24a98abc4281bea6558b3c70c2ece62e75
5
5
  SHA512:
6
- metadata.gz: aac0be4c035663bbeb556167a5a349962746d080378ac76f5559830ed006da58d2a6be4fe48bc9d6aa08c649d135015f59a04af1decfc5a42271ebf63b5f5efa
7
- data.tar.gz: 8f90fa49fa4556b30602d6f75e43b3e20d6e703204081b0eceb7d0e681956660a7d76a514d66e0c4a1c47e3ea83bfee94825139db1c61aea582c236b1795c695
6
+ metadata.gz: b594225692a4cd2cfc511ab4e6835dff6cfe379d8e21a13694065d3b0eab20348766af0c9314230bdd15de8d2ab1ed2d21e82081c4ec77a20f26a8ebf4187a1a
7
+ data.tar.gz: f8d35bbf4005a7d6b016bfdc0f7474397d602f4491d67470211667babd7a5bd93aa8f6e54312d45556cd6aea94a5c257fdeb287862a982943b655681b2d6cee2
data/.gitignore CHANGED
@@ -8,3 +8,4 @@ Gemfile.lock
8
8
  share/locale/
9
9
  share/omf/alexandria/*.omf
10
10
  pkg/
11
+ *.gem
@@ -6,33 +6,26 @@ AllCops:
6
6
  Lint/AssignmentInCondition:
7
7
  AllowSafeAssignment: true
8
8
 
9
- # Allow multi-line blocks of all sorts
10
- Style/BlockDelimiters:
11
- Enabled: false
12
-
13
- # Dot at end of line makes it clearer that the line is not done
14
- Style/DotPosition:
15
- EnforcedStyle: trailing
16
-
17
9
  # Require lines to fit in pull requests.
18
10
  # This config is commented out temporarily to allow .rubocop_todo.yml to
19
11
  # configure this cop.
20
- #Style/LineLength:
12
+ #Metrics/LineLength:
21
13
  #Max: 92
22
14
 
23
- # Always use raise to raise exceptions
24
- Style/SignalException:
25
- EnforcedStyle: only_raise
15
+ Style/AccessorMethodName:
16
+ Enabled: false
26
17
 
27
- # Allow explicit return with multiple return values
28
- Style/RedundantReturn:
29
- AllowMultipleReturnValues: true
18
+ # Allow multi-line blocks of all sorts
19
+ Style/BlockDelimiters:
20
+ Enabled: false
30
21
 
31
- # Offense count: 10
32
- # Cop supports --auto-correct.
33
- # Configuration parameters: EnforcedStyle, SupportedStyles.
34
- Style/FirstParameterIndentation:
35
- EnforcedStyle: consistent
22
+ # Allow and/or for control flow only
23
+ Style/AndOr:
24
+ Enabled: conditionals
25
+
26
+ # Dot at end of line makes it clearer that the line is not done
27
+ Style/DotPosition:
28
+ EnforcedStyle: trailing
36
29
 
37
30
  # Require at least two dependent lines before suggesting a guard clause
38
31
  Style/GuardClause:
@@ -42,29 +35,40 @@ Style/GuardClause:
42
35
  Style/IfUnlessModifier:
43
36
  MaxLineLength: 60
44
37
 
45
- # Visually mark multiline operations by indenting
38
+ # Multi-line assignment should be simply indented. Aligning them makes it even
39
+ # harder to keep a sane line length.
46
40
  Style/MultilineOperationIndentation:
47
41
  EnforcedStyle: indented
48
42
 
49
- Style/TrivialAccessors:
50
- ExactNameMatch: true
43
+ Style/MultilineMethodCallBraceLayout:
44
+ EnforcedStyle: same_line
51
45
 
52
- Style/SingleLineBlockParams:
53
- Enabled: false
46
+ # Multi-line method calls should be simply indented. Aligning them makes it
47
+ # even harder to keep a sane line length.
48
+ Style/MultilineMethodCallIndentation:
49
+ EnforcedStyle: indented
54
50
 
55
51
  # Sometimes an if statement just looks better than next with a guard clause
56
52
  Style/Next:
57
53
  Enabled: false
58
54
 
59
- Style/AccessorMethodName:
60
- Enabled: false
55
+ # Allow explicit return with multiple return values
56
+ Style/RedundantReturn:
57
+ AllowMultipleReturnValues: true
61
58
 
62
- # Support use of and and or for control flow.
63
- Style/AndOr:
59
+ # Always use raise to raise exceptions
60
+ Style/SignalException:
61
+ EnforcedStyle: only_raise
62
+
63
+ Style/SingleLineBlockParams:
64
64
  Enabled: false
65
65
 
66
+ # Accessors are only trivial if they match the ivar name.
67
+ Style/TrivialAccessors:
68
+ ExactNameMatch: true
69
+
66
70
  # Allow semantic choice of trailing comma
67
- Style/TrailingComma:
71
+ Style/TrailingCommaInLiteral:
68
72
  Enabled: false
69
73
 
70
74
  # Alexandria uses regular arrays
@@ -1,5 +1,6 @@
1
- # This configuration was generated by `rubocop --auto-gen-config`
2
- # on 2015-07-11 13:17:41 +0200 using RuboCop version 0.32.1.
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2016-10-01 20:35:02 +0200 using RuboCop version 0.43.0.
3
4
  # The point is for the user to remove these configuration records
4
5
  # one by one as the offenses are removed from the code base.
5
6
  # Note that changes in the inspected code, or installation of new
@@ -7,136 +8,220 @@
7
8
 
8
9
  # Offense count: 7
9
10
  Lint/HandleExceptions:
10
- Enabled: false
11
+ Exclude:
12
+ - 'lib/alexandria/import_library_csv.rb'
13
+ - 'lib/alexandria/models/library.rb'
14
+ - 'lib/alexandria/ui/dialogs/book_properties_dialog.rb'
15
+ - 'lib/alexandria/ui/dialogs/import_dialog.rb'
16
+ - 'lib/alexandria/ui/sound.rb'
17
+
18
+ # Offense count: 2
19
+ Lint/IneffectiveAccessModifier:
20
+ Exclude:
21
+ - 'lib/alexandria/logging.rb'
22
+ - 'lib/alexandria/web_themes.rb'
11
23
 
12
- # Offense count: 185
24
+ # Offense count: 1
25
+ Lint/LiteralInCondition:
26
+ Exclude:
27
+ - 'util/rake/gettextgenerate.rb'
28
+
29
+ # Offense count: 1
30
+ Lint/UnreachableCode:
31
+ Exclude:
32
+ - 'lib/alexandria/ui/dialogs/export_dialog.rb'
33
+
34
+ # Offense count: 2
35
+ # Configuration parameters: ContextCreatingMethods.
36
+ Lint/UselessAccessModifier:
37
+ Exclude:
38
+ - 'lib/alexandria/logging.rb'
39
+
40
+ # Offense count: 173
13
41
  Metrics/AbcSize:
14
- Max: 165
42
+ Max: 163
15
43
 
16
44
  # Offense count: 14
17
45
  Metrics/BlockNesting:
18
46
  Max: 5
19
47
 
20
- # Offense count: 35
48
+ # Offense count: 34
21
49
  # Configuration parameters: CountComments.
22
50
  Metrics/ClassLength:
23
- Max: 1065
51
+ Max: 1007
24
52
 
25
- # Offense count: 79
53
+ # Offense count: 78
26
54
  Metrics/CyclomaticComplexity:
27
55
  Max: 28
28
56
 
29
- # Offense count: 339
30
- # Configuration parameters: AllowURI, URISchemes.
57
+ # Offense count: 352
58
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
59
+ # URISchemes: http, https
31
60
  Metrics/LineLength:
32
61
  Max: 392
33
62
 
34
- # Offense count: 240
63
+ # Offense count: 232
35
64
  # Configuration parameters: CountComments.
36
65
  Metrics/MethodLength:
37
- Max: 116
66
+ Max: 113
38
67
 
39
68
  # Offense count: 2
40
69
  # Configuration parameters: CountComments.
41
70
  Metrics/ModuleLength:
42
- Max: 344
71
+ Max: 356
43
72
 
44
- # Offense count: 5
73
+ # Offense count: 10
45
74
  # Configuration parameters: CountKeywordArgs.
46
75
  Metrics/ParameterLists:
47
76
  Max: 7
48
77
 
49
- # Offense count: 78
78
+ # Offense count: 76
50
79
  Metrics/PerceivedComplexity:
51
80
  Max: 29
52
81
 
53
82
  # Offense count: 3
54
83
  Style/ClassAndModuleCamelCase:
55
- Enabled: false
84
+ Exclude:
85
+ - 'lib/alexandria/book_providers/bol_it.rb'
86
+ - 'lib/alexandria/book_providers/ibs_it.rb'
87
+ - 'lib/alexandria/book_providers/webster_it.rb'
56
88
 
57
- # Offense count: 12
89
+ # Offense count: 8
58
90
  # Configuration parameters: EnforcedStyle, SupportedStyles.
91
+ # SupportedStyles: nested, compact
59
92
  Style/ClassAndModuleChildren:
60
- Enabled: false
93
+ Exclude:
94
+ - 'lib/alexandria/ui/dialogs/import_dialog.rb'
95
+ - 'lib/alexandria/ui/dialogs/preferences_dialog.rb'
96
+ - 'lib/alexandria/ui/icons.rb'
97
+ - 'lib/alexandria/ui/init.rb'
61
98
 
62
99
  # Offense count: 17
63
100
  Style/ClassVars:
64
- Enabled: false
65
-
66
- # Offense count: 28
67
- # Cop supports --auto-correct.
68
- # Configuration parameters: Keywords.
69
- Style/CommentAnnotation:
70
- Enabled: false
71
-
72
- # Offense count: 135
101
+ Exclude:
102
+ - 'lib/alexandria/book_providers/amazon_ecs_util.rb'
103
+ - 'lib/alexandria/execution_queue.rb'
104
+ - 'lib/alexandria/logging.rb'
105
+ - 'lib/alexandria/models/library.rb'
106
+ - 'lib/alexandria/smart_library.rb'
107
+ - 'lib/alexandria/ui/dialogs/acquire_dialog.rb'
108
+ - 'lib/alexandria/ui/dialogs/book_properties_dialog_base.rb'
109
+ - 'lib/alexandria/ui/dialogs/new_book_dialog.rb'
110
+
111
+ # Offense count: 126
73
112
  Style/Documentation:
74
113
  Enabled: false
75
114
 
76
- # Offense count: 7
115
+ # Offense count: 6
77
116
  # Configuration parameters: EnforcedStyle, SupportedStyles.
117
+ # SupportedStyles: for, each
78
118
  Style/For:
79
- Enabled: false
119
+ Exclude:
120
+ - 'lib/alexandria/book_providers/amazon_ecs_util.rb'
121
+ - 'lib/alexandria/book_providers/douban.rb'
122
+ - 'lib/alexandria/book_providers/renaud.rb'
123
+ - 'spec/alexandria/library_spec.rb'
80
124
 
81
125
  # Offense count: 25
82
126
  # Configuration parameters: EnforcedStyle, SupportedStyles.
127
+ # SupportedStyles: format, sprintf, percent
83
128
  Style/FormatString:
84
- Enabled: false
129
+ Exclude:
130
+ - 'lib/alexandria/book_providers.rb'
131
+ - 'lib/alexandria/book_providers/adlibris.rb'
132
+ - 'lib/alexandria/book_providers/barnes_and_noble.rb'
133
+ - 'lib/alexandria/book_providers/deastore.rb'
134
+ - 'lib/alexandria/book_providers/siciliano.rb'
135
+ - 'lib/alexandria/book_providers/thalia.rb'
136
+ - 'lib/alexandria/book_providers/worldcat.rb'
137
+ - 'lib/alexandria/export_library.rb'
138
+ - 'lib/alexandria/ui/dialogs/acquire_dialog.rb'
139
+ - 'lib/alexandria/ui/dialogs/misc_dialogs.rb'
140
+ - 'lib/alexandria/ui/dialogs/new_book_dialog.rb'
141
+ - 'lib/alexandria/ui/dndable.rb'
142
+ - 'lib/alexandria/ui/listview.rb'
143
+ - 'lib/alexandria/ui/ui_manager.rb'
85
144
 
86
145
  # Offense count: 4
87
146
  # Configuration parameters: AllowedVariables.
88
147
  Style/GlobalVars:
89
- Enabled: false
148
+ Exclude:
149
+ - 'lib/alexandria/export_library.rb'
90
150
 
91
- # Offense count: 23
151
+ # Offense count: 36
92
152
  # Configuration parameters: MinBodyLength.
93
153
  Style/GuardClause:
94
154
  Enabled: false
95
155
 
96
- # Offense count: 68
97
- # Cop supports --auto-correct.
98
- # Configuration parameters: MaxLineLength.
99
- Style/IfUnlessModifier:
100
- Enabled: false
156
+ # Offense count: 4
157
+ Style/IdenticalConditionalBranches:
158
+ Exclude:
159
+ - 'lib/alexandria/book_providers/amazon_aws.rb'
160
+ - 'lib/alexandria/ui/ui_manager.rb'
101
161
 
102
162
  # Offense count: 4
163
+ Style/IfInsideElse:
164
+ Exclude:
165
+ - 'lib/alexandria/book_providers/proxis.rb'
166
+ - 'lib/alexandria/book_providers/web.rb'
167
+ - 'lib/alexandria/preferences.rb'
168
+ - 'lib/alexandria/ui/ui_manager.rb'
169
+
170
+ # Offense count: 2
171
+ Style/MethodMissing:
172
+ Exclude:
173
+ - 'lib/alexandria/book_providers.rb'
174
+ - 'lib/alexandria/preferences.rb'
175
+
176
+ # Offense count: 1
103
177
  # Configuration parameters: EnforcedStyle, SupportedStyles.
178
+ # SupportedStyles: snake_case, camelCase
104
179
  Style/MethodName:
105
- Enabled: false
180
+ Exclude:
181
+ - 'lib/alexandria/book_providers/mcu.rb'
106
182
 
107
183
  # Offense count: 1
108
184
  Style/MultilineTernaryOperator:
109
- Enabled: false
185
+ Exclude:
186
+ - 'lib/alexandria/ui/listview.rb'
110
187
 
111
188
  # Offense count: 2
112
189
  Style/NestedTernaryOperator:
113
- Enabled: false
190
+ Exclude:
191
+ - 'lib/alexandria/ui/completion_models.rb'
192
+ - 'lib/alexandria/ui/ui_manager.rb'
114
193
 
115
194
  # Offense count: 8
116
195
  Style/OpMethod:
117
- Enabled: false
118
-
119
- # Offense count: 7
120
- # Cop supports --auto-correct.
121
- Style/ParallelAssignment:
122
- Enabled: false
196
+ Exclude:
197
+ - 'lib/alexandria/book_providers.rb'
198
+ - 'lib/alexandria/book_providers/amazon_ecs_util.rb'
199
+ - 'lib/alexandria/models/book.rb'
200
+ - 'lib/alexandria/models/library.rb'
201
+ - 'lib/alexandria/smart_library.rb'
202
+ - 'lib/alexandria/ui/multi_drag_treeview.rb'
123
203
 
124
204
  # Offense count: 4
125
- # Configuration parameters: NamePrefix, NamePrefixBlacklist.
205
+ # Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
206
+ # NamePrefix: is_, has_, have_
207
+ # NamePrefixBlacklist: is_, has_, have_
208
+ # NameWhitelist: is_a?
126
209
  Style/PredicateName:
127
- Enabled: false
128
-
129
- # Offense count: 11
130
- # Configuration parameters: EnforcedStyle, SupportedStyles.
131
- Style/RaiseArgs:
132
- Enabled: false
210
+ Exclude:
211
+ - 'spec/**/*'
212
+ - 'lib/alexandria/book_providers/amazon_ecs_util.rb'
213
+ - 'lib/alexandria/ui/dialogs/smart_library_properties_dialog_base.rb'
214
+ - 'lib/alexandria/web_themes.rb'
133
215
 
134
216
  # Offense count: 41
135
217
  # Cop supports --auto-correct.
136
218
  # Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
219
+ # SupportedStyles: slashes, percent_r, mixed
137
220
  Style/RegexpLiteral:
138
221
  Enabled: false
139
222
 
140
223
  # Offense count: 3
141
224
  Style/StructInheritance:
142
- Enabled: false
225
+ Exclude:
226
+ - 'lib/alexandria/smart_library.rb'
227
+ - 'lib/alexandria/ui/multi_drag_treeview.rb'
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.0
4
+
5
+ * Various small bug fixes
6
+ * Update to ruby-gnome2 3.0.9
7
+ * Improve specs
8
+ * Port to Gtk+ 3
9
+ * Restore Barcode animation
10
+ * Remove old String#convert monkey-patch
11
+ * Simplify sound system and stop it from hanging Alexandria
12
+
3
13
  ## 0.6.9
4
14
 
5
15
  * Update/fix authorship information and other metadata
data/Gemfile CHANGED
@@ -6,4 +6,5 @@ gemspec
6
6
  group :development, :test do
7
7
  gem 'rdoc', '~> 4.0'
8
8
  gem 'pry'
9
+ gem 'rubocop', '~> 0.43.0'
9
10
  end
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  # -*- ruby -*-
2
2
  #--
3
3
  # Copyright (C) 2009 Cathal Mc Ginley
4
- # Copyright (C) 2011, 2014 Matijs van Zuijlen
4
+ # Copyright (C) 2011, 2014, 2016 Matijs van Zuijlen
5
5
  #
6
6
  # This file is part of the Alexandria build system.
7
7
  #
@@ -39,7 +39,7 @@ require_relative 'lib/alexandria/version'
39
39
  stage_dir = ENV['DESTDIR'] || 'tmp'
40
40
  prefix_dir = ENV['PREFIX'] || '/usr'
41
41
 
42
- PROJECT = 'alexandria'
42
+ PROJECT = 'alexandria'.freeze
43
43
  PREFIX = prefix_dir
44
44
  share_dir = ENV['SHARE'] || "#{PREFIX}/share"
45
45
  SHARE = share_dir
@@ -56,12 +56,12 @@ end
56
56
 
57
57
  SHARE_FILE_GLOBS = ['data/alexandria/**/*', 'data/gnome/**/*.*',
58
58
  'data/locale/**/*.mo', 'data/omf/**/*.omf',
59
- 'data/sounds/**/*.ogg'] # , 'data/menu/*']
59
+ 'data/sounds/**/*.ogg'].freeze # , 'data/menu/*']
60
60
 
61
61
  ICON_FILE_GLOBS = ['data/app-icon/**/*.png',
62
- 'data/app-icon/scalable/*.svg']
62
+ 'data/app-icon/scalable/*.svg'].freeze
63
63
 
64
- PIXMAP_GLOBS = 'data/app-icon/32x32/*.xpm'
64
+ PIXMAP_GLOBS = 'data/app-icon/32x32/*.xpm'.freeze
65
65
 
66
66
  def install_common(install_task)
67
67
  install_task.install_exe('bin', 'bin/*', "#{PREFIX}/bin")
@@ -92,8 +92,7 @@ FileInstallTask.new(:package) do |j|
92
92
  j.install('doc', devel_docs, "#{SHARE}/doc/#{PROJECT}")
93
93
 
94
94
  j.uninstall_empty_dirs(["#{SHARE}/**/#{PROJECT}/",
95
- "#{j.rubylib}/#{PROJECT}/"
96
- ])
95
+ "#{j.rubylib}/#{PROJECT}/"])
97
96
  end
98
97
 
99
98
  task :clobberp do
@@ -134,7 +133,7 @@ def convert_with_type(value, type)
134
133
  end
135
134
  end
136
135
 
137
- SCHEMA_PATH = 'schemas/alexandria.schemas'
136
+ SCHEMA_PATH = 'schemas/alexandria.schemas'.freeze
138
137
 
139
138
  # This generates default_preferences.rb by copying over values from
140
139
  # providers_priority key in alexandria.schemas (necessary?)
@@ -150,7 +149,7 @@ file 'lib/alexandria/default_preferences.rb' => [SCHEMA_PATH] do |f|
150
149
  varname = File.basename(element.elements['key'].text)
151
150
  type = element.elements['type'].text
152
151
 
153
- if type == 'list' or type == 'pair'
152
+ if (type == 'list') || (type == 'pair')
154
153
  ary = default[1..-2].split(',')
155
154
  next if ary.empty?
156
155
  if type == 'list'
@@ -203,7 +202,7 @@ task default: [:build]
203
202
 
204
203
  # pre-release tasks
205
204
 
206
- ULTRA_CLOBBER = []
205
+ ULTRA_CLOBBER = [].freeze
207
206
  task ultra_clobber: :clobber do
208
207
  ULTRA_CLOBBER.each do |file|
209
208
  FileUtils::Verbose.rm_f(file)
@@ -234,7 +233,7 @@ task :scrollkeeper do
234
233
  unless system('which scrollkeeper-update')
235
234
  raise 'scrollkeeper-update cannot be found, is Scrollkeeper correctly installed?'
236
235
  end
237
- system('scrollkeeper-update -q') or raise 'Scrollkeeper update failed'
236
+ system('scrollkeeper-update -q') || raise('Scrollkeeper update failed')
238
237
  end
239
238
 
240
239
  task :gconf do