Class: Soybean::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/soybean/cli.rb

Instance Method Summary collapse

Instance Method Details

#service(wsdl, dir) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/soybean/cli.rb', line 24

def service(wsdl, dir)
  opts = options
  raise 'PATH_TO_WSDL should be a exists wsdl file or directory with wsdl`s' unless File.exists? wsdl
  full_path = File.expand_path wsdl, FileUtils.pwd
  if File.directory? full_path
    Dir["#{full_path}/*.wsdl"].each do |file|
      generate_service(file, dir, opts)
    end
  else
    generate_service(full_path, dir, opts)
  end
end

#types(location, destination = '.') ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/soybean/cli.rb', line 13

def types(location, destination = '.')
  Soybean::Generators::TypesGenerator.new(URI.parse(location)).generate do |filename, content|
    if options[:remove]
      remove_file File.join(destination, filename), options
    else
      create_file File.join(destination, filename), content, options
    end
  end
end

#versionObject



38
39
40
# File 'lib/soybean/cli.rb', line 38

def version
  puts Soybean::VERSION
end