alexandria-book-collection-manager 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +0 -1
  3. data/.rubocop.yml +45 -27
  4. data/.rubocop_todo.yml +127 -86
  5. data/.simplecov +1 -0
  6. data/.yardopts +1 -1
  7. data/CHANGELOG.md +5 -0
  8. data/ChangeLog.0 +33 -35
  9. data/Gemfile +2 -2
  10. data/INSTALL.md +152 -0
  11. data/Rakefile +12 -10
  12. data/alexandria-book-collection-manager.gemspec +5 -5
  13. data/bin/alexandria +2 -1
  14. data/doc/AUTHORS +61 -0
  15. data/doc/BUGS +31 -0
  16. data/doc/FAQ +369 -0
  17. data/doc/HACKING +19 -0
  18. data/doc/NEWS +341 -0
  19. data/doc/alexandria.1 +120 -0
  20. data/doc/cuecat_support.rdoc +67 -0
  21. data/doc/dependency_decisions.yml +61 -0
  22. data/lib/alexandria.rb +2 -0
  23. data/lib/alexandria/about.rb +7 -6
  24. data/lib/alexandria/book_providers.rb +6 -6
  25. data/lib/alexandria/book_providers/adlibris.rb +9 -14
  26. data/lib/alexandria/book_providers/amazon_aws.rb +29 -33
  27. data/lib/alexandria/book_providers/amazon_ecs_util.rb +10 -14
  28. data/lib/alexandria/book_providers/barnes_and_noble.rb +9 -11
  29. data/lib/alexandria/book_providers/deastore.rb +12 -20
  30. data/lib/alexandria/book_providers/douban.rb +9 -15
  31. data/lib/alexandria/book_providers/mcu.rb +26 -13
  32. data/lib/alexandria/book_providers/proxis.rb +9 -15
  33. data/lib/alexandria/book_providers/pseudomarc.rb +15 -27
  34. data/lib/alexandria/book_providers/renaud.rb +18 -9
  35. data/lib/alexandria/book_providers/siciliano.rb +8 -9
  36. data/lib/alexandria/book_providers/thalia.rb +6 -6
  37. data/lib/alexandria/book_providers/web.rb +2 -0
  38. data/lib/alexandria/book_providers/worldcat.rb +6 -7
  39. data/lib/alexandria/book_providers/z3950.rb +19 -10
  40. data/lib/alexandria/config.rb +4 -2
  41. data/lib/alexandria/console.rb +2 -0
  42. data/lib/alexandria/execution_queue.rb +2 -2
  43. data/lib/alexandria/export_library.rb +14 -18
  44. data/lib/alexandria/import_library.rb +8 -16
  45. data/lib/alexandria/import_library_csv.rb +5 -52
  46. data/lib/alexandria/logging.rb +4 -6
  47. data/lib/alexandria/models/book.rb +2 -0
  48. data/lib/alexandria/models/library.rb +10 -20
  49. data/lib/alexandria/net.rb +2 -0
  50. data/lib/alexandria/preferences.rb +10 -14
  51. data/lib/alexandria/scanners.rb +2 -0
  52. data/lib/alexandria/scanners/cuecat.rb +4 -2
  53. data/lib/alexandria/scanners/keyboard.rb +2 -0
  54. data/lib/alexandria/smart_library.rb +4 -3
  55. data/lib/alexandria/ui.rb +2 -0
  56. data/lib/alexandria/ui/builder_base.rb +2 -0
  57. data/lib/alexandria/ui/callbacks.rb +8 -12
  58. data/lib/alexandria/ui/columns.rb +2 -0
  59. data/lib/alexandria/ui/completion_models.rb +2 -0
  60. data/lib/alexandria/ui/dialogs/about_dialog.rb +3 -1
  61. data/lib/alexandria/ui/dialogs/acquire_dialog.rb +11 -17
  62. data/lib/alexandria/ui/dialogs/alert_dialog.rb +2 -0
  63. data/lib/alexandria/ui/dialogs/bad_isbns_dialog.rb +10 -2
  64. data/lib/alexandria/ui/dialogs/barcode_animation.rb +2 -0
  65. data/lib/alexandria/ui/dialogs/book_properties_dialog.rb +5 -9
  66. data/lib/alexandria/ui/dialogs/book_properties_dialog_base.rb +3 -3
  67. data/lib/alexandria/ui/dialogs/export_dialog.rb +3 -3
  68. data/lib/alexandria/ui/dialogs/import_dialog.rb +2 -2
  69. data/lib/alexandria/ui/dialogs/misc_dialogs.rb +6 -4
  70. data/lib/alexandria/ui/dialogs/new_book_dialog.rb +22 -31
  71. data/lib/alexandria/ui/dialogs/new_book_dialog_manual.rb +3 -3
  72. data/lib/alexandria/ui/dialogs/new_smart_library_dialog.rb +3 -3
  73. data/lib/alexandria/ui/dialogs/preferences_dialog.rb +8 -18
  74. data/lib/alexandria/ui/dialogs/smart_library_properties_dialog.rb +2 -0
  75. data/lib/alexandria/ui/dialogs/smart_library_properties_dialog_base.rb +4 -6
  76. data/lib/alexandria/ui/dndable.rb +4 -2
  77. data/lib/alexandria/ui/icons.rb +3 -3
  78. data/lib/alexandria/ui/iconview.rb +3 -3
  79. data/lib/alexandria/ui/iconview_tooltips.rb +4 -6
  80. data/lib/alexandria/ui/init.rb +2 -0
  81. data/lib/alexandria/ui/libraries_combo.rb +2 -0
  82. data/lib/alexandria/ui/listview.rb +15 -12
  83. data/lib/alexandria/ui/main_app.rb +2 -0
  84. data/lib/alexandria/ui/multi_drag_treeview.rb +2 -0
  85. data/lib/alexandria/ui/sidepane.rb +8 -6
  86. data/lib/alexandria/ui/sound.rb +2 -0
  87. data/lib/alexandria/ui/ui_manager.rb +37 -43
  88. data/lib/alexandria/undo_manager.rb +2 -0
  89. data/lib/alexandria/version.rb +5 -3
  90. data/lib/alexandria/web_themes.rb +2 -0
  91. data/spec/alexandria/book_providers_spec.rb +12 -49
  92. data/spec/alexandria/book_spec.rb +4 -2
  93. data/spec/alexandria/library_spec.rb +2 -0
  94. data/spec/alexandria/preferences_spec.rb +2 -0
  95. data/spec/alexandria/scanners/cuecat_spec.rb +2 -0
  96. data/spec/alexandria/smart_library_spec.rb +3 -1
  97. data/spec/alexandria/ui/dialogs_spec.rb +2 -0
  98. data/spec/alexandria/ui/iconview_spec.rb +2 -0
  99. data/spec/alexandria/ui/main_app_spec.rb +2 -0
  100. data/spec/alexandria/ui/sidepane_spec.rb +2 -0
  101. data/spec/alexandria/ui/sound_spec.rb +2 -0
  102. data/spec/alexandria/ui/ui_manager_spec.rb +2 -0
  103. data/spec/alexandria/ui/ui_utilities_spec.rb +2 -0
  104. data/spec/alexandria/utilities_spec.rb +2 -0
  105. data/spec/spec_helper.rb +2 -0
  106. data/tasks/dogtail.rake +2 -0
  107. data/tasks/setup.rb +3 -1
  108. data/tasks/spec.rake +2 -0
  109. data/util/rake/fileinstall.rb +6 -12
  110. data/util/rake/gettextgenerate.rb +9 -64
  111. data/util/rake/omfgenerate.rb +3 -3
  112. metadata +21 -37
  113. data/INSTALL.rdoc +0 -148
  114. data/lib/alexandria/book_providers/bol_it.rb +0 -160
  115. data/lib/alexandria/book_providers/ibs_it.rb +0 -147
  116. data/lib/alexandria/book_providers/webster_it.rb +0 -167
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (C) 2004-2006 Laurent Sansonetti
2
4
  #
