washout_builder 0.13.3 → 0.13.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDQ4NTEwNjQwOGY4ZjA3NmY2MmE3MzA2MjNlZGFhY2FkNDJlOGFjNQ==
4
+ NDQ2NDJjNmVkNDNiOWViZDgzYTA1YzYxYTg1NGIzNDUwYjEyZTZhMg==
5
5
  data.tar.gz: !binary |-
6
- OGU0MjUxMGVlMWIxODc1MGE3ODY2ZDY1Njc1NWZmOTlmMzAwY2ExNQ==
6
+ MDYzMWY4Y2FkOGFiYjlmZmQ4MjBhZmQ5MDBjYjMzZmY1MzMwMzQ3Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MWQ0OTQyZjUwNzFiZWZjN2EyOGJhZTJkZDU4YTk1NWViNTM0ODBmOWQ0ZGU5
10
- YWNjNTMwMTMwMzQ2YjUwMDhkYTRmYzA2MGZjYmE0OGUyMTllZWI3MzVkZTcy
11
- ZjEyNDRhZGJiYmQ4ZTU0NzVjMTg5OTkxMjc4ZDY3NmE0NWVmOTA=
9
+ MDc0ZjI3MzgzYTlhMmYzZWJkY2ZlMTU5YThmN2FkOWUyYTIyNGI4YjE0N2U4
10
+ ZDk0ZmZlMGRjY2NlYTE1NjUzOGFjODk3NGU1YmYwOTIzZWNkMjRmZGVmMDlj
11
+ N2RhNDNkMWNmOTk0ZWVmNWJmZDEzM2VjOTdkZTA4NTA0MDBiMWM=
12
12
  data.tar.gz: !binary |-
