six-arma-tools 0.1.2 → 0.1.4

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.
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ require 'rake/testtask'
12
12
 
13
13
  spec = Gem::Specification.new do |s|
14
14
  s.name = 'six-arma-tools'
15
- s.version = '0.1.2'
15
+ s.version = '0.1.4'
16
16
  s.has_rdoc = true
17
17
  s.extra_rdoc_files = ['README', 'LICENSE']
18
18
  s.summary = 'Your summary here'
@@ -10,7 +10,7 @@ module Six
10
10
  Process.exit!
11
11
  end
12
12
  COMPONENT = 'six-arma-tools'
13
- VERSION = "0.1.2"
13
+ VERSION = "0.1.4"
14
14
 
15
15
  @@options = Hash.new unless defined?(@@options)
16
16
  @@config = Hash.new
@@ -15,6 +15,8 @@ module Six
15
15
  attr_accessor(:destination) # allows instance.attribute to be read and written (e.g convert.destination)
16
16
 
17
17
  def initialize(source, destination = source)
18
+ source.gsub!("\\", "/")
19
+ destination.gsub!("\\", "/")
18
20
  @source = source
19
21
  source[/(.*)\//]
20
22
  if destination == $1
@@ -53,9 +55,14 @@ module Six
53
55
  log.info "AutoPrefix: #{@source}"
54
56
  if FileTest.exist?(File.join(folder, filename, '$PBOPREFIX$'))
55
57
  # TODO: .lines might be bugged in 1.8.6 windows
56
- File.open(File.join(folder, filename, '$PBOPREFIX$'), 'r') { |file| file.lines.each { |line| tag = "#{$1}_" if line[/x\\(\w*)\\/] } }
58
+ File.open(File.join(folder, filename, '$PBOPREFIX$'), 'r') { |file| file.lines.each { |line| tag = $1 if line[/x\\(\w*)\\/] } }
57
59
  end
58
- unless tag == ''
60
+ if tag.nil? || tag.empty?
61
+ File.dirname(@source)[/^.*\/x\/(\w*)\//]
62
+ tag = $1
63
+ end
64
+ unless tag.nil? || tag.empty?
65
+ tag = "#{tag}_"
59
66
  mv(File.join(@destination, "#{filename}.pbo"), File.join(@destination,"#{tag}#{filename}.pbo"))
60
67
  end
61
68
  if FileTest.exist?(File.join(@destination, "#{filename}.log"))
@@ -119,7 +126,7 @@ module Six
119
126
  log.info exec
120
127
  output = %x[#{exec}]
121
128
  log.debug output
122
- unless @same
129
+ unless @same || @destination == File.dirname(@source)
123
130
  # TODO: Better to have makepbo accept a destination.. Otherwise it overwrites/removes addons already present in source!
124
131
  puts "#{@source} #{@destination}"
125
132
  FileUtils::mv("#{@source}.pbo", @destination) if @destination
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: six-arma-tools
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 19
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 1
8
- - 2
9
- version: 0.1.2
9
+ - 4
10
+ version: 0.1.4
10
11
  platform: ruby
11
12
  authors:
12
13
  - ""
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-04-27 00:00:00 +02:00
18
+ date: 2010-06-04 00:00:00 +02:00
18
19
  default_executable:
19
20
  dependencies: []
20
21
 
@@ -44,23 +45,27 @@ rdoc_options: []
44
45
  require_paths:
45
46
  - lib
46
47
  required_ruby_version: !ruby/object:Gem::Requirement
48
+ none: false
47
49
  requirements:
48
50
  - - ">="
49
51
  - !ruby/object:Gem::Version
52
+ hash: 3
50
53
  segments:
51
54
  - 0
52
55
  version: "0"
53
56
  required_rubygems_version: !ruby/object:Gem::Requirement
57
+ none: false
54
58
  requirements:
55
59
  - - ">="
56
60
  - !ruby/object:Gem::Version
61
+ hash: 3
57
62
  segments:
58
63
  - 0
59
64
  version: "0"
60
65
  requirements: []
61
66
 
62
67
  rubyforge_project:
63
- rubygems_version: 1.3.6
68
+ rubygems_version: 1.3.7
64
69
  signing_key:
65
70
  specification_version: 3
66
71
  summary: Your summary here