3
5
  # Alexandria is free software; you can redistribute it and/or
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (C) 2014-2016 Matijs van Zuijlen
2
4
  #
3
5
  # This file is part of Alexandria.
@@ -18,7 +20,7 @@
18
20
  # Fifth Floor, Boston, MA 02110-1301 USA.
19
21
 
20
22
  module Alexandria
21
- VERSION = '0.7.1'.freeze
22
- DATA_VERSION = '0.6.3'.freeze
23
- DISPLAY_VERSION = '0.7.1'.freeze
23
+ VERSION = '0.7.2'
24
+ DATA_VERSION = '0.6.3'
25
+ DISPLAY_VERSION = '0.7.2'
24
26
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (C) 2004-2006 Laurent Sansonetti
2
4
  # Copyright (C) 2011 Matijs van Zuijlen
3
5
  #
@@ -1,4 +1,5 @@
1
- #!/usr/bin/env ruby
1
+ # frozen_string_literal: true
2
+
2
3
  # Copyright (C) 2005-2006 Laurent Sansonetti
3
4
  # Copyright (C) 2007 Joseph Method
4
5
  # Copyright (C) 2011, 2014, 2015 Matijs van Zuijlen
@@ -25,7 +26,8 @@ require 'spec_helper'
25
26
  describe Alexandria::BookProviders do
