six-arma-tools 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
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.2.0'
15
+ s.version = '0.2.1'
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.2.0"
13
+ VERSION = "0.2.1"
14
14
 
15
15
  @@options = Hash.new unless defined?(@@options)
16
16
  @@config = Hash.new
@@ -14,10 +14,11 @@ module Six
14
14
  attr_reader(:source) # allows instance.attribute to be read (e.g convert.source)
15
15
  attr_accessor(:destination) # allows instance.attribute to be read and written (e.g convert.destination)
16
16
 
17
- def initialize(source, destination = source)
17
+ def initialize(source, destination = source, options = {})
18
18
  source.gsub!("\\", "/")
19
19
  destination.gsub!("\\", "/")
20
20
  @source = source
21
+ @options = options
21
22
  source[/(.*)\//]
22
23
  if destination == $1
23
24
  @same = true
@@ -215,8 +216,13 @@ module Six
215
216
  end
216
217
 
217
218
  def sign(params = {})
218
- # TODO: Prefix calculation.... use auto_prefix?
219
+ # TODO: Prefix calculation.... use auto_prefix?
220
+ params[:key] = @options[:key] unless params[:key]
221
+ params[:key] = settings[:key] unless params[:key]
219
222
  if params[:key]
223
+ unless File.exists?(params[:key])
224
+ Dir.chdir(File.dirname(params[:key])) { system "#{tool('dscreatekey.exe')} #{File.basename(params[:key].sub(".biprivatekey", ""))}" }
225
+ end
220
226
  params[:key].gsub!('/', '\\')
221
227
  @source[/(.*)\/(.*)/]
222
228
  path = $1
@@ -224,8 +230,7 @@ module Six
224
230
  file += ".pbo" unless file[/\.pbo\Z/]
225
231
  # TODO: Export path to config
226
232
  log.info "Signing"
227
- Dir.chdir path
228
- system "#{tool('dssignfile.exe')} #{params[:key]} #{file}"
233
+ Dir.chdir(path) { system "#{tool('dssignfile.exe')} #{params[:key]} #{file}" }
229
234
  end
230
235
  end
231
236
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: six-arma-tools
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - ""