rgviz 0.41 → 0.42
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rgviz/csv_renderer.rb +7 -7
- data/lib/rgviz/memory_executor.rb +3 -3
- metadata +4 -7
data/lib/rgviz/csv_renderer.rb
CHANGED
@@ -6,10 +6,10 @@ module Rgviz
|
|
6
6
|
string << ',' if i > 0
|
7
7
|
string << CsvRenderer.format(row.label)
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
length = table.rows.length
|
11
11
|
string << "\n" if length > 0
|
12
|
-
|
12
|
+
|
13
13
|
table.rows.each_with_index do |row, i|
|
14
14
|
row.c.each_with_index do |col, i|
|
15
15
|
string << ',' if i > 0
|
@@ -19,17 +19,17 @@ module Rgviz
|
|
19
19
|
end
|
20
20
|
string
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
def self.format(value)
|
24
|
-
value = value.gsub('"', '""')
|
25
|
-
|
24
|
+
value = value.to_s.gsub('"', '""')
|
25
|
+
|
26
26
|
return "\"#{value}\"" if value.start_with?(' ') || value.end_with?(' ')
|
27
|
-
|
27
|
+
|
28
28
|
len = value.length
|
29
29
|
value.chars.each do |c|
|
30
30
|
return "\"#{value}\"" if c == ',' || c == "\n" || c == "\r" || c == "\t"
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
value
|
34
34
|
end
|
35
35
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
module Rgviz
|
2
2
|
class MemoryExecutor
|
3
|
-
def initialize(
|
4
|
-
@query = query
|
3
|
+
def initialize(rows, types)
|
5
4
|
@rows = rows
|
6
5
|
@types = types
|
7
6
|
@types_to_indices = {}
|
@@ -13,7 +12,8 @@ module Rgviz
|
|
13
12
|
@labels = {}
|
14
13
|
end
|
15
14
|
|
16
|
-
def execute(options = {})
|
15
|
+
def execute(query, options = {})
|
16
|
+
@query = query
|
17
17
|
@query = Parser.parse(@query, options) unless @query.kind_of?(Query)
|
18
18
|
@table = Table.new
|
19
19
|
|
metadata
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rgviz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
4
|
+
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
|
-
-
|
9
|
-
version: "0.
|
7
|
+
- 42
|
8
|
+
version: "0.42"
|
10
9
|
platform: ruby
|
11
10
|
authors:
|
12
11
|
- Ary Borenszweig
|
@@ -53,7 +52,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
53
52
|
requirements:
|
54
53
|
- - ">="
|
55
54
|
- !ruby/object:Gem::Version
|
56
|
-
hash: 3
|
57
55
|
segments:
|
58
56
|
- 0
|
59
57
|
version: "0"
|
@@ -62,14 +60,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
60
|
requirements:
|
63
61
|
- - ">="
|
64
62
|
- !ruby/object:Gem::Version
|
65
|
-
hash: 3
|
66
63
|
segments:
|
67
64
|
- 0
|
68
65
|
version: "0"
|
69
66
|
requirements: []
|
70
67
|
|
71
68
|
rubyforge_project:
|
72
|
-
rubygems_version: 1.
|
69
|
+
rubygems_version: 1.3.7
|
73
70
|
signing_key:
|
74
71
|
specification_version: 3
|
75
72
|
summary: Google Visualization API Query Language written in Ruby.
|