26
27
  it 'should be less clever'
27
28
 
28
- def assert_correct_search_result(provider, query, search_type = Alexandria::BookProviders::SEARCH_BY_ISBN)
29
+ def assert_correct_search_result(provider, query,
30
+ search_type = Alexandria::BookProviders::SEARCH_BY_ISBN)
29
31
  begin
30
32
  results = provider.instance.search(query, search_type)
31
33
  rescue SocketError
@@ -46,17 +48,20 @@ describe Alexandria::BookProviders do
46
48
 
47
49
  canonical_query = Alexandria::Library.canonicalise_ean(query)
48
50
  canonical_result = Alexandria::Library.canonicalise_ean(book.isbn)
49
- expect(canonical_query).to eq(canonical_result),
50
- "Result's isbn #{book.isbn} is not equivalent to the requested isbn #{query} for #{provider}"
51
+ expect(canonical_query).
52
+ to eq(canonical_result),
53
+ "Result's isbn #{book.isbn} is not equivalent to the requested isbn #{query} for #{provider}"
51
54
 
52
55
  if results.length == 2
53
56
  cover_url = results.last
54
57
  if cover_url
55
- expect(cover_url).to be_instance_of(String), "Unexpected cover_url #{cover_url.inspect} for #{provider}"
58
+ expect(cover_url).
59
+ to be_instance_of(String), "Unexpected cover_url #{cover_url.inspect} for #{provider}"
56
60
  end
57
61
  end
58
62
  else
59
- expect(results.first.first).to be_instance_of(Alexandria::Book), "Result item is not a Book for #{provider}"
63
+ expect(results.first.first).
64
+ to be_instance_of(Alexandria::Book), "Result item is not a Book for #{provider}"
60
65
  end
61
66
  results
62
67
  end
@@ -119,9 +124,8 @@ describe Alexandria::BookProviders do
119
124
  '9788835926436')
120
125
  end
121
126
 
122
- # providers supposed to be always working
123
-
124
127
  it 'Barnes and Noble should work' do
128
+ skip 'Barnes and Noble is not operational at the moment'
125
129
  assert_correct_search_result(Alexandria::BookProviders::BarnesAndNobleProvider,
126
130
  '9780961328917') # see #1433
127
131
  end
@@ -160,16 +164,6 @@ describe Alexandria::BookProviders do
160
164
  '0094638203520')
161
165
  end
162
166
 
163
- it 'IBS_it should work' do
164
- skip 'Marked in code as not working; remove implementation entirely.'
165
- # this tests a book without image but with author
166
- assert_correct_search_result(Alexandria::BookProviders::IBS_itProvider,
167
- '9788886973816')
168
- # this tests a book with image but without author
169
- assert_correct_search_result(Alexandria::BookProviders::IBS_itProvider,
170
- '9788807710148')
171
- end
172
-
173
167
  it 'AdLibris should work' do
174
168
  skip 'Needs fixing: site has changed'
175
169
  assert_correct_search_result(Alexandria::BookProviders::AdLibrisProvider,
@@ -182,37 +176,6 @@ describe Alexandria::BookProviders do
182
176
  '9788599170380')
183
177
  end
184
178
 
