washout_builder 0.16.5 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/.travis.yml +2 -0
- data/README.rdoc +1 -0
- data/app/views/wash_with_html/_complex_type.builder +1 -1
- data/lib/washout_builder.rb +13 -61
- data/lib/washout_builder/param.rb +40 -0
- data/lib/washout_builder/soap.rb +1 -20
- data/lib/washout_builder/type.rb +24 -5
- data/lib/washout_builder/version.rb +3 -3
- data/washout_builder.gemspec +1 -0
- metadata +23 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e260042314d03a1b4870adc1f58aa09b3bb0f03
|
4
|
+
data.tar.gz: 45e9bd052649d80b029ddfeeb20d8e3399dc89f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3e0839175bad01174789649207527c2f338cbe42a29e604af71c3b555930687df41d44807aeef2700f5365357d963a69798e8f6920d5fdee7d956de3eca15ba
|
7
|
+
data.tar.gz: dd7a24b984e06b0863e787cf28c54265a74334ba4d9b384a28db59828c8c74c0f514bfa3507f25954bd11ce657323fc6f38ffd84fbe922c37205892ea21a3d17
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
data/README.rdoc
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
= washout_builder {<img src="https://badge.fury.io/rb/washout_builder.png" alt="Gem Version" />}[http://badge.fury.io/rb/washout_builder]
|
2
2
|
{<img src="https://travis-ci.org/bogdanRada/washout_builder.png?branch=master,develop" />}[https://travis-ci.org/bogdanRada/washout_builder]
|
3
3
|
{<img src="https://gemnasium.com/bogdanRada/washout_builder.svg" alt="Dependency Status" />}[https://gemnasium.com/bogdanRada/washout_builder]
|
4
|
+
{<img src="http://inch-ci.org/github/bogdanRada/washout_builder.svg?branch=master" alt="Inline docs" />}[http://inch-ci.org/github/bogdanRada/washout_builder]
|
4
5
|
{<img src="https://coveralls.io/repos/bogdanRada/washout_builder/badge.png?branch=master" alt="Coverage Status" />}[https://coveralls.io/r/bogdanRada/washout_builder?branch=master]
|
5
6
|
{<img src="https://codeclimate.com/github/bogdanRada/washout_builder.png" />}[https://codeclimate.com/github/bogdanRada/washout_builder]
|
6
7
|
{<img src="https://reposs.herokuapp.com/?path=bogdanRada/washout_builder" alt="Repo Size"/>}[https://github.com/bogdanRada/washout_builder]
|
@@ -4,7 +4,7 @@ unless object.blank?
|
|
4
4
|
xml.h3 { |pre| pre << "#{class_name} #{ancestors.blank? ? "" : "<small>(extends <a href='##{ancestors[0].to_s.classify}'>#{ancestors[0].to_s.classify}</a>)</small>" } " }
|
5
5
|
|
6
6
|
|
7
|
-
if
|
7
|
+
if WashoutBuilder::Type.all_param_classes.include?(object.class)
|
8
8
|
xml.ul("class" => "pre") {
|
9
9
|
object.map.each do |element|
|
10
10
|
xml.li { |pre|
|
data/lib/washout_builder.rb
CHANGED
@@ -1,28 +1,31 @@
|
|
1
1
|
require 'wash_out'
|
2
|
+
require 'active_support/core_ext/object/blank'
|
3
|
+
require 'active_support/core_ext/hash/keys'
|
4
|
+
require 'active_support/concern'
|
2
5
|
Gem.find_files('washout_builder/**/*.rb').each { |path| require path }
|
3
6
|
|
4
|
-
WashOut::Param.send :include, WashoutBuilder::Document::ComplexType
|
5
|
-
|
6
7
|
WashoutBuilder::Type.all_fault_classes.each do |exception_class|
|
7
8
|
exception_class.class_eval do
|
8
9
|
extend WashoutBuilder::Document::ExceptionModel
|
9
10
|
end
|
10
11
|
end
|
11
12
|
|
12
|
-
|
13
|
-
|
13
|
+
WashoutBuilder::Type.all_controller_classes.each do |controller|
|
14
|
+
controller.class_eval do
|
14
15
|
alias_method :original_soap_action, :soap_action
|
16
|
+
include WashoutBuilder::SOAP
|
15
17
|
end
|
16
18
|
end
|
17
19
|
|
18
|
-
|
19
|
-
|
20
|
-
|
20
|
+
WashoutBuilder::Type.all_param_classes.each do |controller|
|
21
|
+
controller.class_eval do
|
22
|
+
extend WashoutBuilder::Param
|
23
|
+
include WashoutBuilder::Document::ComplexType
|
21
24
|
end
|
22
25
|
end
|
23
26
|
|
24
|
-
|
25
|
-
|
27
|
+
WashoutBuilder::Type.all_soap_config_classes.each do |controller|
|
28
|
+
controller.class_eval do
|
26
29
|
singleton_class.send(:alias_method, :original_config, :config)
|
27
30
|
singleton_class.send(:alias_method, :original_keys, :keys)
|
28
31
|
|
@@ -34,56 +37,5 @@ if defined?(WashOut::SoapConfig)
|
|
34
37
|
original_config.merge(description: nil)
|
35
38
|
end
|
36
39
|
end
|
37
|
-
|
38
|
-
end
|
39
|
-
|
40
|
-
WashOut::Param.class_eval do
|
41
|
-
def self.parse_builder_def(soap_config, definition)
|
42
|
-
raise '[] should not be used in your params. Use nil if you want to mark empty set.' if definition == []
|
43
|
-
return [] if definition.blank?
|
44
|
-
|
45
|
-
# the following lines was removed because when generating the documentation
|
46
|
-
# the "source_class" attrtibute of the object was not the name of the class of the complex tyoe
|
47
|
-
# but instead was the name given in the hash
|
48
|
-
# Example :
|
49
|
-
# class ProjectType < WashOut::Type
|
50
|
-
# map :project => {
|
51
|
-
# :name => :string,
|
52
|
-
# :description => :string,
|
53
|
-
# :users => [{:mail => :string }],
|
54
|
-
# }
|
55
|
-
# end
|
56
|
-
#
|
57
|
-
# The name of the complex type should be ProjectType and not "project"
|
58
|
-
|
59
|
-
# if definition.is_a?(Class) && definition.ancestors.include?(WashOut::Type)
|
60
|
-
# definition = definition.wash_out_param_map
|
61
|
-
# end
|
62
|
-
|
63
|
-
definition = { value: definition } unless definition.is_a?(Hash) # for arrays and symbols
|
64
|
-
|
65
|
-
definition.map do |name, opt|
|
66
|
-
if opt.is_a? WashOut::Param
|
67
|
-
opt
|
68
|
-
elsif opt.is_a? Array
|
69
|
-
WashOut::Param.new(soap_config, name, opt[0], true)
|
70
|
-
else
|
71
|
-
WashOut::Param.new(soap_config, name, opt)
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
ActionController::Base.class_eval do
|
78
|
-
# Define a SOAP service. The function has no required +options+:
|
79
|
-
# but allow any of :parser, :namespace, :wsdl_style, :snakecase_input,
|
80
|
-
# :camelize_wsdl, :wsse_username, :wsse_password and :catch_xml_errors.
|
81
|
-
#
|
82
|
-
# Any of the the params provided allows for overriding the defaults
|
83
|
-
# (like supporting multiple namespaces instead of application wide such)
|
84
|
-
#
|
85
|
-
def self.soap_service(options = {})
|
86
|
-
include WashoutBuilder::SOAP
|
87
|
-
self.soap_config = options
|
88
|
-
end
|
40
|
+
controller.soap_accessor(:description)
|
89
41
|
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module WashoutBuilder
|
2
|
+
module Param
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
def parse_builder_def(soap_config, definition)
|
6
|
+
raise '[] should not be used in your params. Use nil if you want to mark empty set.' if definition == []
|
7
|
+
return [] if definition.blank?
|
8
|
+
|
9
|
+
# the following lines was removed because when generating the documentation
|
10
|
+
# the "source_class" attrtibute of the object was not the name of the class of the complex tyoe
|
11
|
+
# but instead was the name given in the hash
|
12
|
+
# Example :
|
13
|
+
# class ProjectType < WashOut::Type
|
14
|
+
# map :project => {
|
15
|
+
# :name => :string,
|
16
|
+
# :description => :string,
|
17
|
+
# :users => [{:mail => :string }],
|
18
|
+
# }
|
19
|
+
# end
|
20
|
+
#
|
21
|
+
# The name of the complex type should be ProjectType and not "project"
|
22
|
+
|
23
|
+
# if definition.is_a?(Class) && definition.ancestors.include?(WashOut::Type)
|
24
|
+
# definition = definition.wash_out_param_map
|
25
|
+
# end
|
26
|
+
|
27
|
+
definition = { value: definition } unless definition.is_a?(Hash) # for arrays and symbols
|
28
|
+
|
29
|
+
definition.map do |name, opt|
|
30
|
+
if opt.is_a? self
|
31
|
+
opt
|
32
|
+
elsif opt.is_a? Array
|
33
|
+
new(soap_config, name, opt[0], true)
|
34
|
+
else
|
35
|
+
new(soap_config, name, opt)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/washout_builder/soap.rb
CHANGED
@@ -5,20 +5,7 @@ module WashoutBuilder
|
|
5
5
|
# their arguments and return types
|
6
6
|
module SOAP
|
7
7
|
extend ActiveSupport::Concern
|
8
|
-
|
9
|
-
include WashOut::Rails::Controller if defined?(WashOut::Rails::Controller)
|
10
|
-
|
11
|
-
# module that is used to define a soap action for a controller
|
12
|
-
module ClassMethods
|
13
|
-
# module that is used to define a soap action for a controller
|
14
|
-
#
|
15
|
-
# @!attribute soap_actions
|
16
|
-
# @return [Hash] Hash that contains all the actions to which the web service responds to and information about them
|
17
|
-
#
|
18
|
-
# @!attribute washout_builder_action
|
19
|
-
# @return [String] holds the action of the controller
|
20
|
-
attr_accessor :soap_actions, :washout_builder_action
|
21
|
-
|
8
|
+
included do
|
22
9
|
# Define a SOAP action +action+. The function has two required +options+:
|
23
10
|
# :args and :return. Each is a type +definition+ of format described in
|
24
11
|
# WashOut::Param#parse_def.
|
@@ -47,11 +34,5 @@ module WashoutBuilder
|
|
47
34
|
current_action[:builder_out] = WashOut::Param.parse_builder_def(soap_config, options[:return])
|
48
35
|
end
|
49
36
|
end
|
50
|
-
|
51
|
-
included do
|
52
|
-
include WashOut::Configurable if defined?(WashOut::Configurable)
|
53
|
-
include WashOut::Dispatcher if defined?(WashOut::Dispatcher)
|
54
|
-
self.soap_actions = {}
|
55
|
-
end
|
56
37
|
end
|
57
38
|
end
|
data/lib/washout_builder/type.rb
CHANGED
@@ -9,11 +9,30 @@ module WashoutBuilder
|
|
9
9
|
# @return [Array<Class>] returns all the exception classes that should be considered to be detected
|
10
10
|
# @api public
|
11
11
|
def self.all_fault_classes
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
classes = []
|
13
|
+
classes << WashOut::SOAPError if defined?(WashOut::SOAPError)
|
14
|
+
classes << WashOut::Dispatcher::SOAPError if defined?(WashOut::Dispatcher::SOAPError)
|
15
|
+
classes << SOAPError if defined?(SOAPError)
|
16
|
+
classes
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.all_controller_classes
|
20
|
+
classes = []
|
21
|
+
classes << WashOut::Rails::Controller::ClassMethods if defined?(WashOut::Rails::Controller::ClassMethods)
|
22
|
+
classes << WashOut::SOAP::ClassMethods if defined?(WashOut::SOAP::ClassMethods)
|
23
|
+
classes
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.all_param_classes
|
27
|
+
classes = []
|
28
|
+
classes << WashOut::Param if defined?(WashOut::Param)
|
29
|
+
classes
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.all_soap_config_classes
|
33
|
+
classes = []
|
34
|
+
classes << WashOut::SoapConfig if defined?(WashOut::SoapConfig)
|
35
|
+
classes
|
17
36
|
end
|
18
37
|
|
19
38
|
# Checks if a exception class inherits from the basic ones
|
@@ -8,11 +8,11 @@ module WashoutBuilder
|
|
8
8
|
# the module that is used to generate the gem version
|
9
9
|
module VERSION
|
10
10
|
# the major version of the gem
|
11
|
-
MAJOR =
|
11
|
+
MAJOR = 1
|
12
12
|
# the minor version of the gem
|
13
|
-
MINOR =
|
13
|
+
MINOR = 0
|
14
14
|
# the tiny version of the gem
|
15
|
-
TINY =
|
15
|
+
TINY = 0
|
16
16
|
# if the version should be a e
|
17
17
|
PRE = nil
|
18
18
|
|
data/washout_builder.gemspec
CHANGED
@@ -16,6 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.test_files = s.files.grep(/^(spec)/)
|
17
17
|
s.require_paths = ["lib"]
|
18
18
|
s.add_runtime_dependency 'wash_out', '~> 0.9.1', '>= 0.9.1'
|
19
|
+
s.add_runtime_dependency 'activesupport', '~> 4.0', '>= 4.0'
|
19
20
|
|
20
21
|
s.add_development_dependency 'wasabi', '~> 3.5', '>= 3.5'
|
21
22
|
s.add_development_dependency 'savon', '~> 2.11', '>= 2.11'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: washout_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bogdanRada
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: wash_out
|
@@ -30,6 +30,26 @@ dependencies:
|
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 0.9.1
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: activesupport
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '4.0'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '4.0'
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '4.0'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '4.0'
|
33
53
|
- !ruby/object:Gem::Dependency
|
34
54
|
name: wasabi
|
35
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -575,6 +595,7 @@ files:
|
|
575
595
|
- lib/washout_builder/document/generator.rb
|
576
596
|
- lib/washout_builder/document/shared_complex_type.rb
|
577
597
|
- lib/washout_builder/engine.rb
|
598
|
+
- lib/washout_builder/param.rb
|
578
599
|
- lib/washout_builder/soap.rb
|
579
600
|
- lib/washout_builder/type.rb
|
580
601
|
- lib/washout_builder/version.rb
|