swagchart 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/swagchart/helper.rb +2 -2
- data/lib/swagchart/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b195020d0d5716403429724c981e4243df25f45
|
4
|
+
data.tar.gz: 774ce360b2016c044846c359df628a523c3ae736
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63460ea5b0cba468c0d32e8c9e1686116c92155ef433288375d743a9edc93de41b4768a319e06b1e1af656c006a94045c1213c6539778865919a50d3c573090c
|
7
|
+
data.tar.gz: 4a2af2e69191d320c28963a2a5b58c1a64a81bd4f9ce6f0b8c2b3de82d6eb29daf66b62e943e6594d3a1718198ccfd6b25524a818e8c8fc21ecfd00dd8158623
|
data/lib/swagchart/helper.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'json'
|
2
2
|
require 'time'
|
3
3
|
require 'erb'
|
4
|
+
require 'securerandom'
|
4
5
|
|
5
6
|
module Swagchart
|
6
7
|
module Helper
|
@@ -13,7 +14,6 @@ module Swagchart
|
|
13
14
|
opts[:options] ||= {}
|
14
15
|
opts[:options] = (@default_chart_options || {}).merge(opts[:options])
|
15
16
|
@google_visualization_included ||= false
|
16
|
-
@chart_counter ||= 0
|
17
17
|
type = camelize(type.to_s)
|
18
18
|
opts[:columns] = opts[:columns].split(',').map(&:strip) if opts[:columns].is_a?(String)
|
19
19
|
data = data.to_a if data.is_a?(Hash)
|
@@ -23,7 +23,7 @@ module Swagchart
|
|
23
23
|
elsif data.respond_to?(:unshift) && data.respond_to?(:first) && opts[:columns]
|
24
24
|
data.unshift opts.delete(:columns)
|
25
25
|
end
|
26
|
-
chart_id = ERB::Util.html_escape(opts.delete(:chart_id) || "chart_#{
|
26
|
+
chart_id = ERB::Util.html_escape(opts.delete(:chart_id) || "chart_#{SecureRandom.uuid}")
|
27
27
|
style = 'height:320px;' #dirty hack right here .. you can override that with your style though
|
28
28
|
style << ERB::Util.html_escape(opts.delete(:style)) if opts[:style]
|
29
29
|
html = ''
|
data/lib/swagchart/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swagchart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pachacamac
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-04-
|
12
|
+
date: 2016-04-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|