bin/soybean in soybean-2.1.0 vs bin/soybean in soybean-2.1.1
- old
+ new
@@ -8,25 +8,39 @@
class Soybean::CLI < Thor
include Thor::Actions
class_options :quiet => :boolean, :force => :boolean, :pretend => :boolean
+ class_option :remove, :type => :boolean, :aliases => [:undo]
desc "types [PATH_TO_XSD]", "Generate Ruby classes for xsd-schema from file_path.xsd"
def types(location, destination = '.')
Soybean::Generators::TypesGenerator.new(URI.parse(location)).generate do |filename, content|
- create_file File.join(destination, filename), content, options
+ if options[:remove]
+ remove_file File.join(destination, filename), options
+ else
+ create_file File.join(destination, filename), content, options
+ end
end
end
desc "service [PATH_TO_WSDL] [DESTINATION_DIR]", "Generate classes for WebService from WSDL"
def service(wsdl, dir)
Soybean::Generators::ServiceGenerator.new(dir, wsdl, spec_dir(dir)).generate do |filename, content|
- create_file filename, content, options
+ if options[:remove]
+ remove_file filename, options
+ else
+ create_file filename, content, options
+ end
end
end
+ desc "version", "Show current version"
+ def version
+ puts File.read File.expand_path('../../VERSION', __FILE__)
+ end
+
no_tasks do
def spec_dir(dir)
default_spec_dir = "spec/#{dir}/models"
if options[:force]
default_spec_dir
@@ -35,6 +49,6 @@
end
end
end
end
-Soybean::CLI.start
\ No newline at end of file
+Soybean::CLI.start