Permalink
Browse files

Cleanup the soap files in a more sane way

  • Loading branch information...
1 parent bff7ac2 commit 88d2c53c11d0e9074114136f23d90d920bb0a963 @halorgium committed Aug 11, 2009
Showing with 11 additions and 3 deletions.
  1. +11 −3 lib/dm-salesforce/soap_wrapper.rb
@@ -32,17 +32,24 @@ def generate_soap_classes
ARGV.replace %W(--wsdl #{wsdl_path} --module_path #{module_name} --classdef #{module_name} --type client)
load wsdl2ruby
ARGV.replace old_args
- FileUtils.rm Dir["*Client.rb"]
+ (Dir["*.rb"] - files).each do |filename|
+ FileUtils.rm(filename)
+ end
end
end
$:.push wsdl_api_dir
require "#{module_name}Driver"
+ $:.delete wsdl_api_dir
+ end
+
+ def files
+ ["#{module_name}.rb", "#{module_name}MappingRegistry.rb", "#{module_name}Driver.rb"]
end
def files_exist?
- %w( .rb Driver.rb MappingRegistry.rb ).all? do |suffix|
- File.exist?("#{wsdl_api_dir}/#{module_name}#{suffix}")
+ files.all? do |name|
+ File.exist?("#{wsdl_api_dir}/#{name}")
end
end
@@ -51,3 +58,4 @@ def wsdl_api_dir
end
end
end
+

0 comments on commit 88d2c53

Please sign in to comment.