185
- it 'BOL_it should work' do
186
- skip 'Marked in code as not working; remove implementation entirely.'
187
- assert_correct_search_result(Alexandria::BookProviders::BOL_itProvider,
188
- '9788817012980')
189
- end
190
-
191
- it 'Webster should work' do
192
- skip 'Marked in code as not working; remove implementation entirely.'
193
- # BIT
194
- assert_correct_search_result(Alexandria::BookProviders::Webster_itProvider,
195
- '9788817012980')
196
- # BUK
197
- assert_correct_search_result(Alexandria::BookProviders::Webster_itProvider,
198
- '9781853260803')
199
- # BUS
200
- assert_correct_search_result(Alexandria::BookProviders::Webster_itProvider,
201
- '9780307237699')
202
- # BDE
203
- assert_correct_search_result(Alexandria::BookProviders::Webster_itProvider,
204
- '9783442460878')
205
- end
206
-
207
- it 'Webster should work with multiple authors' do
208
- skip 'Marked in code as not working; remove implementation entirely.'
209
- this_book = assert_correct_search_result(Alexandria::BookProviders::Webster_itProvider,
210
- '9788804559016')
211
- assert_kind_of(Array, this_book.authors, 'Not an array!')
212
- # puts this_book.authors
213
- assert(this_book.authors.length == 3, 'Wrong number of authors for this book!')
214
- end
215
-
216
179
  it 'Renaud should work' do
217
180
  skip 'Marked in code as not working; remove implementation entirely.'
218
181
  # adultes
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (C) 2007 Joseph Method
2
4
  # Copyright (C) 2011, 2015 Matijs van Zuijlen
3
5
  #
@@ -47,11 +49,11 @@ describe Alexandria::Book do
47
49
  end
48
50
 
49
51
  it 'does not allow higher rating than 5 to be assigned' do
50
- expect { book.rating = 6 }.to raise_error
52
+ expect { book.rating = 6 }.to raise_error ArgumentError
51
53
  end
52
54
 
53
55
  it 'does not allow lower rating than 0 to be assigned' do
54
- expect { book.rating = -1 }.to raise_error
56
+ expect { book.rating = -1 }.to raise_error ArgumentError
55
57
  end
56
58
  end
57
59
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #-- -*- ruby -*-
2
4
  # Copyright (C) 2004-2006 Dafydd Harries
3
5
  # Copyright (C) 2007 Cathal Mc Ginley
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (C) 2007 Joseph Method
2
4
  #
3
5
  # Alexandria is free software; you can redistribute it and/or
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #-- -*- ruby -*-
2
4
  # Copyright (C) 2007 Cathal Mc Ginley
3
5
  # Copyright (C) 2014 Matijs van Zuijlen
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (C) 2007 Joseph Method
2
4
  #
3
5
  # Alexandria is free software; you can redistribute it and/or
@@ -24,7 +26,7 @@ describe Alexandria::SmartLibrary do
24
26
  end
25
27
 
26
28
  it 'normalizes the encoding for name' do
27
- bad_name = 'Prêts'.force_encoding('ascii')
29
+ bad_name = (+'Prêts').force_encoding('ascii')
28
30
  lib = described_class.new(bad_name, [], :all)
29
31
  expect(lib.name.encoding.name).to eq 'UTF-8'
30
32
  expect(bad_name.encoding.name).to eq 'US-ASCII'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (C) 2007 Joseph Method
2
4
  # Copyright (C) 2015, 2016 Matijs van Zuijlen
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (C) 2008 Joseph Method
2
4
  # Copyright (C) 2014 Matijs van Zuijlen
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (C) 2007 Joseph Method
2
4
  # Copyright (C) 2007 Cathal Mc Ginley
3
5
  # Copyright (C) 2011, 2014-2016 Matijs van Zuijlen
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (C) 2008 Joseph Method
2
4
  # Copyright (C) 2014 Matijs van Zuijlen
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (C) 2016 Matijs van Zuijlen
2
4
  #
3
5
  # Alexandria is free software; you can redistribute it and/or
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (C) 2008 Joseph Method
2
4
  # Copyright (C) 2014 Matijs van Zuijlen
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (C) 2007 Joseph Method
2
4
  # Copyright (C) 2011, 2014-2016 Matijs van Zuijlen
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (C) 2007 Joseph Method
2
4
  #
