fusioncharts-rails 0.0.1 → 0.0.2
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/README.md +7 -4
- data/fusioncharts-rails.gemspec +1 -1
- data/lib/fusioncharts/rails/chart.rb +6 -1
- data/lib/fusioncharts/rails/version.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c21058d4b291154f177db0e1357d62b371c0e284
|
4
|
+
data.tar.gz: a61649d0ecf68c67634e1762a8600f594a4b505f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6bcba9c606503d9291b6ec1e1759cf9d087a20c9a7efffd824046aa99f18519a972ffbe53895130d0128de8f96f63c384951bb5b902a6d6a91df312f3931163
|
7
|
+
data.tar.gz: 4ef6d42d55edf1d19803a7f67ece790955265d631d54aebd08f670b371576ae579538d61462d51c76b953bcd1cc118fe5b56fdbe7a101835eb3f35de67498ca8
|
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# Fusioncharts Rails
|
2
2
|
|
3
|
-
|
3
|
+
[](http://badge.fury.io/rb/fusioncharts-rails)
|
4
|
+
[](https://codeclimate.com/github/fusioncharts/rails-wrapper)
|
5
|
+
|
6
|
+
Rails wrapper to build charts using FusionCharts. [http://www.fusioncharts.com](http://www.fusioncharts.com)
|
4
7
|
|
5
8
|
## Installation
|
6
9
|
|
@@ -104,11 +107,11 @@ In order to render the chart, you can use the `render` method in the specific vi
|
|
104
107
|
~~~
|
105
108
|
|
106
109
|
### 3. Note
|
107
|
-
- The `dataSource` method can
|
110
|
+
- The `dataSource` key (which can be set using the `dataSource` method or passed in as a hash in the chart constructor) can accept data which is in one of the following formats:
|
108
111
|
- Valid Ruby Hash
|
109
112
|
- JSON String
|
110
113
|
- XML String
|
111
|
-
- Also look at [FusionCharts Export Handler](https://github.com/fusioncharts/rails-exporter) to understand how to
|
114
|
+
- Also look at [FusionCharts Export Handler](https://github.com/fusioncharts/rails-exporter) to understand how to export a chart to different image formats and PDF.
|
112
115
|
|
113
116
|
## API Methods
|
114
117
|
|
@@ -193,4 +196,4 @@ In order to render the chart, you can use the `render` method in the specific vi
|
|
193
196
|
### Render the chart.
|
194
197
|
~~~
|
195
198
|
@chart.render()
|
196
|
-
~~~
|
199
|
+
~~~
|
data/fusioncharts-rails.gemspec
CHANGED
@@ -84,7 +84,7 @@ module Fusioncharts
|
|
84
84
|
|
85
85
|
# Render the chart
|
86
86
|
def render
|
87
|
-
config = self.options
|
87
|
+
config = json_escape JSON.generate(self.options)
|
88
88
|
dataUrlFormat = self.jsonUrl? ? "json" : ( self.xmlUrl ? "xml" : nil )
|
89
89
|
template = File.read(File.expand_path("../../../templates/chart.erb", __FILE__))
|
90
90
|
renderer = ERB.new(template)
|
@@ -118,6 +118,11 @@ module Fusioncharts
|
|
118
118
|
parse_datasource_json
|
119
119
|
end
|
120
120
|
|
121
|
+
# Escape tags in json, if avoided might be vulnerable to XSS
|
122
|
+
def json_escape(str)
|
123
|
+
str.to_s.gsub('/', '\/')
|
124
|
+
end
|
125
|
+
|
121
126
|
end
|
122
127
|
|
123
128
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fusioncharts-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- FusionCharts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
123
|
rubyforge_project:
|
124
|
-
rubygems_version: 2.0.
|
124
|
+
rubygems_version: 2.0.14
|
125
125
|
signing_key:
|
126
126
|
specification_version: 4
|
127
127
|
summary: Wrapper for fusioncharts
|