Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: publify/publify
base: master
...
head fork: edebill/typo
compare: master
Checking mergeability… Don’t worry, you can still create the pull request.
  • 17 commits
  • 278 files changed
  • 0 commit comments
  • 1 contributor
Showing with 27,262 additions and 108 deletions.
  1. +6 −0 README.textile
  2. +1 −0  app/controllers/admin/pages_controller.rb
  3. +4 −0 app/controllers/application_controller.rb
  4. +1 −0  app/models/article.rb
  5. +5 −1 config/environment.rb
  6. +1 −0  config/locales/nl.rb
  7. +1 −0  lang/da_DK.rb
  8. +1 −0  lang/de_DE.rb
  9. +1 −0  lang/es_MX.rb
  10. +1 −0  lang/fr_FR.rb
  11. +1 −0  lang/he_IL.rb
  12. +1 −0  lang/it_IT.rb
  13. +1 −0  lang/ja_JP.rb
  14. +1 −0  lang/lt_LT.rb
  15. +1 −0  lang/nl_NL.rb
  16. +1 −0  lang/pl_PL.rb
  17. +1 −0  lang/ro_RO.rb
  18. +1 −0  lang/zh_TW.rb
  19. +2 −2 lib/rails_patch/active_record.rb
  20. +107 −0 lib/soap/attachment.rb
  21. +942 −0 lib/soap/baseData.rb
  22. +258 −0 lib/soap/element.rb
  23. +213 −0 lib/soap/encodingstyle/aspDotNetHandler.rb
  24. +100 −0 lib/soap/encodingstyle/handler.rb
  25. +226 −0 lib/soap/encodingstyle/literalHandler.rb
  26. +582 −0 lib/soap/encodingstyle/soapHandler.rb
  27. +268 −0 lib/soap/generator.rb
  28. +57 −0 lib/soap/header/handler.rb
  29. +70 −0 lib/soap/header/handlerset.rb
  30. +44 −0 lib/soap/header/simplehandler.rb
  31. +119 −0 lib/soap/httpconfigloader.rb
  32. +10 −0 lib/soap/mapping.rb
  33. +355 −0 lib/soap/mapping/factory.rb
  34. +381 −0 lib/soap/mapping/mapping.rb
  35. +541 −0 lib/soap/mapping/registry.rb
  36. +475 −0 lib/soap/mapping/rubytypeFactory.rb
  37. +50 −0 lib/soap/mapping/typeMap.rb
  38. +280 −0 lib/soap/mapping/wsdlencodedregistry.rb
  39. +418 −0 lib/soap/mapping/wsdlliteralregistry.rb
  40. +59 −0 lib/soap/marshal.rb
  41. +240 −0 lib/soap/mimemessage.rb
  42. +190 −0 lib/soap/netHttpClient.rb
  43. +251 −0 lib/soap/parser.rb
  44. +66 −0 lib/soap/processor.rb
  45. +333 −0 lib/soap/property.rb
  46. +206 −0 lib/soap/rpc/cgistub.rb
  47. +254 −0 lib/soap/rpc/driver.rb
  48. +325 −0 lib/soap/rpc/element.rb
  49. +129 −0 lib/soap/rpc/httpserver.rb
  50. +497 −0 lib/soap/rpc/proxy.rb
  51. +594 −0 lib/soap/rpc/router.rb
  52. +25 −0 lib/soap/rpc/rpc.rb
  53. +162 −0 lib/soap/rpc/soaplet.rb
  54. +43 −0 lib/soap/rpc/standaloneServer.rb
  55. +140 −0 lib/soap/soap.rb
  56. +229 −0 lib/soap/streamHandler.rb
  57. +575 −0 lib/soap/wsdlDriver.rb
  58. +2 −2 lib/spam_protection.rb
  59. +1 −0  lib/tasks/release.rake
  60. +24 −47 lib/tasks/rspec.rake
  61. +1 −1  lib/typo_guid.rb
  62. +65 −0 lib/wsdl/binding.rb
  63. +64 −0 lib/wsdl/data.rb
  64. +250 −0 lib/wsdl/definitions.rb
  65. +32 −0 lib/wsdl/documentation.rb
  66. +80 −0 lib/wsdl/import.rb
  67. +38 −0 lib/wsdl/importer.rb
  68. +39 −0 lib/wsdl/info.rb
  69. +54 −0 lib/wsdl/message.rb
  70. +130 −0 lib/wsdl/operation.rb
  71. +108 −0 lib/wsdl/operationBinding.rb
  72. +85 −0 lib/wsdl/param.rb
  73. +163 −0 lib/wsdl/parser.rb
  74. +52 −0 lib/wsdl/part.rb
  75. +84 −0 lib/wsdl/port.rb
  76. +73 −0 lib/wsdl/portType.rb
  77. +61 −0 lib/wsdl/service.rb
  78. +40 −0 lib/wsdl/soap/address.rb
  79. +49 −0 lib/wsdl/soap/binding.rb
  80. +56 −0 lib/wsdl/soap/body.rb
  81. +76 −0 lib/wsdl/soap/cgiStubCreator.rb
  82. +314 −0 lib/wsdl/soap/classDefCreator.rb
  83. +126 −0 lib/wsdl/soap/classDefCreatorSupport.rb
  84. +78 −0 lib/wsdl/soap/clientSkeltonCreator.rb
  85. +161 −0 lib/wsdl/soap/complexType.rb
  86. +42 −0 lib/wsdl/soap/data.rb
  87. +149 −0 lib/wsdl/soap/definitions.rb
  88. +95 −0 lib/wsdl/soap/driverCreator.rb
  89. +28 −0 lib/wsdl/soap/element.rb
  90. +56 −0 lib/wsdl/soap/fault.rb
  91. +86 −0 lib/wsdl/soap/header.rb
  92. +56 −0 lib/wsdl/soap/headerfault.rb
  93. +92 −0 lib/wsdl/soap/mappingRegistryCreator.rb
  94. +228 −0 lib/wsdl/soap/methodDefCreator.rb
  95. +122 −0 lib/wsdl/soap/operation.rb
  96. +67 −0 lib/wsdl/soap/servantSkeltonCreator.rb
  97. +85 −0 lib/wsdl/soap/standaloneServerStubCreator.rb
  98. +176 −0 lib/wsdl/soap/wsdl2ruby.rb
  99. +43 −0 lib/wsdl/types.rb
  100. +23 −0 lib/wsdl/wsdl.rb
  101. +69 −0 lib/wsdl/xmlSchema/all.rb
  102. +34 −0 lib/wsdl/xmlSchema/annotation.rb
  103. +56 −0 lib/wsdl/xmlSchema/any.rb
  104. +127 −0 lib/wsdl/xmlSchema/attribute.rb
  105. +69 −0 lib/wsdl/xmlSchema/choice.rb
  106. +92 −0 lib/wsdl/xmlSchema/complexContent.rb
  107. +139 −0 lib/wsdl/xmlSchema/complexType.rb
  108. +96 −0 lib/wsdl/xmlSchema/content.rb
  109. +80 −0 lib/wsdl/xmlSchema/data.rb
  110. +154 −0 lib/wsdl/xmlSchema/element.rb
  111. +36 −0 lib/wsdl/xmlSchema/enumeration.rb
  112. +65 −0 lib/wsdl/xmlSchema/import.rb
  113. +87 −0 lib/wsdl/xmlSchema/importer.rb
  114. +54 −0 lib/wsdl/xmlSchema/include.rb
  115. +35 −0 lib/wsdl/xmlSchema/length.rb
  116. +166 −0 lib/wsdl/xmlSchema/parser.rb
  117. +36 −0 lib/wsdl/xmlSchema/pattern.rb
  118. +143 −0 lib/wsdl/xmlSchema/schema.rb
  119. +69 −0 lib/wsdl/xmlSchema/sequence.rb
  120. +65 −0 lib/wsdl/xmlSchema/simpleContent.rb
  121. +54 −0 lib/wsdl/xmlSchema/simpleExtension.rb
  122. +73 −0 lib/wsdl/xmlSchema/simpleRestriction.rb
  123. +73 −0 lib/wsdl/xmlSchema/simpleType.rb
  124. +34 −0 lib/wsdl/xmlSchema/unique.rb
  125. +107 −0 lib/wsdl/xmlSchema/xsd2ruby.rb
  126. +187 −0 lib/xsd/charset.rb
  127. +12 −0 lib/xsd/codegen.rb
  128. +203 −0 lib/xsd/codegen/classdef.rb
  129. +34 −0 lib/xsd/codegen/commentdef.rb
  130. +166 −0 lib/xsd/codegen/gensupport.rb
  131. +63 −0 lib/xsd/codegen/methoddef.rb
  132. +191 −0 lib/xsd/codegen/moduledef.rb
  133. +1,269 −0 lib/xsd/datatypes.rb
  134. +20 −0 lib/xsd/datatypes1999.rb
  135. +33 −0 lib/xsd/iconvcharset.rb
  136. +42 −0 lib/xsd/mapping.rb
  137. +95 −0 lib/xsd/namedelements.rb
  138. +140 −0 lib/xsd/ns.rb
  139. +78 −0 lib/xsd/qname.rb
  140. +61 −0 lib/xsd/xmlparser.rb
  141. +96 −0 lib/xsd/xmlparser/parser.rb
  142. +54 −0 lib/xsd/xmlparser/rexmlparser.rb
  143. +50 −0 lib/xsd/xmlparser/xmlparser.rb
  144. +147 −0 lib/xsd/xmlparser/xmlscanner.rb
  145. +1 −1  spec/controllers/accounts_controller_spec.rb
  146. +1 −1  spec/controllers/admin/categories_controller_spec.rb
  147. +1 −1  spec/controllers/admin/dashboard_controller_spec.rb
  148. +1 −1  spec/controllers/admin/feedback_controller_spec.rb
  149. +1 −1  spec/controllers/admin/pages_controller_spec.rb
  150. +1 −1  spec/controllers/admin/profiles_controller_spec.rb
  151. +1 −1  spec/controllers/admin/resources_controller_spec.rb
  152. +1 −1  spec/controllers/admin/settings_controller_spec.rb
  153. +1 −1  spec/controllers/admin/textfilters_controller_spec.rb
  154. +1 −1  spec/controllers/admin/themes_controller_spec.rb
  155. +1 −1  spec/controllers/admin/users_controller_spec.rb
  156. +1 −1  spec/controllers/application_controller_spec.rb
  157. +3 −2 spec/controllers/articles_controller_spec.rb
  158. +1 −1  spec/controllers/authors_controller_spec.rb
  159. +1 −1  spec/controllers/backend_controller_spec.rb
  160. +1 −1  spec/controllers/categories_controller_spec.rb
  161. +1 −1  spec/controllers/comments_controller_spec.rb
  162. +2 −2 spec/controllers/setup_controller_spec.rb
  163. +1 −1  spec/controllers/tags_controller_spec.rb
  164. +1 −1  spec/controllers/textfilter_controller_spec.rb
  165. +1 −1  spec/controllers/theme_controller_spec.rb
  166. +1 −1  spec/controllers/xml_controller_spec.rb
  167. +1 −1  spec/helpers/author_helper_spec.rb
  168. +1 −1  spec/helpers/content_helper_spec.rb
  169. +1 −1  spec/lib/text_filter_plugin_spec.rb
  170. +1 −1  spec/models/amazon_sidebar_spec.rb
  171. +1 −1  spec/models/article_closing_spec.rb
  172. +2 −1  spec/models/article_spec.rb
  173. +1 −1  spec/models/blog_spec.rb
  174. +1 −1  spec/models/cache_support_spec.rb
  175. +1 −1  spec/models/category_spec.rb
  176. +1 −1  spec/models/comment_spec.rb
  177. +1 −1  spec/models/configuration_spec.rb
  178. +1 −1  spec/models/content_state/feedback_states_spec.rb
  179. +1 −1  spec/models/notification_spec.rb
  180. +1 −1  spec/models/page_cache_spec.rb
  181. +1 −1  spec/models/page_spec.rb
  182. +1 −1  spec/models/ping_pinger_spec.rb
  183. +1 −1  spec/models/ping_spec.rb
  184. +1 −1  spec/models/redirect_spec.rb
  185. +1 −1  spec/models/resource_spec.rb
  186. +1 −1  spec/models/route_cache_spec.rb
  187. +1 −1  spec/models/sidebar_spec.rb
  188. +1 −1  spec/models/static_sidebar_spec.rb
  189. +1 −1  spec/models/tag_spec.rb
  190. +1 −1  spec/models/text_filter_spec.rb
  191. +1 −1  spec/models/theme_spec.rb
  192. +1 −1  spec/models/trackback_spec.rb
  193. +1 −1  spec/models/trigger_spec.rb
  194. +1 −1  spec/models/user_spec.rb
  195. +1 −0  spec/spec_helper.rb
  196. +1 −1  spec/views/articles/index_spec.rb
  197. +1 −1  spec/views/articles/read_spec.rb
  198. +1 −1  spec/views/comments/html_sanitization_spec.rb
  199. +171 −0 vendor/gems/fdv-actionwebservice-2.3.8/.specification
  200. +320 −0 vendor/gems/fdv-actionwebservice-2.3.8/CHANGELOG
  201. +21 −0 vendor/gems/fdv-actionwebservice-2.3.8/MIT-LICENSE
  202. +381 −0 vendor/gems/fdv-actionwebservice-2.3.8/README
  203. +180 −0 vendor/gems/fdv-actionwebservice-2.3.8/Rakefile
  204. +32 −0 vendor/gems/fdv-actionwebservice-2.3.8/TODO
  205. +143 −0 vendor/gems/fdv-actionwebservice-2.3.8/examples/googlesearch/README
  206. +50 −0 vendor/gems/fdv-actionwebservice-2.3.8/examples/googlesearch/autoloading/google_search_api.rb
  207. +57 −0 vendor/gems/fdv-actionwebservice-2.3.8/examples/googlesearch/autoloading/google_search_controller.rb
  208. +108 −0 vendor/gems/fdv-actionwebservice-2.3.8/examples/googlesearch/delegated/google_search_service.rb
  209. +7 −0 vendor/gems/fdv-actionwebservice-2.3.8/examples/googlesearch/delegated/search_controller.rb
  210. +50 −0 vendor/gems/fdv-actionwebservice-2.3.8/examples/googlesearch/direct/google_search_api.rb
  211. +58 −0 vendor/gems/fdv-actionwebservice-2.3.8/examples/googlesearch/direct/search_controller.rb
  212. +17 −0 vendor/gems/fdv-actionwebservice-2.3.8/examples/metaWeblog/README
  213. +60 −0 vendor/gems/fdv-actionwebservice-2.3.8/examples/metaWeblog/apis/blogger_api.rb
  214. +34 −0 vendor/gems/fdv-actionwebservice-2.3.8/examples/metaWeblog/apis/blogger_service.rb
  215. +67 −0 vendor/gems/fdv-actionwebservice-2.3.8/examples/metaWeblog/apis/meta_weblog_api.rb
  216. +48 −0 vendor/gems/fdv-actionwebservice-2.3.8/examples/metaWeblog/apis/meta_weblog_service.rb
  217. +16 −0 vendor/gems/fdv-actionwebservice-2.3.8/examples/metaWeblog/controllers/xmlrpc_controller.rb
  218. +28 −0 vendor/gems/fdv-actionwebservice-2.3.8/generators/web_service/USAGE
  219. +5 −0 vendor/gems/fdv-actionwebservice-2.3.8/generators/web_service/templates/api_definition.rb
  220. +8 −0 vendor/gems/fdv-actionwebservice-2.3.8/generators/web_service/templates/controller.rb
  221. +19 −0 vendor/gems/fdv-actionwebservice-2.3.8/generators/web_service/templates/functional_test.rb
  222. +29 −0 vendor/gems/fdv-actionwebservice-2.3.8/generators/web_service/web_service_generator.rb
  223. +66 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service.rb
  224. +297 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/api.rb
  225. +38 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/base.rb
  226. +149 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/casting.rb
  227. +3 −0  vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/client.rb
  228. +28 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/client/base.rb
  229. +113 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/client/soap_client.rb
  230. +58 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/client/xmlrpc_client.rb
  231. +3 −0  vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/container.rb
  232. +99 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/container/action_controller_container.rb
  233. +86 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/container/delegated_container.rb
  234. +69 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/container/direct_container.rb
  235. +2 −0  vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/dispatcher.rb
  236. +207 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/dispatcher/abstract.rb
  237. +379 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/dispatcher/action_controller_dispatcher.rb
  238. +202 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/invocation.rb
  239. +4 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/protocol.rb
  240. +112 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/protocol/abstract.rb
  241. +37 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/protocol/discovery.rb
  242. +176 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/protocol/soap_protocol.rb
  243. +242 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/protocol/soap_protocol/marshaler.rb
  244. +122 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/protocol/xmlrpc_protocol.rb
  245. +281 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/scaffolding.rb
  246. +64 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/struct.rb
  247. +26 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/support/class_inheritable_options.rb
  248. +227 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/support/signature_types.rb
  249. +65 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/templates/scaffolds/layout.html.erb
  250. +6 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/templates/scaffolds/methods.html.erb
  251. +29 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/templates/scaffolds/parameters.html.erb
  252. +30 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/templates/scaffolds/result.html.erb
  253. +110 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/test_invoke.rb
  254. +9 −0 vendor/gems/fdv-actionwebservice-2.3.8/lib/action_web_service/version.rb
  255. +1 −0  vendor/gems/fdv-actionwebservice-2.3.8/lib/actionwebservice.rb
  256. +1,379 −0 vendor/gems/fdv-actionwebservice-2.3.8/setup.rb
  257. +183 −0 vendor/gems/fdv-actionwebservice-2.3.8/test/abstract_client.rb
  258. +548 −0 vendor/gems/fdv-actionwebservice-2.3.8/test/abstract_dispatcher.rb
  259. +43 −0 vendor/gems/fdv-actionwebservice-2.3.8/test/abstract_unit.rb
  260. +102 −0 vendor/gems/fdv-actionwebservice-2.3.8/test/api_test.rb
  261. +3 −0  vendor/gems/fdv-actionwebservice-2.3.8/test/apis/auto_load_api.rb
  262. +2 −0  vendor/gems/fdv-actionwebservice-2.3.8/test/apis/broken_auto_load_api.rb
  263. +42 −0 vendor/gems/fdv-actionwebservice-2.3.8/test/base_test.rb
  264. +95 −0 vendor/gems/fdv-actionwebservice-2.3.8/test/casting_test.rb
  265. +155 −0 vendor/gems/fdv-actionwebservice-2.3.8/test/client_soap_test.rb
  266. +153 −0 vendor/gems/fdv-actionwebservice-2.3.8/test/client_xmlrpc_test.rb
  267. +73 −0 vendor/gems/fdv-actionwebservice-2.3.8/test/container_test.rb
  268. +139 −0 vendor/gems/fdv-actionwebservice-2.3.8/test/dispatcher_action_controller_soap_test.rb
  269. +59 −0 vendor/gems/fdv-actionwebservice-2.3.8/test/dispatcher_action_controller_xmlrpc_test.rb
  270. +8 −0 vendor/gems/fdv-actionwebservice-2.3.8/test/fixtures/db_definitions/mysql.sql
  271. +12 −0 vendor/gems/fdv-actionwebservice-2.3.8/test/fixtures/users.yml
  272. +3 −0  vendor/gems/fdv-actionwebservice-2.3.8/test/gencov
  273. +185 −0 vendor/gems/fdv-actionwebservice-2.3.8/test/invocation_test.rb
  274. +6 −0 vendor/gems/fdv-actionwebservice-2.3.8/test/run
  275. +146 −0 vendor/gems/fdv-actionwebservice-2.3.8/test/scaffolded_controller_test.rb
  276. +52 −0 vendor/gems/fdv-actionwebservice-2.3.8/test/struct_test.rb
  277. +112 −0 vendor/gems/fdv-actionwebservice-2.3.8/test/test_invoke_test.rb
  278. +1 −0  vendor/plugins/static_sidebar/lib/static_sidebar.rb
