sixarma-bt 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/Rakefile +1 -1
  2. data/lib/sixarma/bt.rb +103 -78
  3. metadata +2 -2
data/Rakefile CHANGED
@@ -13,7 +13,7 @@ require 'rake/testtask'
13
13
  spec = Gem::Specification.new do |s|
14
14
  s.name = 'sixarma-bt'
15
15
  s.rubyforge_project = s.name
16
- s.version = '0.7.1'
16
+ s.version = '0.7.2'
17
17
  s.has_rdoc = true
18
18
  s.extra_rdoc_files = ['README', 'LICENSE']
19
19
  s.summary = 'BuildTools for full conversion Mods for Armed Assault'
data/lib/sixarma/bt.rb CHANGED
@@ -5,6 +5,7 @@
5
5
  # TODO: log4r support per module instead of all in core?
6
6
  # TODO: Implement FATAL, WARN etc loglevels?
7
7
  # TODO: Convert all Config/Stats classes from CON_STANT to ConStant variation
8
+ # FIXME: Look at Keys Cleaning for "whole" processing
8
9
  # TODO: List:
9
10
  - More sophisticated svn changes system which goes beyond "Addons" and "Dta" etc
10
11
  -- CONFIG_MOD_SUBFOLDERS per mod implemented, but only active for creating addons and signing
@@ -238,7 +239,7 @@ module SixArma
238
239
  # update the version files
239
240
  SixCore::info "Updating version.txt..."
240
241
  # used by updater setup program
241
- File.open("#{@config.outroot}/files/update/#{@config.mods[0].destination}/#{@config.verpath}/version.txt", "w") do |f|
242
+ File.open("#{@config.outroot}/files/update/#{@config.mods[0].destination}/#{@config.verpath}/version.txt", 'w') do |f|
242
243
  f << @stats.newver
243
244
  end
244
245
 
@@ -246,7 +247,7 @@ module SixArma
246
247
  unless @config.veraddon.nil?
247
248
  verfile = File.open(
248
249
  "#{@config.mods[0].path}/#{@config.mods[0].source}/Addons/#{@config.veraddon}/version.hpp",
249
- "w") do |f|
250
+ 'w') do |f|
250
251
  f.puts "VERSION = \"#{@stats.newver}\";"
251
252
  f.puts "text = \"#{@config.title} v#{@stats.newver}\";"
252
253
  end
@@ -255,7 +256,7 @@ module SixArma
255
256
  @names = []
256
257
  @names_c = []
257
258
 
258
- #tmp
259
+ # tmp
259
260
 
260
261
  read_changelog()
261
262
  # Write per mod per version changelog
@@ -318,91 +319,112 @@ module SixArma
318
319
  @names_c << 1
319
320
  @names << name
320
321
  end
322
+ types = [
323
+ "CHANGED", "CHANGE", "C", "MODIFIED", "MOD",
324
+ "ADDED", "ADD", "A",
325
+ "FIXED", "FIX", "F",
326
+ "UPDATED", "UPDATE", "UPD", "U",
327
+ "DELETED", "DELETE", "DEL", "REMOVED",
328
+ "LOCAL", "MOVED", "MOV", "REVERTED", "RENAMED", "R"
329
+ ]
330
+ type_pattern = types.join '|'
321
331
  l[1].each do |c|
