rgviz-rails 0.69 → 0.71
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.
- data/README.markdown +1 -1
- data/lib/rgviz_rails.rb +31 -0
- data/lib/rgviz_rails/executor.rb +3 -23
- metadata +62 -36
data/README.markdown
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
rgviz-rails
|
2
2
|
===========
|
3
3
|
|
4
|
-
|
4
|
+
This library makes it easy to implement a visualization data source so that you can easily chart or visualize your data from [activerecord](http://ar.rubyonrails.org/) models or from in-memory arrays. the library implements the [google visualization api wire protocol](http://code.google.com/apis/visualization/documentation/dev/implementing_data_source.html).
|
5
5
|
|
6
6
|
it also allows you to [render the visualizations in a view template](https://github.com/asterite/rgviz-rails/wiki/showing-a-visualization-in-a-view) in a very simple but powerful way.
|
7
7
|
|
data/lib/rgviz_rails.rb
CHANGED
@@ -5,4 +5,35 @@ require "rgviz_rails/tqx"
|
|
5
5
|
require "rgviz_rails/parser"
|
6
6
|
|
7
7
|
module RgvizRails
|
8
|
+
def self.date(date)
|
9
|
+
def date.as_json(options = {})
|
10
|
+
self
|
11
|
+
end
|
12
|
+
def date.encode_json(*)
|
13
|
+
month = strftime("%m").to_i - 1
|
14
|
+
"new Date(#{strftime("%Y,#{month},%d")})"
|
15
|
+
end
|
16
|
+
date
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.datetime(time)
|
20
|
+
def time.as_json(*)
|
21
|
+
self
|
22
|
+
end
|
23
|
+
def time.encode_json(*)
|
24
|
+
month = strftime("%m").to_i - 1
|
25
|
+
"new Date(#{strftime("%Y,#{month},%d,%H,%M,%S")})"
|
26
|
+
end
|
27
|
+
time
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.time_of_day(time)
|
31
|
+
def time.as_json(*)
|
32
|
+
self
|
33
|
+
end
|
34
|
+
def time.encode_json(*)
|
35
|
+
"new Date(#{strftime('0,0,0,%H,%M,%S')})"
|
36
|
+
end
|
37
|
+
time
|
38
|
+
end
|
8
39
|
end
|
data/lib/rgviz_rails/executor.rb
CHANGED
@@ -382,33 +382,13 @@ module Rgviz
|
|
382
382
|
value == 1 || value == '1' ? true : false
|
383
383
|
when :date
|
384
384
|
value = Time.parse(value).to_date if value.is_a? String
|
385
|
-
|
386
|
-
self
|
387
|
-
end
|
388
|
-
def value.encode_json(*)
|
389
|
-
month = strftime("%m").to_i - 1
|
390
|
-
"new Date(#{strftime("%Y,#{month},%d")})"
|
391
|
-
end
|
392
|
-
value
|
385
|
+
RgvizRails::date(value)
|
393
386
|
when :datetime
|
394
387
|
value = Time.parse(value) if value.is_a? String
|
395
|
-
|
396
|
-
self
|
397
|
-
end
|
398
|
-
def value.encode_json(*)
|
399
|
-
month = strftime("%m").to_i - 1
|
400
|
-
"new Date(#{strftime("%Y,#{month},%d,%H,%M,%S")})"
|
401
|
-
end
|
402
|
-
value
|
388
|
+
RgvizRails::datetime(value)
|
403
389
|
when :timeofday
|
404
390
|
value = Time.parse(value) if value.is_a? String
|
405
|
-
|
406
|
-
self
|
407
|
-
end
|
408
|
-
def value.encode_json(*)
|
409
|
-
"new Date(#{strftime('0,0,0,%H,%M,%S')})"
|
410
|
-
end
|
411
|
-
value
|
391
|
+
RgvizRails::timeofday(value)
|
412
392
|
else
|
413
393
|
value.to_s
|
414
394
|
end
|
metadata
CHANGED
@@ -1,45 +1,60 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rgviz-rails
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 133
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 71
|
9
|
+
version: "0.71"
|
6
10
|
platform: ruby
|
7
|
-
authors:
|
11
|
+
authors:
|
8
12
|
- Ary Borenszweig
|
9
13
|
autorequire:
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
16
|
+
|
17
|
+
date: 2012-07-30 00:00:00 -03:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: rgviz
|
16
|
-
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
24
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 87
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
- 46
|
32
|
+
version: "0.46"
|
22
33
|
type: :runtime
|
23
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
26
36
|
name: rails
|
27
|
-
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
28
39
|
none: false
|
29
|
-
requirements:
|
30
|
-
- -
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
33
47
|
type: :runtime
|
34
|
-
|
35
|
-
version_requirements: *70265901445700
|
48
|
+
version_requirements: *id002
|
36
49
|
description:
|
37
50
|
email: aborenszweig@manas.com.ar
|
38
51
|
executables: []
|
52
|
+
|
39
53
|
extensions: []
|
40
|
-
|
54
|
+
|
55
|
+
extra_rdoc_files:
|
41
56
|
- README.markdown
|
42
|
-
files:
|
57
|
+
files:
|
43
58
|
- lib/rgviz_rails.rb
|
44
59
|
- lib/rgviz_rails/executor.rb
|
45
60
|
- lib/rgviz_rails/js_renderer.rb
|
@@ -52,28 +67,39 @@ files:
|
|
52
67
|
- lib/rgviz_rails/init.rb
|
53
68
|
- rails/init.rb
|
54
69
|
- README.markdown
|
70
|
+
has_rdoc: true
|
55
71
|
homepage: http://github.com/asterite/rgviz-rails
|
56
72
|
licenses: []
|
73
|
+
|
57
74
|
post_install_message:
|
58
75
|
rdoc_options: []
|
59
|
-
|
76
|
+
|
77
|
+
require_paths:
|
60
78
|
- lib
|
61
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
62
80
|
none: false
|
63
|
-
requirements:
|
64
|
-
- -
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
|
67
|
-
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
hash: 3
|
85
|
+
segments:
|
86
|
+
- 0
|
87
|
+
version: "0"
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
89
|
none: false
|
69
|
-
requirements:
|
70
|
-
- -
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
hash: 3
|
94
|
+
segments:
|
95
|
+
- 0
|
96
|
+
version: "0"
|
73
97
|
requirements: []
|
98
|
+
|
74
99
|
rubyforge_project:
|
75
|
-
rubygems_version: 1.
|
100
|
+
rubygems_version: 1.6.2
|
76
101
|
signing_key:
|
77
102
|
specification_version: 3
|
78
103
|
summary: rgviz for rails
|
79
104
|
test_files: []
|
105
|
+
|