View
6 README.textile
@@ -6,6 +6,12 @@ extension. It is available as a gem or source tarball.
Current version is Typo 5.5 for Ruby on Rails 2.3.8.
+h1. About This Fork
+
+This fork is an attempt to port typo to run on Ruby 1.9.2. Hopefully it can be merged back into the main branch at some point.
+
+
+
h2. Useful Links:
* "Download Typo 5.5 source code:":http://rubyforge.org/frs/?group_id=555&release_id=42715
View
1  app/controllers/admin/pages_controller.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
require 'base64'
class Admin::PagesController < Admin::BaseController
View
4 app/controllers/application_controller.rb
@@ -8,6 +8,10 @@ class ApplicationController < ActionController::Base
before_filter :reset_local_cache, :fire_triggers, :load_lang
after_filter :reset_local_cache
+ def name
+ self.class.to_s
+ end
+
class << self
unless self.respond_to? :template_root
def template_root
View
1  app/models/article.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
require 'uri'
require 'net/http'
View
6 config/environment.rb
@@ -29,6 +29,10 @@
config.gem 'uuidtools', :version => '~>2.1.1'
config.gem 'flickr', :version => '~> 1.0.2'
config.gem 'rubypants', :version => '~> 0.2.0'
+ config.gem 'test-unit', :version => '1.2.3', :lib => 'test/unit'
+ config.gem 'rspec', :version => '1.3.0', :lib => 'spec'
+ config.gem 'rspec-rails', :version => '1.3.2', :lib => 'spec/rails'
+
# I need the localization plugin to load first
# Otherwise, I can't localize plugins <= localization
@@ -61,7 +65,7 @@
require 'login_system'
require 'typo_version'
$KCODE = 'u'
-require 'jcode'
+#require 'jcode'
require 'transforms'
$FM_OVERWRITE = true
View
1  config/locales/nl.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
{
:'nl' => {
:date => {
View
1  lang/da_DK.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
Localization.define("da_DK") do |l|
# app/controllers/accounts_controller.rb
View
1  lang/de_DE.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
Localization.define("de_DE") do |l|
# app/controllers/accounts_controller.rb
View
1  lang/es_MX.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
# Translation by Edgar J. Suarez
Localization.define("es_MX") do |l|
View
1  lang/fr_FR.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
Localization.define("fr_FR") do |l|
# app/controllers/accounts_controller.rb
View
1  lang/he_IL.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
Localization.define("he_IL") do |l|
# app/controllers/accounts_controller.rb
View
1  lang/it_IT.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
Localization.define("it_IT") do |l|
# app/controllers/accounts_controller.rb
View
1  lang/ja_JP.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
Localization.define("ja_JP") do |l|
# app/controllers/accounts_controller.rb
View
1  lang/lt_LT.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
Localization.define("lt_LT") do |l|
# app/controllers/accounts_controller.rb
View
1  lang/nl_NL.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
Localization.define("nl_NL") do |l|
# app/controllers/accounts_controller.rb
View
1  lang/pl_PL.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
# localization Marcin Gil <marcin.gil@gmail.com>
# additional localization Szymon (jeznet) Jeż <szymon@jez.net.pl>
View
1  lang/ro_RO.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
Localization.define("ro_RO") do |l|
# app/controllers/accounts_controller.rb
View
1  lang/zh_TW.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
Localization.define("zh_TW") do |l|
# app/controllers/accounts_controller.rb
View
4 lib/rails_patch/active_record.rb
@@ -1,8 +1,8 @@
module ActiveRecord
class Base
- def self.find_boolean(find_type, field, value=true, *options)
+ def self.find_boolean(find_type, field, value=true)
self.find(find_type,
- :conditions => ["#{field} = ?", value], *options)
+ :conditions => ["#{field} = ?", value])
end
end
end
View
107 lib/soap/attachment.rb
@@ -0,0 +1,107 @@
+# soap/attachment.rb: SOAP4R - SwA implementation.
+# Copyright (C) 2002, 2003 Jamie Herre and NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'soap/baseData'
+require 'soap/mapping'
+
+
+module SOAP
+
+
+class SOAPAttachment < SOAPExternalReference
+ attr_reader :data
+
+ def initialize(value)
+ super()
+ @data = value
+ end
+
+private
+
+ def external_contentid
+ @data.contentid
+ end
+end
+
+
+class Attachment
+ attr_reader :io
+ attr_accessor :contenttype
+
+ def initialize(string_or_readable = nil)
+ @string_or_readable = string_or_readable
+ @contenttype = "application/octet-stream"
+ @contentid = nil
+ end
+
+ def contentid
+ @contentid ||= Attachment.contentid(self)
+ end
+
+ def contentid=(contentid)
+ @contentid = contentid
+ end
+
+ def mime_contentid
+ '<' + contentid + '>'
+ end
+
+ def content
+ if @content == nil and @string_or_readable != nil
+ @content = @string_or_readable.respond_to?(:read) ?
+ @string_or_readable.read : @string_or_readable
+ end
+ @content
+ end
+
+ def to_s
+ content
+ end
+
+ def write(out)
+ out.write(content)
+ end
+
+ def save(filename)
+ File.open(filename, "wb") do |f|
+ write(f)
+ end
+ end
+
+ def self.contentid(obj)
+ # this needs to be fixed
+ [obj.__id__.to_s, Process.pid.to_s].join('.')
+ end
+
+ def self.mime_contentid(obj)
+ '<' + contentid(obj) + '>'
+ end
+end
+
+
+module Mapping
+ class AttachmentFactory < SOAP::Mapping::Factory
+ def obj2soap(soap_class, obj, info, map)
+ soap_obj = soap_class.new(obj)
+ mark_marshalled_obj(obj, soap_obj)
+ soap_obj
+ end
+
+ def soap2obj(obj_class, node, info, map)
+ obj = node.data
+ mark_unmarshalled_obj(node, obj)
+ return true, obj
+ end
+ end
+
+ DefaultRegistry.add(::SOAP::Attachment, ::SOAP::SOAPAttachment,
+ AttachmentFactory.new, nil)
+end
+
+
+end
View
942 lib/soap/baseData.rb
@@ -0,0 +1,942 @@
+# soap/baseData.rb: SOAP4R - Base type library
+# Copyright (C) 2000, 2001, 2003-2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/datatypes'
+require 'soap/soap'
+
+
+module SOAP
+
+
+###
+## Mix-in module for SOAP base type classes.
+#
+module SOAPModuleUtils
+ include SOAP
+
+public
+
+ def decode(elename)
+ d = self.new
+ d.elename = elename
+ d
+ end
+end
+
+
+###
+## for SOAP type(base and compound)
+#
+module SOAPType
+ attr_accessor :encodingstyle
+ attr_accessor :elename
+ attr_accessor :id
+ attr_reader :precedents
+ attr_accessor :root
+ attr_accessor :parent
+ attr_accessor :position
+ attr_reader :extraattr
+ attr_accessor :definedtype
+
+ def initialize(*arg)
+ super
+ @encodingstyle = nil
+ @elename = XSD::QName::EMPTY
+ @id = nil
+ @precedents = []
+ @root = false
+ @parent = nil
+ @position = nil
+ @definedtype = nil
+ @extraattr = {}
+ end
+
+ def inspect
+ if self.is_a?(XSD::NSDBase)
+ sprintf("#<%s:0x%x %s %s>", self.class.name, __id__, self.elename, self.type)
+ else
+ sprintf("#<%s:0x%x %s>", self.class.name, __id__, self.elename)
+ end
+ end
+
+ def rootnode
+ node = self
+ while node = node.parent
+ break if SOAPEnvelope === node
+ end
+ node
+ end
+end
+
+
+###
+## for SOAP base type
+#
+module SOAPBasetype
+ include SOAPType
+ include SOAP
+
+ def initialize(*arg)
+ super
+ end
+end
+
+
+###
+## for SOAP compound type
+#
+module SOAPCompoundtype
+ include SOAPType
+ include SOAP
+
+ def initialize(*arg)
+ super
+ end
+end
+
+
+###
+## Convenience datatypes.
+#
+class SOAPReference < XSD::NSDBase
+ include SOAPBasetype
+ extend SOAPModuleUtils
+
+public
+
+ attr_accessor :refid
+
+ # Override the definition in SOAPBasetype.
+ def initialize(obj = nil)
+ super()
+ @type = XSD::QName::EMPTY
+ @refid = nil
+ @obj = nil
+ __setobj__(obj) if obj
+ end
+
+ def __getobj__
+ @obj
+ end
+
+ def __setobj__(obj)
+ @obj = obj
+ @refid = @obj.id || SOAPReference.create_refid(@obj)
+ @obj.id = @refid unless @obj.id
+ @obj.precedents << self
+ # Copies NSDBase information
+ @obj.type = @type unless @obj.type
+ end
+
+ # Why don't I use delegate.rb?
+ # -> delegate requires target object type at initialize time.
+ # Why don't I use forwardable.rb?
+ # -> forwardable requires a list of forwarding methods.
+ #
+ # ToDo: Maybe I should use forwardable.rb and give it a methods list like
+ # delegate.rb...
+ #
+ def method_missing(msg_id, *params)
+ if @obj
+ @obj.send(msg_id, *params)
+ else
+ nil
+ end
+ end
+
+ def refidstr
+ '#' + @refid
+ end
+
+ def self.create_refid(obj)
+ 'id' + obj.__id__.to_s
+ end
+
+ def self.decode(elename, refidstr)
+ if /\A#(.*)\z/ =~ refidstr
+ refid = $1
+ elsif /\Acid:(.*)\z/ =~ refidstr
+ refid = $1
+ else
+ raise ArgumentError.new("illegal refid #{refidstr}")
+ end
+ d = super(elename)
+ d.refid = refid
+ d
+ end
+end
+
+
+class SOAPExternalReference < XSD::NSDBase
+ include SOAPBasetype
+ extend SOAPModuleUtils
+
+ def initialize
+ super()
+ @type = XSD::QName::EMPTY
+ end
+
+ def referred
+ rootnode.external_content[external_contentid] = self
+ end
+
+ def refidstr
+ 'cid:' + external_contentid
+ end
+
+private
+
+ def external_contentid
+ raise NotImplementedError.new
+ end
+end
+
+
+class SOAPNil < XSD::XSDNil
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+# SOAPRawString is for sending raw string. In contrast to SOAPString,
+# SOAP4R does not do XML encoding and does not convert its CES. The string it
+# holds is embedded to XML instance directly as a 'xsd:string'.
+class SOAPRawString < XSD::XSDString
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+
+###
+## Basic datatypes.
+#
+class SOAPAnySimpleType < XSD::XSDAnySimpleType
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPString < XSD::XSDString
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPBoolean < XSD::XSDBoolean
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPDecimal < XSD::XSDDecimal
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPFloat < XSD::XSDFloat
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPDouble < XSD::XSDDouble
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPDuration < XSD::XSDDuration
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPDateTime < XSD::XSDDateTime
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPTime < XSD::XSDTime
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPDate < XSD::XSDDate
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPGYearMonth < XSD::XSDGYearMonth
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPGYear < XSD::XSDGYear
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPGMonthDay < XSD::XSDGMonthDay
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPGDay < XSD::XSDGDay
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPGMonth < XSD::XSDGMonth
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPHexBinary < XSD::XSDHexBinary
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPBase64 < XSD::XSDBase64Binary
+ include SOAPBasetype
+ extend SOAPModuleUtils
+ Type = QName.new(EncodingNamespace, Base64Literal)
+
+public
+ # Override the definition in SOAPBasetype.
+ def initialize(value = nil)
+ super(value)
+ @type = Type
+ end
+
+ def as_xsd
+ @type = XSD::XSDBase64Binary::Type
+ end
+end
+
+class SOAPAnyURI < XSD::XSDAnyURI
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPQName < XSD::XSDQName
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+
+class SOAPInteger < XSD::XSDInteger
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPNonPositiveInteger < XSD::XSDNonPositiveInteger
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPNegativeInteger < XSD::XSDNegativeInteger
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPLong < XSD::XSDLong
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPInt < XSD::XSDInt
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPShort < XSD::XSDShort
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPByte < XSD::XSDByte
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPNonNegativeInteger < XSD::XSDNonNegativeInteger
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPUnsignedLong < XSD::XSDUnsignedLong
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPUnsignedInt < XSD::XSDUnsignedInt
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPUnsignedShort < XSD::XSDUnsignedShort
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPUnsignedByte < XSD::XSDUnsignedByte
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+class SOAPPositiveInteger < XSD::XSDPositiveInteger
+ include SOAPBasetype
+ extend SOAPModuleUtils
+end
+
+
+###
+## Compound datatypes.
+#
+class SOAPStruct < XSD::NSDBase
+ include SOAPCompoundtype
+ include Enumerable
+
+public
+
+ def initialize(type = nil)
+ super()
+ @type = type || XSD::QName::EMPTY
+ @array = []
+ @data = []
+ end
+
+ def to_s()
+ str = ''
+ self.each do |key, data|
+ str << "#{key}: #{data}\n"
+ end
+ str
+ end
+
+ def add(name, value)
+ add_member(name, value)
+ end
+
+ def [](idx)
+ if idx.is_a?(Range)
+ @data[idx]
+ elsif idx.is_a?(Integer)
+ if (idx > @array.size)
+ raise ArrayIndexOutOfBoundsError.new('In ' << @type.name)
+ end
+ @data[idx]
+ else
+ if @array.include?(idx)
+ @data[@array.index(idx)]
+ else
+ nil
+ end
+ end
+ end
+
+ def []=(idx, data)
+ if @array.include?(idx)
+ data.parent = self if data.respond_to?(:parent=)
+ @data[@array.index(idx)] = data
+ else
+ add(idx, data)
+ end
+ end
+
+ def key?(name)
+ @array.include?(name)
+ end
+
+ def members
+ @array
+ end
+
+ def to_obj
+ hash = {}
+ proptype = {}
+ each do |k, v|
+ value = v.respond_to?(:to_obj) ? v.to_obj : v.to_s
+ case proptype[k]
+ when :single
+ hash[k] = [hash[k], value]
+ proptype[k] = :multi
+ when :multi
+ hash[k] << value
+ else
+ hash[k] = value
+ proptype[k] = :single
+ end
+ end
+ hash
+ end
+
+ def each
+ idx = 0
+ while idx < @array.length
+ yield(@array[idx], @data[idx])
+ idx += 1
+ end
+ end
+
+ def replace
+ members.each do |member|
+ self[member] = yield(self[member])
+ end
+ end
+
+ def self.decode(elename, type)
+ s = SOAPStruct.new(type)
+ s.elename = elename
+ s
+ end
+
+private
+
+ def add_member(name, value = nil)
+ value = SOAPNil.new() if value.nil?
+ @array.push(name)
+ value.elename = value.elename.dup_name(name)
+ @data.push(value)
+ value.parent = self if value.respond_to?(:parent=)
+ value
+ end
+end
+
+
+# SOAPElement is not typed so it is not derived from NSDBase.
+class SOAPElement
+ include Enumerable
+
+ attr_accessor :encodingstyle
+
+ attr_accessor :elename
+ attr_accessor :id
+ attr_reader :precedents
+ attr_accessor :root
+ attr_accessor :parent
+ attr_accessor :position
+ attr_accessor :extraattr
+
+ attr_accessor :qualified
+
+ def initialize(elename, text = nil)
+ if !elename.is_a?(XSD::QName)
+ elename = XSD::QName.new(nil, elename)
+ end
+ @encodingstyle = LiteralNamespace
+ @elename = elename
+ @id = nil
+ @precedents = []
+ @root = false
+ @parent = nil
+ @position = nil
+ @extraattr = {}
+
+ @qualified = nil
+
+ @array = []
+ @data = []
+ @text = text
+ end
+
+ def inspect
+ sprintf("#<%s:0x%x %s>", self.class.name, __id__, self.elename)
+ end
+
+ # Text interface.
+ attr_accessor :text
+ alias data text
+
+ # Element interfaces.
+ def add(value)
+ add_member(value.elename.name, value)
+ end
+
+ def [](idx)
+ if @array.include?(idx)
+ @data[@array.index(idx)]
+ else
+ nil
+ end
+ end
+
+ def []=(idx, data)
+ if @array.include?(idx)
+ data.parent = self if data.respond_to?(:parent=)
+ @data[@array.index(idx)] = data
+ else
+ add(data)
+ end
+ end
+
+ def key?(name)
+ @array.include?(name)
+ end
+
+ def members
+ @array
+ end
+
+ def to_obj
+ if members.empty?
+ @text
+ else
+ hash = {}
+ proptype = {}
+ each do |k, v|
+ value = v.respond_to?(:to_obj) ? v.to_obj : v.to_s
+ case proptype[k]
+ when :single
+ hash[k] = [hash[k], value]
+ proptype[k] = :multi
+ when :multi
+ hash[k] << value
+ else
+ hash[k] = value
+ proptype[k] = :single
+ end
+ end
+ hash
+ end
+ end
+
+ def each
+ idx = 0
+ while idx < @array.length
+ yield(@array[idx], @data[idx])
+ idx += 1
+ end
+ end
+
+ def self.decode(elename)
+ o = SOAPElement.new(elename)
+ o
+ end
+
+ def self.from_obj(obj, namespace = nil)
+ o = SOAPElement.new(nil)
+ case obj
+ when nil
+ o.text = nil
+ when Hash
+ obj.each do |elename, value|
+ if value.is_a?(Array)
+ value.each do |subvalue|
+ child = from_obj(subvalue, namespace)
+ child.elename = to_elename(elename, namespace)
+ o.add(child)
+ end
+ else
+ child = from_obj(value, namespace)
+ child.elename = to_elename(elename, namespace)
+ o.add(child)
+ end
+ end
+ else
+ o.text = obj.to_s
+ end
+ o
+ end
+
+ def self.to_elename(obj, namespace = nil)
+ if obj.is_a?(XSD::QName)
+ obj
+ elsif /\A(.+):([^:]+)\z/ =~ obj.to_s
+ XSD::QName.new($1, $2)
+ else
+ XSD::QName.new(namespace, obj.to_s)
+ end
+ end
+
+private
+
+ def add_member(name, value)
+ add_accessor(name)
+ @array.push(name)
+ @data.push(value)
+ value.parent = self if value.respond_to?(:parent=)
+ value
+ end
+
+ if RUBY_VERSION > "1.7.0"
+ def add_accessor(name)
+ methodname = name
+ if self.respond_to?(methodname)
+ methodname = safe_accessor_name(methodname)
+ end
+ Mapping.define_singleton_method(self, methodname) do
+ @data[@array.index(name)]
+ end
+ Mapping.define_singleton_method(self, methodname + '=') do |value|
+ @data[@array.index(name)] = value
+ end
+ end
+ else
+ def add_accessor(name)
+ methodname = safe_accessor_name(name)
+ instance_eval <<-EOS
+ def #{methodname}
+ @data[@array.index(#{name.dump})]
+ end
+
+ def #{methodname}=(value)
+ @data[@array.index(#{name.dump})] = value
+ end
+ EOS
+ end
+ end
+
+ def safe_accessor_name(name)
+ "var_" << name.gsub(/[^a-zA-Z0-9_]/, '')
+ end
+end
+
+
+class SOAPArray < XSD::NSDBase
+ include SOAPCompoundtype
+ include Enumerable
+
+public
+
+ attr_accessor :sparse
+
+ attr_reader :offset, :rank
+ attr_accessor :size, :size_fixed
+ attr_reader :arytype
+
+ def initialize(type = nil, rank = 1, arytype = nil)
+ super()
+ @type = type || ValueArrayName
+ @rank = rank
+ @data = Array.new
+ @sparse = false
+ @offset = Array.new(rank, 0)
+ @size = Array.new(rank, 0)
+ @size_fixed = false
+ @position = nil
+ @arytype = arytype
+ end
+
+ def offset=(var)
+ @offset = var
+ @sparse = true
+ end
+
+ def add(value)
+ self[*(@offset)] = value
+ end
+
+ def [](*idxary)
+ if idxary.size != @rank
+ raise ArgumentError.new("given #{idxary.size} params does not match rank: #{@rank}")
+ end
+
+ retrieve(idxary)
+ end
+
+ def []=(*idxary)
+ value = idxary.slice!(-1)
+
+ if idxary.size != @rank
+ raise ArgumentError.new("given #{idxary.size} params(#{idxary})" +
+ " does not match rank: #{@rank}")
+ end
+
+ idx = 0
+ while idx < idxary.size
+ if idxary[idx] + 1 > @size[idx]
+ @size[idx] = idxary[idx] + 1
+ end
+ idx += 1
+ end
+
+ data = retrieve(idxary[0, idxary.size - 1])
+ data[idxary.last] = value
+
+ if value.is_a?(SOAPType)
+ value.elename = ITEM_NAME
+ # Sync type
+ unless @type.name
+ @type = XSD::QName.new(value.type.namespace,
+ SOAPArray.create_arytype(value.type.name, @rank))
+ end
+ value.type ||= @type
+ end
+
+ @offset = idxary
+ value.parent = self if value.respond_to?(:parent=)
+ offsetnext
+ end
+
+ def each
+ @data.each do |data|
+ yield(data)
+ end
+ end
+
+ def to_a
+ @data.dup
+ end
+
+ def replace
+ @data = deep_map(@data) do |ele|
+ yield(ele)
+ end
+ end
+
+ def deep_map(ary, &block)
+ ary.collect do |ele|
+ if ele.is_a?(Array)
+ deep_map(ele, &block)
+ else
+ new_obj = block.call(ele)
+ new_obj.elename = ITEM_NAME
+ new_obj
+ end
+ end
+ end
+
+ def include?(var)
+ traverse_data(@data) do |v, *rank|
+ if v.is_a?(SOAPBasetype) && v.data == var
+ return true
+ end
+ end
+ false
+ end
+
+ def traverse
+ traverse_data(@data) do |v, *rank|
+ unless @sparse
+ yield(v)
+ else
+ yield(v, *rank) if v && !v.is_a?(SOAPNil)
+ end
+ end
+ end
+
+ def soap2array(ary)
+ traverse_data(@data) do |v, *position|
+ iteary = ary
+ rank = 1
+ while rank < position.size
+ idx = position[rank - 1]
+ if iteary[idx].nil?
+ iteary = iteary[idx] = Array.new
+ else
+ iteary = iteary[idx]
+ end
+ rank += 1
+ end
+ if block_given?
+ iteary[position.last] = yield(v)
+ else
+ iteary[position.last] = v
+ end
+ end
+ end
+
+ def position
+ @position
+ end
+
+private
+
+ ITEM_NAME = XSD::QName.new(nil, 'item')
+
+ def retrieve(idxary)
+ data = @data
+ rank = 1
+ while rank <= idxary.size
+ idx = idxary[rank - 1]
+ if data[idx].nil?
+ data = data[idx] = Array.new
+ else
+ data = data[idx]
+ end
+ rank += 1
+ end
+ data
+ end
+
+ def traverse_data(data, rank = 1)
+ idx = 0
+ while idx < ranksize(rank)
+ if rank < @rank
+ traverse_data(data[idx], rank + 1) do |*v|
+ v[1, 0] = idx
+ yield(*v)
+ end
+ else
+ yield(data[idx], idx)
+ end
+ idx += 1
+ end
+ end
+
+ def ranksize(rank)
+ @size[rank - 1]
+ end
+
+ def offsetnext
+ move = false
+ idx = @offset.size - 1
+ while !move && idx >= 0
+ @offset[idx] += 1
+ if @size_fixed
+ if @offset[idx] < @size[idx]
+ move = true
+ else
+ @offset[idx] = 0
+ idx -= 1
+ end
+ else
+ move = true
+ end
+ end
+ end
+
+ # Module function
+
+public
+
+ def self.decode(elename, type, arytype)
+ typestr, nofary = parse_type(arytype.name)
+ rank = nofary.count(',') + 1
+ plain_arytype = XSD::QName.new(arytype.namespace, typestr)
+ o = SOAPArray.new(type, rank, plain_arytype)
+ size = []
+ nofary.split(',').each do |s|
+ if s.empty?
+ size.clear
+ break
+ else
+ size << s.to_i
+ end
+ end
+ unless size.empty?
+ o.size = size
+ o.size_fixed = true
+ end
+ o.elename = elename
+ o
+ end
+
+private
+
+ def self.create_arytype(typename, rank)
+ "#{typename}[" << ',' * (rank - 1) << ']'
+ end
+
+ TypeParseRegexp = Regexp.new('^(.+)\[([\d,]*)\]$')
+
+ def self.parse_type(string)
+ TypeParseRegexp =~ string
+ return $1, $2
+ end
+end
+
+
+require 'soap/mapping/typeMap'
+
+
+end
View
258 lib/soap/element.rb
@@ -0,0 +1,258 @@
+# SOAP4R - SOAP elements library
+# Copyright (C) 2000, 2001, 2003-2005 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.
+
+# This program is copyrighted free software by NAKAMURA, Hiroshi. You can
+# redistribute it and/or modify it under the same terms of Ruby's license;
+# either the dual license version in 2003, or any later version.
+
+
+require 'xsd/qname'
+require 'soap/baseData'
+
+
+module SOAP
+
+
+###
+## SOAP elements
+#
+module SOAPEnvelopeElement; end
+
+class SOAPFault < SOAPStruct
+ include SOAPEnvelopeElement
+ include SOAPCompoundtype
+
+public
+
+ def faultcode
+ self['faultcode']
+ end
+
+ def faultstring
+ self['faultstring']
+ end
+
+ def faultactor
+ self['faultactor']
+ end
+
+ def detail
+ self['detail']
+ end
+
+ def faultcode=(rhs)
+ self['faultcode'] = rhs
+ end
+
+ def faultstring=(rhs)
+ self['faultstring'] = rhs
+ end
+
+ def faultactor=(rhs)
+ self['faultactor'] = rhs
+ end
+
+ def detail=(rhs)
+ self['detail'] = rhs
+ end
+
+ def initialize(faultcode = nil, faultstring = nil, faultactor = nil, detail = nil)
+ super(EleFaultName)
+ @elename = EleFaultName
+ @encodingstyle = EncodingNamespace
+
+ if faultcode
+ self.faultcode = faultcode
+ self.faultstring = faultstring
+ self.faultactor = faultactor
+ self.detail = detail
+ self.faultcode.elename = EleFaultCodeName if self.faultcode
+ self.faultstring.elename = EleFaultStringName if self.faultstring
+ self.faultactor.elename = EleFaultActorName if self.faultactor
+ self.detail.elename = EleFaultDetailName if self.detail
+ end
+ faultcode.parent = self if faultcode
+ faultstring.parent = self if faultstring
+ faultactor.parent = self if faultactor
+ detail.parent = self if detail
+ end
+
+ def encode(generator, ns, attrs = {})
+ SOAPGenerator.assign_ns(attrs, ns, EnvelopeNamespace)
+ SOAPGenerator.assign_ns(attrs, ns, EncodingNamespace)
+ attrs[ns.name(AttrEncodingStyleName)] = EncodingNamespace
+ name = ns.name(@elename)
+ generator.encode_tag(name, attrs)
+ yield(self.faultcode)
+ yield(self.faultstring)
+ yield(self.faultactor)
+ yield(self.detail) if self.detail
+ generator.encode_tag_end(name, true)
+ end
+end
+
+
+class SOAPBody < SOAPStruct
+ include SOAPEnvelopeElement
+
+ def initialize(data = nil, is_fault = false)
+ super(nil)
+ @elename = EleBodyName
+ @encodingstyle = nil
+ if data
+ if data.respond_to?(:elename)
+ add(data.elename.name, data)
+ else
+ data.to_a.each do |datum|
+ add(datum.elename.name, datum)
+ end
+ end
+ end
+ @is_fault = is_fault
+ end
+
+ def encode(generator, ns, attrs = {})
+ name = ns.name(@elename)
+ generator.encode_tag(name, attrs)
+ if @is_fault
+ yield(@data)
+ else
+ @data.each do |data|
+ yield(data)
+ end
+ end
+ generator.encode_tag_end(name, true)
+ end
+
+ def root_node
+ @data.each do |node|
+ if node.root == 1
+ return node
+ end
+ end
+ # No specified root...
+ @data.each do |node|
+ if node.root != 0
+ return node
+ end
+ end
+
+ raise Parser::FormatDecodeError.new('no root element')
+ end
+end
+
+
+class SOAPHeaderItem < XSD::NSDBase
+ include SOAPEnvelopeElement
+ include SOAPCompoundtype
+
+public
+
+ attr_accessor :element
+ attr_accessor :mustunderstand
+ attr_accessor :encodingstyle
+
+ def initialize(element, mustunderstand = true, encodingstyle = nil)
+ super()
+ @type = nil
+ @element = element
+ @mustunderstand = mustunderstand
+ @encodingstyle = encodingstyle
+ element.parent = self if element
+ end
+
+ def encode(generator, ns, attrs = {})
+ attrs.each do |key, value|
+ @element.extraattr[key] = value
+ end
+ @element.extraattr[ns.name(AttrMustUnderstandName)] =
+ (@mustunderstand ? '1' : '0')
+ if @encodingstyle
+ @element.extraattr[ns.name(AttrEncodingStyleName)] = @encodingstyle
+ end
+ @element.encodingstyle = @encodingstyle if !@element.encodingstyle
+ yield(@element)
+ end
+end
+
+
+class SOAPHeader < SOAPStruct
+ include SOAPEnvelopeElement
+
+ def initialize
+ super(nil)
+ @elename = EleHeaderName
+ @encodingstyle = nil
+ end
+
+ def encode(generator, ns, attrs = {})
+ name = ns.name(@elename)
+ generator.encode_tag(name, attrs)
+ @data.each do |data|
+ yield(data)
+ end
+ generator.encode_tag_end(name, true)
+ end
+
+ def add(name, value)
+ mu = (value.extraattr[AttrMustUnderstandName] == '1')
+ encstyle = value.extraattr[AttrEncodingStyleName]
+ item = SOAPHeaderItem.new(value, mu, encstyle)
+ super(name, item)
+ end
+
+ def length
+ @data.length
+ end
+ alias size length
+end
+
+
+class SOAPEnvelope < XSD::NSDBase
+ include SOAPEnvelopeElement
+ include SOAPCompoundtype
+
+ attr_reader :header
+ attr_reader :body
+ attr_reader :external_content
+
+ def initialize(header = nil, body = nil)
+ super()
+ @type = nil
+ @elename = EleEnvelopeName
+ @encodingstyle = nil
+ @header = header
+ @body = body
+ @external_content = {}
+ header.parent = self if header
+ body.parent = self if body
+ end
+
+ def header=(header)
+ header.parent = self
+ @header = header
+ end
+
+ def body=(body)
+ body.parent = self
+ @body = body
+ end
+
+ def encode(generator, ns, attrs = {})
+ SOAPGenerator.assign_ns(attrs, ns, elename.namespace, SOAPNamespaceTag)
+ name = ns.name(@elename)
+ generator.encode_tag(name, attrs)
+
+ yield(@header) if @header and @header.length > 0
+ yield(@body)
+
+ generator.encode_tag_end(name, true)
+ end
+
+ def to_ary
+ [header, body]
+ end
+end
+