excel_to_code 0.1.17 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/src/compile/c/map_formulae_to_c.rb +2 -1
- data/src/compile/ruby/map_formulae_to_ruby.rb +3 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 941c09c8afeaa5e544a63fb1085365f8a4f7f992
|
4
|
+
data.tar.gz: d5a324022f70c5a83911b77a6ca059be3d738922
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5fd21e7c3779df389c0b876b0369ffdc486118081d1dc875bac7c325f5bab95a66f25989180cdadf67c3c9c5c652f5c3f527a474b6dbfc36b31b520f8a019c0
|
7
|
+
data.tar.gz: e45262481894791a2139ddb75cf9c961732401b433360d634063e6aafd87c792cb4fc18f034e8aaa12f0d19f9aae9a0e8630d1e845485fc4545302871d067323
|
@@ -31,6 +31,7 @@ class MapFormulaeToC < MapValuesToC
|
|
31
31
|
'AND' => 'excel_and',
|
32
32
|
'AVERAGE' => 'average',
|
33
33
|
'CHOOSE' => 'choose',
|
34
|
+
'CONCATENATE' => 'string_join',
|
34
35
|
'COSH' => 'cosh',
|
35
36
|
'COUNT' => 'count',
|
36
37
|
'COUNTA' => 'counta',
|
@@ -118,7 +119,7 @@ class MapFormulaeToC < MapValuesToC
|
|
118
119
|
end
|
119
120
|
end
|
120
121
|
|
121
|
-
FUNCTIONS_WITH_ANY_NUMBER_OF_ARGUMENTS = %w{SUM AND AVERAGE COUNT COUNTA MAX MIN SUMPRODUCT}
|
122
|
+
FUNCTIONS_WITH_ANY_NUMBER_OF_ARGUMENTS = %w{SUM AND AVERAGE COUNT COUNTA MAX MIN SUMPRODUCT CONCATENATE}
|
122
123
|
|
123
124
|
def function_pi()
|
124
125
|
"M_PI"
|
@@ -21,6 +21,7 @@ class MapFormulaeToRuby < MapValuesToRuby
|
|
21
21
|
'AVERAGE' => 'average',
|
22
22
|
'CELL' => 'cell',
|
23
23
|
'CHOOSE' => 'choose',
|
24
|
+
'CONCATENATE' => 'string_join',
|
24
25
|
'COSH' => 'cosh',
|
25
26
|
'COUNT' => 'count',
|
26
27
|
'COUNTA' => 'counta',
|
@@ -69,11 +70,11 @@ class MapFormulaeToRuby < MapValuesToRuby
|
|
69
70
|
def arithmetic(left,operator,right)
|
70
71
|
"#{FUNCTIONS[operator.last]}(#{map(left)},#{map(right)})"
|
71
72
|
end
|
72
|
-
|
73
|
+
|
73
74
|
def string_join(*strings)
|
74
75
|
"string_join(#{strings.map {|a| map(a)}.join(',')})"
|
75
76
|
end
|
76
|
-
|
77
|
+
|
77
78
|
def comparison(left,operator,right)
|
78
79
|
"#{FUNCTIONS[operator.last]}(#{map(left)},#{map(right)})"
|
79
80
|
end
|