3
5
  # Alexandria is free software; you can redistribute it and/or
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (C) 2007 Joseph Method
2
4
  # Copyright (C) 2014, 2016 Matijs van Zuijlen
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  desc 'run dogtail integration tests'
2
4
  task :dogtail do
3
5
  `RUBYOPT='-rbundler/setup -Ilib' python dogtail/*.py`
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #--
2
4
  # Copyright (C) 2011 Matijs van Zuijlen
3
5
  #
@@ -25,6 +27,6 @@
25
27
  require 'rake/clean'
26
28
 
27
29
  # Load the other rake files in the tasks folder
28
- tasks_dir = File.expand_path(File.dirname(__FILE__))
30
+ tasks_dir = __dir__
29
31
  rakefiles = Dir.glob(File.join(tasks_dir, '*.rake')).sort
30
32
  import(*rakefiles)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- ruby -*-
2
4
  #--
3
5
  # Copyright (C) 2011 Matijs van Zuijlen
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- ruby -*-
2
4
  #--
3
5
  # Copyright (C) 2009 Cathal Mc Ginley
@@ -115,9 +117,7 @@ class FileInstallTask < Rake::TaskLib
115
117
  end
116
118
 
117
119
  uninstall_description = 'Uninstall package files'
118
- if @stage_dir
119
- uninstall_description += ' from staging directory'
120
- end
120
+ uninstall_description += ' from staging directory' if @stage_dir
121
121
  desc uninstall_description
122
122
  task tasknames[:uninstall] => [tasknames[:uninstall_files],
123
123
  tasknames[:uninstall_dirs]]
@@ -176,9 +176,7 @@ class FileInstallTask < Rake::TaskLib
176
176
  else
177
177
  RbConfig::CONFIG['sitelibdir']
178
178
  end
179
- if ENV.key?('RUBYLIBDIR')
180
- ruby_libdir = ENV['RUBYLIBDIR']
181
- end
179
+ ruby_libdir = ENV['RUBYLIBDIR'] if ENV.key?('RUBYLIBDIR')
182
180
 
183
181
  @prefix = ENV['PREFIX'] || ruby_prefix
184
182
  if @prefix == ruby_prefix
@@ -252,9 +250,7 @@ class FileInstallTask < Rake::TaskLib
252
250
  else
253
251
  dest_basedir = Pathname.new(@dest_dir)
254
252
  end
255
- if source_file.file?
256
- source_path = source_file.dirname.relative_path_from(source_basedir)
257
- end
253
+ source_path = source_file.dirname.relative_path_from(source_basedir) if source_file.file?
258
254
  dest = source_path ? dest_basedir + source_path : dest_basedir
259
255
  dest.to_s
260
256
  end
@@ -268,9 +264,7 @@ class FileInstallTask < Rake::TaskLib
268
264
  files.each do |f|
269
265
  dest = dest_dir(f, base_dir)
270
266
  FileUtils.mkdir_p(dest) unless test('d', dest)
271
- if test('f', f)
272
- FileUtils.install(f, dest, mode: mode)
273
- end
267
+ FileUtils.install(f, dest, mode: mode) if test('f', f)
274
268
  end
275
269
  end
276
270
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- ruby -*-
2
4
  #--
3
5
  # Copyright (C) 2009 Cathal Mc Ginley
@@ -40,9 +42,7 @@ class GettextGenerateTask < Rake::TaskLib
40
42
  desc 'Generate gettext localization files'
41
43
  task gettext: @generated_files
42
44
 
43
- if CLOBBER
44
- @generated_files.each { |gen| CLOBBER << gen }
45
- end
45
+ @generated_files.each { |gen| CLOBBER << gen } if CLOBBER
46
46
  end
47
47
 
48
48
  def generate_po_files(po_dir, file_glob, dest_dir)
@@ -56,8 +56,8 @@ class GettextGenerateTask < Rake::TaskLib
56
56
  dest_dir = File.dirname(t.name)
57
57
  FileUtils.makedirs(dest_dir) unless FileTest.exists?(dest_dir)
58
58
  puts "Generating #{t.name}"