13
- N2YxYTQ5ZWQyMDA0NTJlMjMwNTdiOTRhYjM5ZDk1M2IzOGQwZmQwZWI2ZDg3
14
- ZmVjODhlOWU1MTA2YzE4MzI5MjE1NDhmZDA0MmMxOGVhZjIwZTkwNTk4NjEw
15
- NWE5MmRkZjI0ZjIxMzAxNzY3M2UwMTk5M2Y1ZTNmMzJmMTNkOTI=
13
+ OTIzODA2NmQwNWUyYWY4Mjk2YmFhNGUzMDUzMTc2M2ExMGQyNTZiMTc5N2U4
14
+ N2M1ZGU0MTJmZThkNGNkYTkzZjhhNGUyZjg1MTA3NDc1OTc0YTE2ZmIzZjU4
15
+ N2ZjNDRhZDFhYjE3NTU4MmQwMDMxMTU3OWJhODEyMTEyMGZkZjI=
@@ -2,6 +2,7 @@
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://www.versioneye.com/user/projects/52fc7297ec1375346600007d/badge.png" alt="Dependency Status" />}[https://www.versioneye.com/user/projects/52fc7297ec1375346600007d]{<img src="https://www.versioneye.com/user/projects/52fc7297ec1375346600007d/badge.png" alt="Dependency Status" />}[https://www.versioneye.com/user/projects/52fc7297ec1375346600007d]
4
4
  {<img src="https://coveralls.io/repos/bogdanRada/washout_builder/badge.png" alt="Coverage Status" />}[https://coveralls.io/r/bogdanRada/washout_builder]
5
+ {<img src="https://codeclimate.com/github/bogdanRada/washout_builder.png" />}[https://codeclimate.com/github/bogdanRada/washout_builder]
5
6
  {<img src="https://reposs.herokuapp.com/?path=bogdanRada/washout_builder" alt="Repo Size"/>}[https://github.com/bogdanRada/washout_builder]
6
7
  {<img src="https://gem-download-badge.herokuapp.com/?gem=washout_builder&type=total" alt="Version Downloads"/>}[https://rubygems.org/gems/washout_builder]
7
8
  = Overview
@@ -1,18 +1,18 @@
1
1
  module WashoutBuilderComplexTypeHelper
2
2
 
3
- def create_complex_type_element_html(xml, element)
3
+
4
+ def create_element_type_html(pre, element)
4
5
  element.type = "string" if element.type == "text"
5
6
  element.type = "integer" if element.type == "int"
6
- xml.li { |pre|
7
- if WashoutBuilder::Type::BASIC_TYPES.include?(element.type)
7
+ if WashoutBuilder::Type::BASIC_TYPES.include?(element.type)
8
8
  pre << "<span class='blue'>#{element.type}</span>&nbsp;<span class='bold'>#{element.name}</span>"
9
9
  else
10
- create_element_type_html(pre, element)
10
+ create_complex_element_type_html(pre, element)
11
11
  end
12
- }
13
12
  end
14
13
 
15
- def create_element_type_html(pre, element)
14
+
15
+ def create_complex_element_type_html(pre, element)
16
16
  complex_class = element.get_complex_class_name
17
17
  unless complex_class.nil?
18
18
  complex_class_content = element.multiplied == false ? "#{complex_class}" : "Array of #{complex_class}"
@@ -6,20 +6,27 @@ module WashoutBuilderFaultTypeHelper
6
6
  end
7
7
 
8
8
 
9
- def create_html_fault_model_element_type(xml, attribute, attr_details)
10
- xml.li { |pre|
11
- if WashoutBuilder::Type::BASIC_TYPES.include?(attr_details[:primitive].to_s.downcase) || attr_details[:primitive] == "nilclass"
12
- pre << "<span class='blue'>#{attr_details[:primitive].to_s.downcase == "nilclass" ? "string" : attr_details[:primitive].to_s.downcase }</span>&nbsp;<span class='bold'>#{attribute}</span>"
13
-
14
- else
15
- if attr_details[:primitive].to_s.downcase == "array"
16
-
17
- attr_primitive = WashoutBuilder::Type::BASIC_TYPES.include?(attr_details[:member_type].to_s.downcase) ? attr_details[:member_type].to_s.downcase : attr_details[:member_type]
18
- create_fault_model_complex_element_type(pre,attr_primitive, attribute, true )
19
- else
20
- create_fault_model_complex_element_type(pre,attr_details[:primitive], attribute, false )
21
- end
22
- end
23
- }
9
+ def member_type_is_basic?(attr_details)
10
+ WashoutBuilder::Type::BASIC_TYPES.include?(attr_details[:member_type].to_s.downcase) ? attr_details[:member_type].to_s.downcase : attr_details[:member_type]
11
+ end
12
+
13
+ def primitive_type_is_basic?(attr_details)
14
+ WashoutBuilder::Type::BASIC_TYPES.include?(attr_details[:primitive].to_s.downcase)
15
+ end
16
+
17
+ def get_primitive_type_string(attr_details)
18
+ attr_details[:primitive].to_s.downcase == "nilclass" ? "string" : attr_details[:primitive].to_s.downcase
19
+ end
20
+
21
+ def get_member_type_string(attr_details)
22
+ attr_details[:primitive].to_s.downcase == "array" ? member_type_is_basic?(attr_details) : attr_details[:primitive]
23
+ end
24
+
25
+ def create_html_fault_model_element_type(pre, attribute, attr_details)
26
+ if primitive_type_is_basic?(attr_details) || attr_details[:primitive] == "nilclass"
27
+ pre << "<span class='blue'>#{get_primitive_type_string(attr_details)}</span>&nbsp;<span class='bold'>#{attribute}</span>"
28
+ else
29
+ create_fault_model_complex_element_type(pre, get_member_type_string(attr_details), attribute, true )
30
+ end
24
31
  end
25
32
  end
@@ -1,18 +1,6 @@
1
1
  module WashoutBuilderMethodListHelper
2
2
 
3
- def create_element_exceptions_list_html(p)
4
- xml.li("class" => "pre"){ |y| y<< "<a href='##{p.to_s}'><span class='lightBlue'> #{p.to_s}</span></a>" }
5
- end
6
-
7
- def create_parameters_element_list_html(xml, param)
8
- xml.li("class" => "pre") { |pre|
9
- if WashoutBuilder::Type::BASIC_TYPES.include?(param.type)
10
- pre << "<span class='blue'>#{param.type}</span>&nbsp;<span class='bold'>#{param.name}</span>"
11
- else
12
- create_element_type_html(pre, param)
13
- end
14
- }
15
- end
3
+
16
4
 
17
5
  def create_return_complex_type_list_html(xml, complex_class, builder_out)
18
6
  return_content = builder_out[0].multiplied == false ? "#{complex_class}" : "Array of #{complex_class}"
@@ -1,13 +1,15 @@
1
1
 
2
2
  unless object.blank?
3
3
  xml.a( "name" => "#{class_name}") { }
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>" } " }
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
7
  if object.is_a?(WashOut::Param)
8
8
  xml.ul("class" => "pre") {
9
9
  object.map.each do |element|
10
- create_complex_type_element_html(xml, element)
10
+ xml.li { |pre|
11
+ create_element_type_html(pre, element)
12
+ }
11
13
  end
12
14
  }
13
15
  end
@@ -3,7 +3,9 @@ if object.is_a?(Class)
3
3
  xml.a("name" => "#{object}") {}
4
4
  xml.ul("class" => "pre") {
5
5
  structure.each do |attribute, attr_details|
6
- create_html_fault_model_element_type(xml, attribute, attr_details)
6
+ xml.li { |pre|
7
+ create_html_fault_model_element_type( pre, attribute, attr_details)
8
+ }
7
9
  end
8
10
  }
9
11
  end
@@ -12,7 +12,9 @@ xml.p "#{description}" unless description.blank?
12
12
  xml.p "Parameters:"
13
13
  xml.ul {
14
14
  input.each do |element|
15
- create_parameters_element_list_html(xml,element)
15
+ xml.li("class" => "pre") { |pre|
16
+ create_element_type_html(pre, element)
17
+ }
16
18
  end
17
19
  }
18
20
 
@@ -30,7 +32,7 @@ unless operation_exceptions.blank?
30
32
  xml.p "Exceptions:"
31
33
  xml.ul {
32
34
  operation_exceptions.each do |p|
33
- create_element_exceptions_list_html(p)
35
+ xml.li("class" => "pre"){ |y| y<< "<a href='##{p.to_s}'><span class='lightBlue'> #{p.to_s}</span></a>" }
34
36
  end
35
37
  }
36
38
  end
@@ -1,3 +1,3 @@
1
1
  module WashoutBuilder
2
- VERSION = "0.13.3"
2
+ VERSION = "0.13.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: washout_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.3
4
+ version: 0.13.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - bogdanRada