hiptest-publisher 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc621e079606555531a613b60c9878c1fefe4d5d
4
- data.tar.gz: f45e2ccedd0fef9d9b4f4d89b78371a3ddbcb879
3
+ metadata.gz: 0ac2f72fe8e4a51b4f7683bfc314b7626852fd2d
4
+ data.tar.gz: 5af568d1143809532802ff378b57c4a968c5563b
5
5
  SHA512:
6
- metadata.gz: fbb9d2fb95a93b45307b8372e23901c6bd50e197a845d69c97dda069a23d67ff0b78b027be8c4290d9dbc99d7f1e199bb18eec6a3527b9be429a8fd5d3fb8541
7
- data.tar.gz: 476637115253101f92c547d5e0b0b954a6d8a8c732dfc21893b0d4ac9cfa47f4e738dfe47721b3751f9d2d88702e1ac7aaf1a4a8667dfe5f8f829e639678d6b1
6
+ metadata.gz: 2b2cdd8916f5f4a578135bbabba307e1e591a7090074b469546d7587d1b841e258219bb582d18744efd4d21679e0e61f0d63a4b938e584a12c27a170a2897ff3
7
+ data.tar.gz: 274bb7d83746c5d05aacc825dc15ad42a79af0141e651b46831710de8c2ee2e7b3506b04f25b7ff4c3d721c8174443b0f9267587dca38549f5e3acd738fc0181
@@ -17,6 +17,7 @@ module Hiptest
17
17
 
18
18
  def process(project)
19
19
  gather_scenarios_argument_types(project)
20
+ gather_actionwords_default_parameters_types(project)
20
21
 
21
22
  # To have the most accurate type, the closest calls must be computed
22
23
  # first, and deepest calls must be computed last (because they depend
@@ -37,6 +38,17 @@ module Hiptest
37
38
  end
38
39
  end
39
40
 
41
+ def gather_actionwords_default_parameters_types(project)
42
+ project.children[:actionwords].children[:actionwords].each do |actionword|
43
+ @call_types.add_callable_item(actionword.children[:name], Actionword)
44
+ actionword.each_sub_nodes(Parameter) do |parameter|
45
+ default = parameter.children[:default]
46
+ next if default.nil?
47
+ @call_types.add_argument_type(parameter.children[:name], get_type(default))
48
+ end
49
+ end
50
+ end
51
+
40
52
  def gather_call_argument_types(node)
41
53
  node.each_sub_nodes(Call) do |call|
42
54
  @call_types.add_callable_item(call.children[:actionword], Actionword)
@@ -52,15 +64,13 @@ module Hiptest
52
64
 
53
65
  def add_arguments_from(node, context = nil)
54
66
  node.each_sub_nodes(Argument) do |argument|
55
- @call_types.add_argument_type(argument.children[:name], get_type(argument, context))
67
+ @call_types.add_argument_type(argument.children[:name], get_type(argument.children[:value], context))
56
68
  end
57
69
  end
58
70
 
59
71
  private
60
72
 
61
- def get_type(node, context = nil)
62
- value = node.children[:value]
63
-
73
+ def get_type(value, context = nil)
64
74
  case value
65
75
  when StringLiteral, Template then :String
66
76
  when NumericLiteral then value.children[:value].include?(".") ? :float : :int
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiptest-publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiptest R&D
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-20 00:00:00.000000000 Z
11
+ date: 2017-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -74,6 +74,9 @@ dependencies:
74
74
  name: nokogiri
75
75
  requirement: !ruby/object:Gem::Requirement
76
76
  requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: 1.8.0
77
80
  - - "~>"
78
81
  - !ruby/object:Gem::Version
79
82
  version: 1.8.0
@@ -81,6 +84,9 @@ dependencies:
81
84
  prerelease: false
82
85
  version_requirements: !ruby/object:Gem::Requirement
83
86
  requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 1.8.0
84
90
  - - "~>"
85
91
  - !ruby/object:Gem::Version
86
92
  version: 1.8.0