59
- system("msgfmt #{t.source} -o #{t.name}")
60
- raise "msgfmt failed for #{t.source}" if $CHILD_STATUS.nonzero?
59
+ result = system("msgfmt #{t.source} -o #{t.name}")
60
+ raise "msgfmt failed for #{t.source}" unless result
61
61
  end
62
62
  mo_files.each { |mo| @generated_files << mo }
63
63
  end
@@ -69,8 +69,10 @@ class GettextGenerateTask < Rake::TaskLib
69
69
  def generate_desktop(infile, outfile)
70
70
  @generated_files << outfile
71
71
  file outfile => [infile, *po_files] do |_f|
72
- unless `intltool-merge --version`
73
- raise Exception, 'Need to install intltool'
72
+ begin
73
+ `intltool-merge --version`
74
+ rescue Errno::ENOENT
75
+ raise 'Need to install intltool'
74
76
  end
75
77
  system("intltool-merge -d #{@po_dir} #{infile} #{outfile}")
76
78
  end
@@ -97,60 +99,3 @@ class GettextGenerateTask < Rake::TaskLib
97
99
  po_file_for(Regexp.last_match[1])
98
100
  end
99
101
  end
100
-
101
- # class GettextConfig < BuildConfig
102
- # attr_accessor :po_dir, :po_files_glob
103
- # attr_accessor :mo_dir, :mo_files_regex
104
- # def initialize(build)
105
- # super(build)
106
- # @po_dir = 'po'
107
- # @po_files_glob = "#{@po_dir}/*.po"
108
- # @mo_dir = 'data/locale'
109
- # @mo_files_regex = /.*\/(.+)\/LC_MESSAGES\/.+\.mo/
110
- # end
111
- # def po_files
112
- # FileList[po_files_glob]
113
- # end
114
- # def po_file_for(locale)
115
- # "#{po_dir}/#{locale}.po"
116
- # end
117
- # def locales
118
- # po_files.map { |po| File.basename(po).split('.')[0] }
119
- # end
120
- # def mo_files
121
- # locales.map { |loc| mo_file_for(loc) }
122
- # end
123
- # def mo_file_for(locale)
124
- # "#{mo_dir}/#{locale}/LC_MESSAGES/#{build.name}.mo"
125
- # end
126
- # def source_file(dest_file)
127
- # dest_file =~ mo_files_regex
128
- # po_file_for($1)
129
- # end
130
- # end
131
-
132
- # def define_gettext_tasks
133
- # # extract translations from PO files into other files
134
- # file files.desktop => ["#{files.desktop}.in",
135
- # *@gettext.po_files] do |f|
136
- # raise "Need to install intltool" unless system("intltool-merge -d #{@gettext.po_dir} #{f.name}.in #{f.name}")
137
- # end
138
-
139
- # # create MO files
140
- # rule( /\.mo$/ => [ lambda { |dest| @gettext.source_file(dest) }]) do |t|
141
- # dest_dir = File.dirname(t.name)
142
- # FileUtils.makedirs(dest_dir) unless FileTest.exists?(dest_dir)
143
- # puts "Generating #{t.name}"
144
- # system("msgfmt #{t.source} -o #{t.name}")
145
- # raise "msgfmt failed for #{t.source}" if $? != 0
146
- # end
147
-
148
- # desc "Generate gettext localization files"
149
- # task :gettext => [files.desktop, *@gettext.mo_files]
150
-
151
- # task :clobber_gettext do
152
- # FileUtils.rm_f(files.desktop)
153
- # FileUtils.rm_rf(@gettext.mo_dir)
154
- # end
155
- # task :clobber => [:clobber_gettext]
156
- # end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- ruby -*-
2
4
  #--
3
5
  # Copyright (C) 2009 Cathal Mc Ginley
@@ -40,9 +42,7 @@ class OmfGenerateTask < Rake::TaskLib
40
42
  desc 'Generate Open Metadata Framework files'
41
43
  task omf: @generated_files
42
44
 
43
- if CLOBBER
44
- @generated_files.each { |gen| CLOBBER << gen }
45
- end
45
+ @generated_files.each { |gen| CLOBBER << gen } if CLOBBER
46
46
  end
47
47
 
48
48
  def locale_for(omf_file)