lib/maven/tools/pom.rb in maven-tools-0.34.5 vs lib/maven/tools/pom.rb in maven-tools-1.0.0.rc2

- old
+ new

@@ -36,11 +36,11 @@ spec s end end def eval_file( file ) - if file && File.directory?( file ) + if file && ::File.directory?( file ) dir = file file = nil else dir = '.' end @@ -53,11 +53,11 @@ file ||= pom_file( '*.gemspec', dir ) end if file FileUtils.cd( dir ) do - @model = to_model( File.basename( file ) ) + @model = to_model( ::File.basename( file ) ) end end end def initialize( file = nil ) @@ -67,11 +67,11 @@ eval_file( file ) end end def pom_file( pom, dir = '.' ) - files = Dir[ File.join( dir, pom ) ] + files = Dir[ ::File.join( dir, pom ) ] case files.size when 0 when 1 files.first else @@ -88,24 +88,24 @@ end end def to_file( file ) if @model - v = ::Maven::Tools::Visitor.new( File.open( file, 'w' ) ) + v = ::Maven::Tools::Visitor.new( ::File.open( file, 'w' ) ) v.accept_project( @model ) true end end def to_model( file ) - if File.exists?( file ) + if ::File.exists?( file ) case file when /pom.rb/ - eval_pom( "tesla do\n#{ File.read( file ) }\nend", file ) + eval_pom( "tesla do\n#{ ::File.read( file ) }\nend", file ) when /(Maven|Gem|Jar)file/ - eval_pom( "tesla do\n#{ File.read( file ) }\nend", file ) + eval_pom( "tesla do\n#{ ::File.read( file ) }\nend", file ) when /.+\.gemspec/ - eval_pom( "tesla do\ngemspec( '#{ File.basename( file ) }' )\nend", file ) + eval_pom( "tesla do\ngemspec( '#{ ::File.basename( file ) }' )\nend", file ) end else eval_pom( "tesla do\n#{file}\nend", nil ) end rescue ArgumentError => e