fusioncharts-rails 0.0.1 → 0.0.2

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: 8324958bdbd017e2ee8cdb65c07700ded0040187
4
- data.tar.gz: e96f6ae45bd53c1ff7bf7f98c6d42b907e52f859
3
+ metadata.gz: c21058d4b291154f177db0e1357d62b371c0e284
4
+ data.tar.gz: a61649d0ecf68c67634e1762a8600f594a4b505f
5
5
  SHA512:
6
- metadata.gz: 8c1715ac12c125797527b9f7d6947c4cde4c928fd773c2e94ed1aa72db967175719abb0f62e13d77a47ad755af8b76a3af51e2c5d0fdc63d8cbfca36e4bb1b63
7
- data.tar.gz: b3d5935b124798d36297c14dc9bd09445b8663b95c0eeb7502e8dd5442c07620220abcab550a65be9d7fac05394948ad77988582d6d02ed6d4eec62f482e8d7b
6
+ metadata.gz: f6bcba9c606503d9291b6ec1e1759cf9d087a20c9a7efffd824046aa99f18519a972ffbe53895130d0128de8f96f63c384951bb5b902a6d6a91df312f3931163
7
+ data.tar.gz: 4ef6d42d55edf1d19803a7f67ece790955265d631d54aebd08f670b371576ae579538d61462d51c76b953bcd1cc118fe5b56fdbe7a101835eb3f35de67498ca8
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # Fusioncharts Rails
2
2
 
3
- Rails plugin to build charts using FusionCharts. [http://www.fusioncharts.com](http://www.fusioncharts.com)
3
+ [![Gem Version](https://badge.fury.io/rb/fusioncharts-rails.svg)](http://badge.fury.io/rb/fusioncharts-rails)
4
+ [![Code Climate](https://codeclimate.com/github/fusioncharts/rails-wrapper/badges/gpa.svg)](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 take accept data which is one of the following formats:
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 import a chart to different image formats and to PDF.
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
+ ~~~
@@ -24,4 +24,4 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "rspec", "~> 3.1.0"
25
25
  spec.add_development_dependency "simplecov"
26
26
 
27
- end
27
+ end
@@ -84,7 +84,7 @@ module Fusioncharts
84
84
 
85
85
  # Render the chart
86
86
  def render
87
- config = self.options.to_json
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
@@ -1,5 +1,5 @@
1
1
  module Fusioncharts
2
2
  module Rails
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -15,6 +15,7 @@
15
15
  #
16
16
  # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
17
17
 
18
+ require "active_support"
18
19
  require "active_support/core_ext"
19
20
  require "action_view"
20
21
  require "fusioncharts/rails/chart"
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.1
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: 2014-12-11 00:00:00.000000000 Z
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.3
124
+ rubygems_version: 2.0.14
125
125
  signing_key:
126
126
  specification_version: 4
127
127
  summary: Wrapper for fusioncharts