six-arma-tools 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/six/arma/tools.rb +1 -1
- data/lib/six/arma/tools/pbodll.rb +10 -3
- metadata +9 -4
data/Rakefile
CHANGED
data/lib/six/arma/tools.rb
CHANGED
@@ -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 =
|
58
|
+
File.open(File.join(folder, filename, '$PBOPREFIX$'), 'r') { |file| file.lines.each { |line| tag = $1 if line[/x\\(\w*)\\/] } }
|
57
59
|
end
|
58
|
-
|
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
|
-
-
|
9
|
-
version: 0.1.
|
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
|
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.
|
68
|
+
rubygems_version: 1.3.7
|
64
69
|
signing_key:
|
65
70
|
specification_version: 3
|
66
71
|
summary: Your summary here
|