soybean 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. data/.document +5 -0
  2. data/.rspec +1 -0
  3. data/Gemfile +15 -0
  4. data/Gemfile.lock +38 -0
  5. data/LICENSE.txt +20 -0
  6. data/README.rdoc +19 -0
  7. data/Rakefile +44 -0
  8. data/VERSION +1 -0
  9. data/bin/soybean +22 -0
  10. data/bin/xsd2ruby +90 -0
  11. data/lib/soybean.rb +11 -0
  12. data/lib/soybean/actions/generate_classes.rb +33 -0
  13. data/soybean.gemspec +236 -0
  14. data/spec/soybean_spec.rb +5 -0
  15. data/spec/spec_helper.rb +12 -0
  16. data/vendor/soap4r/soap/attachment.rb +109 -0
  17. data/vendor/soap4r/soap/attrproxy.rb +35 -0
  18. data/vendor/soap4r/soap/base_data.rb +1095 -0
  19. data/vendor/soap4r/soap/element.rb +278 -0
  20. data/vendor/soap4r/soap/encodingstyle/asp_dot_net_handler.rb +208 -0
  21. data/vendor/soap4r/soap/encodingstyle/handler.rb +121 -0
  22. data/vendor/soap4r/soap/encodingstyle/literal_handler.rb +196 -0
  23. data/vendor/soap4r/soap/encodingstyle/soap_handler.rb +560 -0
  24. data/vendor/soap4r/soap/filter.rb +14 -0
  25. data/vendor/soap4r/soap/filter/filterchain.rb +52 -0
  26. data/vendor/soap4r/soap/filter/handler.rb +32 -0
  27. data/vendor/soap4r/soap/filter/streamhandler.rb +30 -0
  28. data/vendor/soap4r/soap/generator.rb +299 -0
  29. data/vendor/soap4r/soap/header/handler.rb +62 -0
  30. data/vendor/soap4r/soap/header/handlerset.rb +71 -0
  31. data/vendor/soap4r/soap/header/mappinghandler.rb +48 -0
  32. data/vendor/soap4r/soap/header/simplehandler.rb +45 -0
  33. data/vendor/soap4r/soap/httpconfigloader.rb +140 -0
  34. data/vendor/soap4r/soap/mapping.rb +13 -0
  35. data/vendor/soap4r/soap/mapping/encodedregistry.rb +539 -0
  36. data/vendor/soap4r/soap/mapping/factory.rb +389 -0
  37. data/vendor/soap4r/soap/mapping/literalregistry.rb +392 -0
  38. data/vendor/soap4r/soap/mapping/mapping.rb +577 -0
  39. data/vendor/soap4r/soap/mapping/registry.rb +296 -0
  40. data/vendor/soap4r/soap/mapping/rubytype_factory.rb +446 -0
  41. data/vendor/soap4r/soap/mapping/schemadefinition.rb +171 -0
  42. data/vendor/soap4r/soap/mapping/type_map.rb +107 -0
  43. data/vendor/soap4r/soap/mapping/wsdlencodedregistry.rb +212 -0
  44. data/vendor/soap4r/soap/mapping/wsdlliteralregistry.rb +249 -0
  45. data/vendor/soap4r/soap/marshal.rb +60 -0
  46. data/vendor/soap4r/soap/mimemessage.rb +243 -0
  47. data/vendor/soap4r/soap/nestedexception.rb +43 -0
  48. data/vendor/soap4r/soap/net_http_client.rb +242 -0
  49. data/vendor/soap4r/soap/ns.rb +39 -0
  50. data/vendor/soap4r/soap/parser.rb +253 -0
  51. data/vendor/soap4r/soap/processor.rb +67 -0
  52. data/vendor/soap4r/soap/property.rb +340 -0
  53. data/vendor/soap4r/soap/proxy.rb +15 -0
  54. data/vendor/soap4r/soap/rpc/cgistub.rb +248 -0
  55. data/vendor/soap4r/soap/rpc/driver.rb +222 -0
  56. data/vendor/soap4r/soap/rpc/element.rb +375 -0
  57. data/vendor/soap4r/soap/rpc/httpserver.rb +143 -0
  58. data/vendor/soap4r/soap/rpc/method_def.rb +69 -0
  59. data/vendor/soap4r/soap/rpc/proxy.rb +573 -0
  60. data/vendor/soap4r/soap/rpc/router.rb +663 -0
  61. data/vendor/soap4r/soap/rpc/rpc.rb +26 -0
  62. data/vendor/soap4r/soap/rpc/soaplet.rb +201 -0
  63. data/vendor/soap4r/soap/rpc/standalone_server.rb +44 -0
  64. data/vendor/soap4r/soap/soap.rb +154 -0
  65. data/vendor/soap4r/soap/stream_handler.rb +302 -0
  66. data/vendor/soap4r/soap/version.rb +9 -0
  67. data/vendor/soap4r/soap/wsdl_driver.rb +165 -0
  68. data/vendor/soap4r/wsdl/binding.rb +66 -0
  69. data/vendor/soap4r/wsdl/data.rb +65 -0
  70. data/vendor/soap4r/wsdl/definitions.rb +237 -0
  71. data/vendor/soap4r/wsdl/documentation.rb +33 -0
  72. data/vendor/soap4r/wsdl/import.rb +81 -0
  73. data/vendor/soap4r/wsdl/importer.rb +39 -0
  74. data/vendor/soap4r/wsdl/info.rb +51 -0
  75. data/vendor/soap4r/wsdl/message.rb +55 -0
  76. data/vendor/soap4r/wsdl/operation.rb +152 -0
  77. data/vendor/soap4r/wsdl/operation_binding.rb +241 -0
  78. data/vendor/soap4r/wsdl/param.rb +94 -0
  79. data/vendor/soap4r/wsdl/parser.rb +165 -0
  80. data/vendor/soap4r/wsdl/part.rb +53 -0
  81. data/vendor/soap4r/wsdl/port.rb +67 -0
  82. data/vendor/soap4r/wsdl/port_type.rb +76 -0
  83. data/vendor/soap4r/wsdl/service.rb +62 -0
  84. data/vendor/soap4r/wsdl/soap/address.rb +41 -0
  85. data/vendor/soap4r/wsdl/soap/binding.rb +50 -0
  86. data/vendor/soap4r/wsdl/soap/body.rb +59 -0
  87. data/vendor/soap4r/wsdl/soap/cgi_stub_creator.rb +93 -0
  88. data/vendor/soap4r/wsdl/soap/class_def_creator.rb +437 -0
  89. data/vendor/soap4r/wsdl/soap/class_def_creator_support.rb +241 -0
  90. data/vendor/soap4r/wsdl/soap/class_name_creator.rb +55 -0
  91. data/vendor/soap4r/wsdl/soap/client_skelton_creator.rb +107 -0
  92. data/vendor/soap4r/wsdl/soap/complex_type.rb +174 -0
  93. data/vendor/soap4r/wsdl/soap/data.rb +43 -0
  94. data/vendor/soap4r/wsdl/soap/definitions.rb +201 -0
  95. data/vendor/soap4r/wsdl/soap/driver_creator.rb +121 -0
  96. data/vendor/soap4r/wsdl/soap/element.rb +34 -0
  97. data/vendor/soap4r/wsdl/soap/encoded_mapping_registry_creator.rb +74 -0
  98. data/vendor/soap4r/wsdl/soap/fault.rb +57 -0
  99. data/vendor/soap4r/wsdl/soap/header.rb +87 -0
  100. data/vendor/soap4r/wsdl/soap/headerfault.rb +57 -0
  101. data/vendor/soap4r/wsdl/soap/literal_mapping_registry_creator.rb +116 -0
  102. data/vendor/soap4r/wsdl/soap/mapping_registry_creator.rb +59 -0
  103. data/vendor/soap4r/wsdl/soap/mapping_registry_creator_support.rb +377 -0
  104. data/vendor/soap4r/wsdl/soap/method_def_creator.rb +200 -0
  105. data/vendor/soap4r/wsdl/soap/operation.rb +113 -0
  106. data/vendor/soap4r/wsdl/soap/servant_skelton_creator.rb +92 -0
  107. data/vendor/soap4r/wsdl/soap/servlet_stub_creator.rb +105 -0
  108. data/vendor/soap4r/wsdl/soap/standalone_server_stub_creator.rb +101 -0
  109. data/vendor/soap4r/wsdl/soap/wsdl2ruby.rb +226 -0
  110. data/vendor/soap4r/wsdl/types.rb +45 -0
  111. data/vendor/soap4r/wsdl/wsdl.rb +25 -0
  112. data/vendor/soap4r/wsdl/xml_schema/all.rb +25 -0
  113. data/vendor/soap4r/wsdl/xml_schema/annotation.rb +35 -0
  114. data/vendor/soap4r/wsdl/xml_schema/any.rb +62 -0
  115. data/vendor/soap4r/wsdl/xml_schema/any_attribute.rb +49 -0
  116. data/vendor/soap4r/wsdl/xml_schema/attribute.rb +105 -0
  117. data/vendor/soap4r/wsdl/xml_schema/attribute_group.rb +69 -0
  118. data/vendor/soap4r/wsdl/xml_schema/choice.rb +59 -0
  119. data/vendor/soap4r/wsdl/xml_schema/complex_content.rb +98 -0
  120. data/vendor/soap4r/wsdl/xml_schema/complex_extension.rb +120 -0
  121. data/vendor/soap4r/wsdl/xml_schema/complex_restriction.rb +105 -0
  122. data/vendor/soap4r/wsdl/xml_schema/complex_type.rb +194 -0
  123. data/vendor/soap4r/wsdl/xml_schema/content.rb +96 -0
  124. data/vendor/soap4r/wsdl/xml_schema/data.rb +117 -0
  125. data/vendor/soap4r/wsdl/xml_schema/element.rb +154 -0
  126. data/vendor/soap4r/wsdl/xml_schema/enumeration.rb +37 -0
  127. data/vendor/soap4r/wsdl/xml_schema/fractiondigits.rb +38 -0
  128. data/vendor/soap4r/wsdl/xml_schema/group.rb +101 -0
  129. data/vendor/soap4r/wsdl/xml_schema/import.rb +54 -0
  130. data/vendor/soap4r/wsdl/xml_schema/import_handler.rb +46 -0
  131. data/vendor/soap4r/wsdl/xml_schema/importer.rb +103 -0
  132. data/vendor/soap4r/wsdl/xml_schema/include.rb +49 -0
  133. data/vendor/soap4r/wsdl/xml_schema/length.rb +38 -0
  134. data/vendor/soap4r/wsdl/xml_schema/list.rb +49 -0
  135. data/vendor/soap4r/wsdl/xml_schema/maxexclusive.rb +38 -0
  136. data/vendor/soap4r/wsdl/xml_schema/maxinclusive.rb +38 -0
  137. data/vendor/soap4r/wsdl/xml_schema/maxlength.rb +38 -0
  138. data/vendor/soap4r/wsdl/xml_schema/minexclusive.rb +38 -0
  139. data/vendor/soap4r/wsdl/xml_schema/mininclusive.rb +38 -0
  140. data/vendor/soap4r/wsdl/xml_schema/minlength.rb +38 -0
  141. data/vendor/soap4r/wsdl/xml_schema/parser.rb +168 -0
  142. data/vendor/soap4r/wsdl/xml_schema/pattern.rb +37 -0
  143. data/vendor/soap4r/wsdl/xml_schema/ref.rb +34 -0
  144. data/vendor/soap4r/wsdl/xml_schema/schema.rb +179 -0
  145. data/vendor/soap4r/wsdl/xml_schema/sequence.rb +55 -0
  146. data/vendor/soap4r/wsdl/xml_schema/simple_content.rb +70 -0
  147. data/vendor/soap4r/wsdl/xml_schema/simple_extension.rb +63 -0
  148. data/vendor/soap4r/wsdl/xml_schema/simple_restriction.rb +133 -0
  149. data/vendor/soap4r/wsdl/xml_schema/simple_type.rb +88 -0
  150. data/vendor/soap4r/wsdl/xml_schema/totaldigits.rb +38 -0
  151. data/vendor/soap4r/wsdl/xml_schema/union.rb +36 -0
  152. data/vendor/soap4r/wsdl/xml_schema/unique.rb +35 -0
  153. data/vendor/soap4r/wsdl/xml_schema/whitespace.rb +38 -0
  154. data/vendor/soap4r/wsdl/xml_schema/xsd2ruby.rb +176 -0
  155. data/vendor/soap4r/xsd/charset.rb +190 -0
  156. data/vendor/soap4r/xsd/codegen.rb +13 -0
  157. data/vendor/soap4r/xsd/codegen/classdef.rb +209 -0
  158. data/vendor/soap4r/xsd/codegen/commentdef.rb +35 -0
  159. data/vendor/soap4r/xsd/codegen/gensupport.rb +277 -0
  160. data/vendor/soap4r/xsd/codegen/methoddef.rb +71 -0
  161. data/vendor/soap4r/xsd/codegen/moduledef.rb +209 -0
  162. data/vendor/soap4r/xsd/datatypes.rb +1466 -0
  163. data/vendor/soap4r/xsd/datatypes1999.rb +21 -0
  164. data/vendor/soap4r/xsd/iconvcharset.rb +34 -0
  165. data/vendor/soap4r/xsd/mapping.rb +69 -0
  166. data/vendor/soap4r/xsd/namedelements.rb +133 -0
  167. data/vendor/soap4r/xsd/ns.rb +183 -0
  168. data/vendor/soap4r/xsd/qname.rb +80 -0
  169. data/vendor/soap4r/xsd/xmlparser.rb +77 -0
  170. data/vendor/soap4r/xsd/xmlparser/libxmlparser.rb +116 -0
  171. data/vendor/soap4r/xsd/xmlparser/parser.rb +101 -0
  172. data/vendor/soap4r/xsd/xmlparser/rexmlparser.rb +59 -0
  173. data/vendor/soap4r/xsd/xmlparser/xmlparser.rb +51 -0
  174. data/vendor/soap4r/xsd/xmlparser/xmlscanner.rb +150 -0
  175. metadata +316 -0
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/Gemfile ADDED
@@ -0,0 +1,15 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem 'thor'
4
+ gem 'activesupport', '~> 3.1'
5
+ gem 'i18n'
6
+
7
+ # Add dependencies to develop your gem here.
8
+ # Include everything needed to run rake, tests, features, etc.
9
+ group :development do
10
+ gem "rspec", "~> 2.3.0"
11
+ gem "yard", "~> 0.6.0"
12
+ gem "bundler", "~> 1.0.0"
13
+ gem "jeweler", "~> 1.6.4"
14
+ gem "rcov", ">= 0"
15
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,38 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ activesupport (3.1.0)
5
+ multi_json (~> 1.0)
6
+ diff-lcs (1.1.3)
7
+ git (1.2.5)
8
+ i18n (0.6.0)
9
+ jeweler (1.6.4)
10
+ bundler (~> 1.0)
11
+ git (>= 1.2.5)
12
+ rake
13
+ multi_json (1.0.3)
14
+ rake (0.9.2)
15
+ rcov (0.9.10)
16
+ rspec (2.3.0)
17
+ rspec-core (~> 2.3.0)
18
+ rspec-expectations (~> 2.3.0)
19
+ rspec-mocks (~> 2.3.0)
20
+ rspec-core (2.3.1)
21
+ rspec-expectations (2.3.0)
22
+ diff-lcs (~> 1.1.2)
23
+ rspec-mocks (2.3.0)
24
+ thor (0.14.6)
25
+ yard (0.6.8)
26
+
27
+ PLATFORMS
28
+ ruby
29
+
30
+ DEPENDENCIES
31
+ activesupport (~> 3.1)
32
+ bundler (~> 1.0.0)
33
+ i18n
34
+ jeweler (~> 1.6.4)
35
+ rcov
36
+ rspec (~> 2.3.0)
37
+ thor
38
+ yard (~> 0.6.0)
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Anton Sozontov
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,19 @@
1
+ = soybean
2
+
3
+ Description goes here.
4
+
5
+ == Contributing to soybean
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
+ * Fork the project
10
+ * Start a feature/bugfix branch
11
+ * Commit and push until you are happy with your contribution
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2011 Anton Sozontov. See LICENSE.txt for
18
+ further details.
19
+
data/Rakefile ADDED
@@ -0,0 +1,44 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.name = "soybean"
18
+ gem.homepage = "http://github.com/webgago/soybean"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{Generate soap web-services from you wsdl. see README}
21
+ gem.description = %Q{Generate soap web-services from you wsdl. Generate: all classes from xsd, and other.}
22
+ gem.email = "a.sozontov@gmail.com"
23
+ gem.authors = ["Anton Sozontov"]
24
+ gem.executables = ['soybean']
25
+ gem.default_executable = 'soybean'
26
+ # dependencies defined in Gemfile
27
+ end
28
+ Jeweler::RubygemsDotOrgTasks.new
29
+
30
+ require 'rspec/core'
31
+ require 'rspec/core/rake_task'
32
+ RSpec::Core::RakeTask.new(:spec) do |spec|
33
+ spec.pattern = FileList['spec/**/*_spec.rb']
34
+ end
35
+
36
+ RSpec::Core::RakeTask.new(:rcov) do |spec|
37
+ spec.pattern = 'spec/**/*_spec.rb'
38
+ spec.rcov = true
39
+ end
40
+
41
+ task :default => :spec
42
+
43
+ require 'yard'
44
+ YARD::Rake::YardocTask.new
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.0
data/bin/soybean ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env ruby
2
+ $:.unshift File.absolute_path('vendor')
3
+ $:.unshift File.absolute_path('vendor/soap4r')
4
+ $:.unshift File.absolute_path('lib')
5
+ require 'thor'
6
+ require 'thor/actions'
7
+ require 'soybean'
8
+
9
+
10
+ class Soybean::CLI < Thor
11
+ include Thor::Actions
12
+
13
+ desc "classes file_path.xsd", "Generate Ruby classes from XSD"
14
+ method_options :quiet => :boolean, :force => :boolean
15
+
16
+ def classes(location, destination = 'types')
17
+ action Soybean::Actions::GenerateClasses.new(self, location, destination, options)
18
+ end
19
+
20
+ end
21
+
22
+ Soybean::CLI.start
data/bin/xsd2ruby ADDED
@@ -0,0 +1,90 @@
1
+ #!/usr/bin/env ruby
2
+ $:.unshift File.absolute_path('.')
3
+ require 'getoptlong'
4
+ require 'logger'
5
+ require 'vendor/wsdl/xmlSchema/xsd2ruby'
6
+
7
+ class XSD2RubyApp < Logger::Application
8
+ private
9
+
10
+ OptSet = [
11
+ ['--xsd', '-x', GetoptLong::REQUIRED_ARGUMENT],
12
+ ['--module_path', '-m', GetoptLong::REQUIRED_ARGUMENT],
13
+ ['--classdef', '-e', GetoptLong::OPTIONAL_ARGUMENT],
14
+ ['--mapping_registry', '-r', GetoptLong::NO_ARGUMENT],
15
+ ['--mapper', '-p', GetoptLong::NO_ARGUMENT],
16
+ ['--force', '-f', GetoptLong::NO_ARGUMENT],
17
+ ['--quiet', '-q', GetoptLong::NO_ARGUMENT],
18
+ ]
19
+
20
+ def initialize
21
+ super('app')
22
+ STDERR.sync = true
23
+ WSDL::SOAP::ClassNameCreator
24
+ self.level = Logger::FATAL
25
+ end
26
+
27
+ def run
28
+ @worker = WSDL::XMLSchema::XSD2Ruby.new
29
+ @worker.logger = @log
30
+ location, opt = parse_opt(GetoptLong.new(*OptSet))
31
+ usage_exit unless location
32
+ @worker.location = location
33
+ if opt['quiet']
34
+ self.level = Logger::FATAL
35
+ else
36
+ self.level = Logger::INFO
37
+ end
38
+ @worker.opt.update(opt)
39
+ @worker.run
40
+ 0
41
+ end
42
+
43
+ def usage_exit
44
+ puts <<__EOU__
45
+ Usage: #{ $0 } --xsd xsd_location [options]
46
+ xsd_location: filename or URL
47
+
48
+ Example:
49
+ #{ $0 } --xsd myapp.xsd --classdef foo
50
+
51
+ Options:
52
+ --xsd xsd_location
53
+ --classdef [filenameprefix]
54
+ --mapping_registry
55
+ --mapper
56
+ --module_path [Module::Path::Name]
57
+ --force
58
+ --quiet
59
+ __EOU__
60
+ exit 1
61
+ end
62
+
63
+ def parse_opt(getoptlong)
64
+ opt = {}
65
+ xsd = nil
66
+ begin
67
+ getoptlong.each do |name, arg|
68
+ case name
69
+ when "--xsd"
70
+ xsd = arg
71
+ when "--module_path"
72
+ opt['module_path'] = arg
73
+ when "--classdef", "--mapping_registry", "--mapper"
74
+ opt[name.sub(/^--/, '')] = arg.empty? ? nil : arg
75
+ when "--force"
76
+ opt['force'] = true
77
+ when "--quiet"
78
+ opt['quiet'] = true
79
+ else
80
+ raise ArgumentError.new("Unknown type #{ arg }")
81
+ end
82
+ end
83
+ rescue
84
+ usage_exit
85
+ end
86
+ return xsd, opt
87
+ end
88
+ end
89
+
90
+ XSD2RubyApp.new.start
data/lib/soybean.rb ADDED
@@ -0,0 +1,11 @@
1
+ require 'active_support/deprecation'
2
+ require 'active_support/dependencies'
3
+ ActiveSupport::Dependencies.autoload_paths << File.absolute_path(File.join(File.dirname(__FILE__), '..', 'vendor/soap4r'))
4
+ ActiveSupport::Dependencies.autoload_paths << File.absolute_path(File.join(File.dirname(__FILE__), '..', 'lib'))
5
+
6
+ module Soybean
7
+ # Thor actions
8
+ module Actions
9
+ autoload :GenerateClasses, 'soybean/actions/generate_classes'
10
+ end
11
+ end
@@ -0,0 +1,33 @@
1
+ require 'active_support/core_ext/string/inflections'
2
+
3
+ module Soybean
4
+ module Actions
5
+
6
+ class GenerateClasses < Thor::Actions::CreateFile
7
+
8
+ # @param base [Thor::Base] A Thor::Base instance
9
+ # @param location [String|Pathname] Path to xsd file
10
+ # @param destination [String|Pathname] Path to generated file with ruby classes
11
+ # @param config [Hash] config
12
+ # @option config [Boolean] :force Override destination file
13
+ # @option config [Boolean] :verbose Be verbosely
14
+ def initialize(base, location, destination, config={})
15
+ @location = location
16
+ super(base, "#{destination}.rb", class_definitions, config)
17
+ end
18
+
19
+ protected
20
+
21
+ # @return [WSDL::SOAP::ClassDefCreator] Generate ruby classes from xsd
22
+ def class_definitions
23
+ @definitions ||= WSDL::SOAP::ClassDefCreator.new(xsd, WSDL::SOAP::ClassNameCreator.new).dump
24
+ end
25
+
26
+ # @return [WSDL::XMLSchema::Importer] Parse xsd
27
+ def xsd
28
+ @xsd ||= WSDL::XMLSchema::Importer.import(@location)
29
+ end
30
+
31
+ end
32
+ end
33
+ end
data/soybean.gemspec ADDED
@@ -0,0 +1,236 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{soybean}
8
+ s.version = "1.0.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Anton Sozontov"]
12
+ s.date = %q{2011-09-27}
13
+ s.default_executable = %q{soybean}
14
+ s.description = %q{Generate soap web-services from you wsdl. Generate: all classes from xsd, and other.}
15
+ s.email = %q{a.sozontov@gmail.com}
16
+ s.executables = ["soybean"]
17
+ s.extra_rdoc_files = [
18
+ "LICENSE.txt",
19
+ "README.rdoc"
20
+ ]
21
+ s.files = [
22
+ ".document",
23
+ ".rspec",
24
+ "Gemfile",
25
+ "Gemfile.lock",
26
+ "LICENSE.txt",
27
+ "README.rdoc",
28
+ "Rakefile",
29
+ "VERSION",
30
+ "bin/soybean",
31
+ "bin/xsd2ruby",
32
+ "lib/soybean.rb",
33
+ "lib/soybean/actions/generate_classes.rb",
34
+ "soybean.gemspec",
35
+ "spec/soybean_spec.rb",
36
+ "spec/spec_helper.rb",
37
+ "vendor/soap4r/soap/attachment.rb",
38
+ "vendor/soap4r/soap/attrproxy.rb",
39
+ "vendor/soap4r/soap/base_data.rb",
40
+ "vendor/soap4r/soap/element.rb",
41
+ "vendor/soap4r/soap/encodingstyle/asp_dot_net_handler.rb",
42
+ "vendor/soap4r/soap/encodingstyle/handler.rb",
43
+ "vendor/soap4r/soap/encodingstyle/literal_handler.rb",
44
+ "vendor/soap4r/soap/encodingstyle/soap_handler.rb",
45
+ "vendor/soap4r/soap/filter.rb",
46
+ "vendor/soap4r/soap/filter/filterchain.rb",
47
+ "vendor/soap4r/soap/filter/handler.rb",
48
+ "vendor/soap4r/soap/filter/streamhandler.rb",
49
+ "vendor/soap4r/soap/generator.rb",
50
+ "vendor/soap4r/soap/header/handler.rb",
51
+ "vendor/soap4r/soap/header/handlerset.rb",
52
+ "vendor/soap4r/soap/header/mappinghandler.rb",
53
+ "vendor/soap4r/soap/header/simplehandler.rb",
54
+ "vendor/soap4r/soap/httpconfigloader.rb",
55
+ "vendor/soap4r/soap/mapping.rb",
56
+ "vendor/soap4r/soap/mapping/encodedregistry.rb",
57
+ "vendor/soap4r/soap/mapping/factory.rb",
58
+ "vendor/soap4r/soap/mapping/literalregistry.rb",
59
+ "vendor/soap4r/soap/mapping/mapping.rb",
60
+ "vendor/soap4r/soap/mapping/registry.rb",
61
+ "vendor/soap4r/soap/mapping/rubytype_factory.rb",
62
+ "vendor/soap4r/soap/mapping/schemadefinition.rb",
63
+ "vendor/soap4r/soap/mapping/type_map.rb",
64
+ "vendor/soap4r/soap/mapping/wsdlencodedregistry.rb",
65
+ "vendor/soap4r/soap/mapping/wsdlliteralregistry.rb",
66
+ "vendor/soap4r/soap/marshal.rb",
67
+ "vendor/soap4r/soap/mimemessage.rb",
68
+ "vendor/soap4r/soap/nestedexception.rb",
69
+ "vendor/soap4r/soap/net_http_client.rb",
70
+ "vendor/soap4r/soap/ns.rb",
71
+ "vendor/soap4r/soap/parser.rb",
72
+ "vendor/soap4r/soap/processor.rb",
73
+ "vendor/soap4r/soap/property.rb",
74
+ "vendor/soap4r/soap/proxy.rb",
75
+ "vendor/soap4r/soap/rpc/cgistub.rb",
76
+ "vendor/soap4r/soap/rpc/driver.rb",
77
+ "vendor/soap4r/soap/rpc/element.rb",
78
+ "vendor/soap4r/soap/rpc/httpserver.rb",
79
+ "vendor/soap4r/soap/rpc/method_def.rb",
80
+ "vendor/soap4r/soap/rpc/proxy.rb",
81
+ "vendor/soap4r/soap/rpc/router.rb",
82
+ "vendor/soap4r/soap/rpc/rpc.rb",
83
+ "vendor/soap4r/soap/rpc/soaplet.rb",
84
+ "vendor/soap4r/soap/rpc/standalone_server.rb",
85
+ "vendor/soap4r/soap/soap.rb",
86
+ "vendor/soap4r/soap/stream_handler.rb",
87
+ "vendor/soap4r/soap/version.rb",
88
+ "vendor/soap4r/soap/wsdl_driver.rb",
89
+ "vendor/soap4r/wsdl/binding.rb",
90
+ "vendor/soap4r/wsdl/data.rb",
91
+ "vendor/soap4r/wsdl/definitions.rb",
92
+ "vendor/soap4r/wsdl/documentation.rb",
93
+ "vendor/soap4r/wsdl/import.rb",
94
+ "vendor/soap4r/wsdl/importer.rb",
95
+ "vendor/soap4r/wsdl/info.rb",
96
+ "vendor/soap4r/wsdl/message.rb",
97
+ "vendor/soap4r/wsdl/operation.rb",
98
+ "vendor/soap4r/wsdl/operation_binding.rb",
99
+ "vendor/soap4r/wsdl/param.rb",
100
+ "vendor/soap4r/wsdl/parser.rb",
101
+ "vendor/soap4r/wsdl/part.rb",
102
+ "vendor/soap4r/wsdl/port.rb",
103
+ "vendor/soap4r/wsdl/port_type.rb",
104
+ "vendor/soap4r/wsdl/service.rb",
105
+ "vendor/soap4r/wsdl/soap/address.rb",
106
+ "vendor/soap4r/wsdl/soap/binding.rb",
107
+ "vendor/soap4r/wsdl/soap/body.rb",
108
+ "vendor/soap4r/wsdl/soap/cgi_stub_creator.rb",
109
+ "vendor/soap4r/wsdl/soap/class_def_creator.rb",
110
+ "vendor/soap4r/wsdl/soap/class_def_creator_support.rb",
111
+ "vendor/soap4r/wsdl/soap/class_name_creator.rb",
112
+ "vendor/soap4r/wsdl/soap/client_skelton_creator.rb",
113
+ "vendor/soap4r/wsdl/soap/complex_type.rb",
114
+ "vendor/soap4r/wsdl/soap/data.rb",
115
+ "vendor/soap4r/wsdl/soap/definitions.rb",
116
+ "vendor/soap4r/wsdl/soap/driver_creator.rb",
117
+ "vendor/soap4r/wsdl/soap/element.rb",
118
+ "vendor/soap4r/wsdl/soap/encoded_mapping_registry_creator.rb",
119
+ "vendor/soap4r/wsdl/soap/fault.rb",
120
+ "vendor/soap4r/wsdl/soap/header.rb",
121
+ "vendor/soap4r/wsdl/soap/headerfault.rb",
122
+ "vendor/soap4r/wsdl/soap/literal_mapping_registry_creator.rb",
123
+ "vendor/soap4r/wsdl/soap/mapping_registry_creator.rb",
124
+ "vendor/soap4r/wsdl/soap/mapping_registry_creator_support.rb",
125
+ "vendor/soap4r/wsdl/soap/method_def_creator.rb",
126
+ "vendor/soap4r/wsdl/soap/operation.rb",
127
+ "vendor/soap4r/wsdl/soap/servant_skelton_creator.rb",
128
+ "vendor/soap4r/wsdl/soap/servlet_stub_creator.rb",
129
+ "vendor/soap4r/wsdl/soap/standalone_server_stub_creator.rb",
130
+ "vendor/soap4r/wsdl/soap/wsdl2ruby.rb",
131
+ "vendor/soap4r/wsdl/types.rb",
132
+ "vendor/soap4r/wsdl/wsdl.rb",
133
+ "vendor/soap4r/wsdl/xml_schema/all.rb",
134
+ "vendor/soap4r/wsdl/xml_schema/annotation.rb",
135
+ "vendor/soap4r/wsdl/xml_schema/any.rb",
136
+ "vendor/soap4r/wsdl/xml_schema/any_attribute.rb",
137
+ "vendor/soap4r/wsdl/xml_schema/attribute.rb",
138
+ "vendor/soap4r/wsdl/xml_schema/attribute_group.rb",
139
+ "vendor/soap4r/wsdl/xml_schema/choice.rb",
140
+ "vendor/soap4r/wsdl/xml_schema/complex_content.rb",
141
+ "vendor/soap4r/wsdl/xml_schema/complex_extension.rb",
142
+ "vendor/soap4r/wsdl/xml_schema/complex_restriction.rb",
143
+ "vendor/soap4r/wsdl/xml_schema/complex_type.rb",
144
+ "vendor/soap4r/wsdl/xml_schema/content.rb",
145
+ "vendor/soap4r/wsdl/xml_schema/data.rb",
146
+ "vendor/soap4r/wsdl/xml_schema/element.rb",
147
+ "vendor/soap4r/wsdl/xml_schema/enumeration.rb",
148
+ "vendor/soap4r/wsdl/xml_schema/fractiondigits.rb",
149
+ "vendor/soap4r/wsdl/xml_schema/group.rb",
150
+ "vendor/soap4r/wsdl/xml_schema/import.rb",
151
+ "vendor/soap4r/wsdl/xml_schema/import_handler.rb",
152
+ "vendor/soap4r/wsdl/xml_schema/importer.rb",
153
+ "vendor/soap4r/wsdl/xml_schema/include.rb",
154
+ "vendor/soap4r/wsdl/xml_schema/length.rb",
155
+ "vendor/soap4r/wsdl/xml_schema/list.rb",
156
+ "vendor/soap4r/wsdl/xml_schema/maxexclusive.rb",
157
+ "vendor/soap4r/wsdl/xml_schema/maxinclusive.rb",
158
+ "vendor/soap4r/wsdl/xml_schema/maxlength.rb",
159
+ "vendor/soap4r/wsdl/xml_schema/minexclusive.rb",
160
+ "vendor/soap4r/wsdl/xml_schema/mininclusive.rb",
161
+ "vendor/soap4r/wsdl/xml_schema/minlength.rb",
162
+ "vendor/soap4r/wsdl/xml_schema/parser.rb",
163
+ "vendor/soap4r/wsdl/xml_schema/pattern.rb",
164
+ "vendor/soap4r/wsdl/xml_schema/ref.rb",
165
+ "vendor/soap4r/wsdl/xml_schema/schema.rb",
166
+ "vendor/soap4r/wsdl/xml_schema/sequence.rb",
167
+ "vendor/soap4r/wsdl/xml_schema/simple_content.rb",
168
+ "vendor/soap4r/wsdl/xml_schema/simple_extension.rb",
169
+ "vendor/soap4r/wsdl/xml_schema/simple_restriction.rb",
170
+ "vendor/soap4r/wsdl/xml_schema/simple_type.rb",
171
+ "vendor/soap4r/wsdl/xml_schema/totaldigits.rb",
172
+ "vendor/soap4r/wsdl/xml_schema/union.rb",
173
+ "vendor/soap4r/wsdl/xml_schema/unique.rb",
174
+ "vendor/soap4r/wsdl/xml_schema/whitespace.rb",
175
+ "vendor/soap4r/wsdl/xml_schema/xsd2ruby.rb",
176
+ "vendor/soap4r/xsd/charset.rb",
177
+ "vendor/soap4r/xsd/codegen.rb",
178
+ "vendor/soap4r/xsd/codegen/classdef.rb",
179
+ "vendor/soap4r/xsd/codegen/commentdef.rb",
180
+ "vendor/soap4r/xsd/codegen/gensupport.rb",
181
+ "vendor/soap4r/xsd/codegen/methoddef.rb",
182
+ "vendor/soap4r/xsd/codegen/moduledef.rb",
183
+ "vendor/soap4r/xsd/datatypes.rb",
184
+ "vendor/soap4r/xsd/datatypes1999.rb",
185
+ "vendor/soap4r/xsd/iconvcharset.rb",
186
+ "vendor/soap4r/xsd/mapping.rb",
187
+ "vendor/soap4r/xsd/namedelements.rb",
188
+ "vendor/soap4r/xsd/ns.rb",
189
+ "vendor/soap4r/xsd/qname.rb",
190
+ "vendor/soap4r/xsd/xmlparser.rb",
191
+ "vendor/soap4r/xsd/xmlparser/libxmlparser.rb",
192
+ "vendor/soap4r/xsd/xmlparser/parser.rb",
193
+ "vendor/soap4r/xsd/xmlparser/rexmlparser.rb",
194
+ "vendor/soap4r/xsd/xmlparser/xmlparser.rb",
195
+ "vendor/soap4r/xsd/xmlparser/xmlscanner.rb"
196
+ ]
197
+ s.homepage = %q{http://github.com/webgago/soybean}
198
+ s.licenses = ["MIT"]
199
+ s.require_paths = ["lib"]
200
+ s.rubygems_version = %q{1.6.2}
201
+ s.summary = %q{Generate soap web-services from you wsdl. see README}
202
+
203
+ if s.respond_to? :specification_version then
204
+ s.specification_version = 3
205
+
206
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
207
+ s.add_runtime_dependency(%q<thor>, [">= 0"])
208
+ s.add_runtime_dependency(%q<activesupport>, ["~> 3.1"])
209
+ s.add_runtime_dependency(%q<i18n>, [">= 0"])
210
+ s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
211
+ s.add_development_dependency(%q<yard>, ["~> 0.6.0"])
212
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
213
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
214
+ s.add_development_dependency(%q<rcov>, [">= 0"])
215
+ else
216
+ s.add_dependency(%q<thor>, [">= 0"])
217
+ s.add_dependency(%q<activesupport>, ["~> 3.1"])
218
+ s.add_dependency(%q<i18n>, [">= 0"])
219
+ s.add_dependency(%q<rspec>, ["~> 2.3.0"])
220
+ s.add_dependency(%q<yard>, ["~> 0.6.0"])
221
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
222
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
223
+ s.add_dependency(%q<rcov>, [">= 0"])
224
+ end
225
+ else
226
+ s.add_dependency(%q<thor>, [">= 0"])
227
+ s.add_dependency(%q<activesupport>, ["~> 3.1"])
228
+ s.add_dependency(%q<i18n>, [">= 0"])
229
+ s.add_dependency(%q<rspec>, ["~> 2.3.0"])
230
+ s.add_dependency(%q<yard>, ["~> 0.6.0"])
231
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
232
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
233
+ s.add_dependency(%q<rcov>, [">= 0"])
234
+ end
235
+ end
236
+