Title: [862] trunk/rails-integration/plugins/goldspike-snapshot/lib: Change to FileUtils.copy and makedirs in snapshot plugin also

Diff

Modified: trunk/rails-integration/plugins/goldspike-snapshot/lib/create_war.rb (861 => 862)


--- trunk/rails-integration/plugins/goldspike-snapshot/lib/create_war.rb	2008-01-02 21:43:00 UTC (rev 861)
+++ trunk/rails-integration/plugins/goldspike-snapshot/lib/create_war.rb	2008-01-02 21:43:06 UTC (rev 862)
@@ -87,7 +87,7 @@
 
     def add_configuration_files
       require 'erb'
-      File.makedirs(File.join(config.staging, 'WEB-INF'))
+      FileUtils.makedirs(File.join(config.staging, 'WEB-INF'))
       war_file_dir = File.join(config.staging, 'WEB-INF')
       Dir.foreach(war_file_dir) do |file|        
         output = case file

Modified: trunk/rails-integration/plugins/goldspike-snapshot/lib/java_library.rb (861 => 862)


--- trunk/rails-integration/plugins/goldspike-snapshot/lib/java_library.rb	2008-01-02 21:43:00 UTC (rev 861)
+++ trunk/rails-integration/plugins/goldspike-snapshot/lib/java_library.rb	2008-01-02 21:43:06 UTC (rev 862)
@@ -45,7 +45,7 @@
     
     def install_local(config, file, target_file)
       return false unless File.exists?(file)
-      File.install(file, target_file, 0644)
+      FileUtils.copy(file, target_file)
       return true
     end
     
@@ -109,7 +109,7 @@
       @version = version
       @locations = maven_locations(group, name, version)   
     end
-	
+
     def maven_locations(group, artifact, version, type='jar')
       WLog.debug("locations for " + group + " " + artifact + " " + version);
       paths = []

Modified: trunk/rails-integration/plugins/goldspike-snapshot/lib/packer.rb (861 => 862)


--- trunk/rails-integration/plugins/goldspike-snapshot/lib/packer.rb	2008-01-02 21:43:00 UTC (rev 861)
+++ trunk/rails-integration/plugins/goldspike-snapshot/lib/packer.rb	2008-01-02 21:43:06 UTC (rev 862)
@@ -1,4 +1,3 @@
-
 require 'util'
 
 module War
@@ -15,7 +14,7 @@
       # File.install is disabled because of a performance problem under JRuby,
       # without it the task may fail if the original gem files were not writable by the owner
       #File.install(source, dest, mode)
-      File.copy(source, dest)
+      FileUtils.copy(source, dest)
     end
     
     def copy_tree(files, target, strip_prefix='')
@@ -23,10 +22,10 @@
         relative = f[strip_prefix.length, f.length]
         target_file = File.join(target, relative)
         if File.directory?(f)
-          File.makedirs(target_file)
+          FileUtils.makedirs(target_file)
         elsif File.file?(f)
           WLog.debug "  Copying #{f} to #{relative}"
-          File.makedirs(File.dirname(target_file))
+          FileUtils.makedirs(File.dirname(target_file))
           install(f, target_file)
         end
       end    
@@ -75,7 +74,7 @@
 
     def install(dir_sym, dir)
       WLog.debug("assembling files in " + dir + " directory")
-      File.makedirs(dir)
+      FileUtils.makedirs(dir)
       WLog.debug("need to assemble #{config.files.select{|k,v| v[:directory] == dir_sym }.size} files")
       for name, file_info in config.files
         next unless file_info[:directory] == dir_sym
@@ -86,7 +85,7 @@
         if !File.exists?(target) || File.mtime(target) < File.mtime(file_info[:location])
           WLog.info "  adding file #{name}"
           if File.exists?(file)
-            File.install(file, target, 0644)
+            FileUtils.copy(file, target)
           else
             WLog.warn "file '#{file}' does not exist"
           end
@@ -106,7 +105,7 @@
       staging = config.staging
       lib = File.join(staging, 'WEB-INF', 'lib')
       WLog.debug("assembling files in " + lib + " directory")
-      File.makedirs(lib)
+      FileUtils.makedirs(lib)
       WLog.debug("need to assemble #{config.java_libraries.size} libraries")
       for library in config.java_libraries.values
         WLog.debug("library to assemble " + library.name)
@@ -130,9 +129,9 @@
       # add the gems
       WLog.info("  Adding Ruby gems...")
       gem_home = File.join(config.staging, 'WEB-INF', 'gems')
-      File.makedirs(gem_home)
-      File.makedirs(File.join(gem_home, 'gems'))
-      File.makedirs(File.join(gem_home, 'specifications'))
+      FileUtils.makedirs(gem_home)
+      FileUtils.makedirs(File.join(gem_home, 'gems'))
+      FileUtils.makedirs(File.join(gem_home, 'specifications'))
       for gem in config.gem_libraries
         copy_gem(gem[0], gem[1], gem_home)
       end
@@ -152,7 +151,7 @@
         # copy the specification
         install(gem.loaded_from, File.join(target_gem_home, 'specifications'), 0644)
         # copy the files
-        File.makedirs(gem_target)
+        FileUtils.makedirs(gem_target)
         gem_files = Rake::FileList.new(File.join(gem.full_gem_path, '**', '*'))
         copy_tree(gem_files, gem_target, gem.full_gem_path)
         # compile the .rb files to .rb.ast.ser
@@ -195,7 +194,7 @@
     def add_webapp
       staging = config.staging
       WLog.info 'Packing web application ...'
-      File.makedirs(staging)
+      FileUtils.makedirs(staging)
       webapp_files = Rake::FileList.new(File.join('.', '**', '*'))
       webapp_files.exclude(staging)
       webapp_files.exclude('*.war')

Modified: trunk/rails-integration/plugins/goldspike-snapshot/lib/run.rb (861 => 862)


--- trunk/rails-integration/plugins/goldspike-snapshot/lib/run.rb	2008-01-02 21:43:00 UTC (rev 861)
+++ trunk/rails-integration/plugins/goldspike-snapshot/lib/run.rb	2008-01-02 21:43:06 UTC (rev 862)
@@ -63,7 +63,7 @@
     def add_jetty_libraries
       # Get the Jetty libraries
       @classpath = []
-      File.makedirs(jetty_tmp)
+      FileUtils.makedirs(jetty_tmp)
       for lib in config.jetty_libraries.values
         target = File.join(jetty_tmp, lib.file)
         unless File.exists?(target)
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel

Reply via email to