lib/maven/tools/dsl/jarfile_lock.rb in maven-tools-1.0.10 vs lib/maven/tools/dsl/jarfile_lock.rb in maven-tools-1.0.11
- old
+ new
@@ -27,14 +27,17 @@
def initialize( jarfile )
@file = File.expand_path( jarfile + ".lock" ) if jarfile
if @file && File.exists?( @file )
lock = YAML.load( File.read( @file ) )
- if lock.is_a? Hash
+ case lock
+ when Hash
@data = lock
- else
+ when String
# fallback on old format and treat them all as "runtime"
data[ :runtime ] = lock.split( /\ / )
+ else
+ warn "unknown format of #{@file} - skip it"
end
end
end
def dump