322
- case c
323
- when /^[\s]*~[\s]*/
324
- c.gsub!(/^[\s]*~[\s]*/, '')
325
- c.strip!
326
- c.gsub!(/[\s]+/, '')
327
- type = c[/^([\w]+)/]
328
- type.upcase! unless type.nil?
329
- if ["CHANGED", "FIXED", "ADDED", "REMOVED", "UPDATED", "LOCAL",
330
- "MOVED", "MODIFIED", "RENAMED", "REVERTED", "UPDATE",
331
- "ADD", "MOD", "FIX", "MOV", "UPD", "DEL",
332
- "C", "A", "R", "F"].include?(type)
333
- c.gsub!(/^([\w]+)[\s]*/, "")
334
- case c
335
- when /^-* *([\w]+):/ # /^- ([\w]+):/ and /^([\w]+):/
336
- tmp = c[/^-* *([\w]+):/]
337
- when /^- +([\w]+) +\-/
338
- tmp = c[/^- +([\w]+) +\-/]
339
- when /^- ([\w]+) ([\w]+):/
340
- tmp = c[/^- ([\w]+) ([\w]+):/]
341
- when /^- ([\w]+) ([\w]+) ([\w]+):/
342
- tmp = c[/^- ([\w]+) ([\w]+) ([\w]+):/]
343
- end
332
+ if true #c =~ /^\s*~\s*/
333
+ is_valid, type, places, comment = case c
334
+ when /^\s*~?\s*(#{type_pattern})\s+-\s*((\w+)(\s*(and|&)\s*(\w+))?(\s*(and|&)\s*(\w+))?):?\s*(.+?)\s*$/i
335
+ # ~ type - place: comment
336
+ # ~ type - place comment
337
+ # ~ type - place
338
+ # type - place: comment
339
+ # type - place comment
340
+ # type - place
341
+ # where "place" can be "place" or "place and place" or "place and place and place"
342
+ # where "and" can be "and" or "&"
343
+
344
+ found = [$3]
345
+ found.push $6 unless $6.nil?
346
+ found.push $9 unless $9.nil?
347
+
348
+ [true, $1, found, $10]
349
+
350
+ when /^\s*~?\s*(#{type_pattern})\s+(\w+_\w+):\s*(.+?)\s*$/i
351
+ # ~ place: comment
352
+ # place: comment
353
+ [true, $1, [$2], $3]
354
+
355
+ when /^\s*~?\s*(#{type_pattern})\s*:\s*(.+?)\s*$/i
356
+ # ~ type: comment
357
+ # type: comment
358
+ [true, $1, [], $2]
359
+
360
+ when /^\s*~?\s*(#{type_pattern})\s+(.+?)\s*$/i
361
+ # ~ type comment
362
+ # type comment
363
+ [true, $1, [], $2]
364
+
365
+ when /^\s*~\s*(.*?)\s*$/
366
+ # ~ comment
367
+ [true, 'CHANGED', [], $1]
368
+
369
+ when /^\s*(.*?)\s*$/
370
+ # comment
371
+ [true, 'LOCAL', [], $1]
344
372
 
345
- unless tmp.nil?
346
- c.gsub!(tmp, "")
347
- c.strip!
348
- tmp.gsub!(/[:-]/, "")
349
- tmp.gsub!(/[\s]*-[\s]*/, "")
350
- tmp.strip!
351
- c = "#{c} - #{tmp}"
352
- end
353
- c.gsub!(/^: /, "")
354
- c.gsub!(/^- /, "")
355
373
  else
356
- type = "CHANGED"
374
+ [false, "", "", ""]
357
375
  end
358
- unless c.empty?
359
- case c
360
- when /version tag/i, /buildscripts/i, /build /i, /readme /i, /credits/i, /\.txt/i, /\.bat/i, /changelog/i, / txt /i, /this/i
361
- type = "LOCAL"
376
+
377
+ if is_valid
378
+ case comment
379
+
380
+ when /version tag|buildscripts?|build[_\s+]|readme|credits|\.txt|\.bat|changelog| txt |this/i
381
+ type = 'LOCAL'
362
382
  end
363
- # Only capitalize first word, leave rest intact
364
- c.strip!
365
- c.gsub!(/^[:\-\.~]\s*/, '')
366
- # Filter :-D
367
- c.gsub!(/penis|dildo|noob/i, '****')
368
- f = c[/^[\w]+/]
369
- unless f.nil?
370
- case f
371
- when /REMOVED/i, /DELETED/i
372
- type = "REMOVED"
373
- c.sub!(f, "")
374
- c.gsub!(/^[:\-\.~]/, '')
375
- when /TODO/i, /RESTORED/i
376
- type = "LOCAL"
383
+ comment.gsub!(/penis|dildo|noob/i, '****')
384
+ comment.gsub!(/^\s*([:\-\.~\,]|\**)\s*/, '')
385
+ # FIXME: Shouldn't this be possible with just 1* regex?
386
+ comment.gsub!(/^\s*([:\-\.~,]|\**)\s*/, '')
387
+ comment.gsub!('http', 'ticket: http')
388
+ unless comment.empty?
389
+ f = comment[/^\w+/]
390
+ unless f.nil?
391
+ case f
392
+ #when /REMOVED|DELETED/i
393
+ # type = "REMOVED"
394
+ # comment.sub!(f, "")
395
+ # comment.gsub!(/^[:\-\.~]/, '')
396
+ # f = comment[/^\w+/]
397
+ when /TODO|RESTORTED/i
398
+ type = 'LOCAL'
399
+ end
400
+ # Capitalize only first word
401
+ comment.gsub!(/^\w+/, '')
402
+ f.capitalize!
403
+ comment = "#{f}#{comment}"
377
404
  end
378
- end
379
- c.strip!
380
- f = c[/^[\w]+/]
381
- c.gsub!(/^[\w]+/, "")
382
- unless f.nil?
383
- f.strip!
384
- f.capitalize!
385
- end
386
- entry = "#{f}#{c} [#{name}]"
387
- entry.strip!
388
- unless "#{f}#{c}".strip.empty?
389
- # Add entry to appriopriate array
405
+ if places.empty?
406
+ entry = comment
407
+ else
408
+ entry = "#{comment} - #{places}"
409
+ end
410
+ entry = "#{entry} [#{name}]"
390
411
  case type
391
- when "CHANGED", "C", "MODIFIED", "MOD", "RENAMED"
412
+ when /^CH?A?N?G?E?D?/i, /^MODIFIED|MOD|RENAMED/i
392
413
  mod.changelog.changed << entry
393
- when "ADDED", "A", "ADD"
414
+ when /^AD?D?E?D?/i
394
415
  mod.changelog.added << entry
395
- when "REMOVED", "R", "DEL"
416
+ when /^RE?M?O?V?E?D/i, /^DELE?T?E?D?/i
396
417
  mod.changelog.removed << entry
397
- when "UPDATED", "U", "UPD", "UPDATE"
418
+ when /^UP?D?A?T?E?D?/i
398
419
  mod.changelog.updated << entry
399
- when "FIXED", "F", "FIX"
420
+ when /^FI?X?E?D?/i
400
421
  mod.changelog.fixed << entry
401
- when "LOCAL", "MOVED", "MOV", "REVERTED"
422
+ when /^MOVE?D?/i, /^LOCAL|REVERTED/i
402
423
  mod.changelog.local << entry
403
424
  end
404
425
  end
405
426
  end
427
+
406
428
  end
407
429
  end
408
430
  end
@@ -414,6 +436,14 @@ module SixArma
414
436
  mod.changelog.updated.uniq!
415
437
  mod.changelog.fixed.uniq!
416
438
  mod.changelog.local.uniq!
439
+
440
+ mod.changelog.changed.sort!
441
+ mod.changelog.added.sort!
442
+ mod.changelog.removed.sort!
443
+ mod.changelog.updated.sort!
444
+ mod.changelog.fixed.sort!
445
+ mod.changelog.local.sort!
446
+
417
447
  SixCore::info "SVN #{mod2.destination} Current Rev: #{mod.newrev} | Previous Rev: #{mod.oldrev}"
418
448
  end
419
449
  end
@@ -466,7 +496,6 @@ module SixArma
466
496
  unless mod.oldrev == mod.newrev
467
497
  if mod.changelog.added.size > 0
468
498
  log << "** ADDED:"
469
- mod.changelog.added.sort!
470
499
  mod.changelog.added.each do |e|
471
500
  e = "*** #{e}"
472
501
  log << e
@@ -475,7 +504,6 @@ module SixArma
475
504
  end
476
505
  if mod.changelog.updated.size > 0
477
506
  log << "** UPDATED:"
478
- mod.changelog.updated.sort!
479
507
  mod.changelog.updated.each do |e|
480
508
  e = "*** #{e}"
481
509
  log << e
@@ -484,7 +512,6 @@ module SixArma
484
512
  end
485
513
  if mod.changelog.removed.size > 0
486
514
  log << "** REMOVED:"
487
- mod.changelog.removed.sort!
488
515
  mod.changelog.removed.each do |e|
489
516
  e = "*** #{e}"
490
517
  log << e
@@ -493,7 +520,6 @@ module SixArma
493
520
  end
494
521
  if mod.changelog.changed.size > 0
495
522
  log << "** CHANGED:"
496
- mod.changelog.changed.sort!
497
523
  mod.changelog.changed.each do |e|
498
524
  e = "*** #{e}"
499
525
  log << e
@@ -502,7 +528,6 @@ module SixArma
502
528
  end
503
529
  if mod.changelog.fixed.size > 0
504
530
  log << "** FIXED:"
505
- mod.changelog.fixed.sort!
506
531
  mod.changelog.fixed.each do |e|
507
532
  e = "*** #{e}"
508
533
  log << e
@@ -630,6 +655,6 @@ module SixArma
630
655
  end
631
656
 
632
657
  component = '6thSense.eu ArmA BuildTools'
633
- version = '0.7.1'
658
+ version = '0.7.2'
634
659
  SixCore::debugs "#{component} #{version} loaded"
635
660
  SixCore::infos("v#{version}, by Sickboy (sb_at_6thSense.eu)", component)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sixarma-bt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sickboy
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-29 00:00:00 +01:00
12
+ date: 2008-11-30 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency