chartkick 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of chartkick might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 887154ecd859185c3907f75ebb240aa9ee516704
4
- data.tar.gz: 5bded63b803870a2b8a305aaddc0205aa8ec429d
3
+ metadata.gz: 30de4fc2979a15f05f88ea0b616f62165f44af98
4
+ data.tar.gz: 3ce7c4dcc8cc46808a071beb0893631f2a21c2ea
5
5
  SHA512:
6
- metadata.gz: e953c7d8cbeac11247fd16b62dc20913af5d692abfc622c91682d3b656d02233768c092b4fe0b1378d71826847b18114d2907d307e111f967238cdb918f5ad47
7
- data.tar.gz: 15116b19bf888405dfeea20d08d39c436a9aeda8d6ffb6a37670c113c3e48d688db7b5d68ae9150594562e89469cfbe26992b7f53b354c8d83f30fa070182645
6
+ metadata.gz: c112540f2ab9e67a2a0438f034c3297c7b328e73a9c693e3ce84460a9e089735e20d7273fff294ab6e9d4693d74fa2619ae6352fb74aaf2288a3b3c602197ca1
7
+ data.tar.gz: 19460f79f6cfdd72025902fb2816167878356f8bf7b01c4b22dbfad9ae024a5ffe0e095d3d5dd4eda719eb98ff5db46d441360a4f060e4ce8631e0b305af5753
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.1.1
2
+
3
+ - Added support for Sinatra
4
+
1
5
  ## 1.1.0
2
6
 
3
7
  - Added support for Padrino and Rails 2.3+
data/README.md CHANGED
@@ -4,7 +4,7 @@ Create beautiful Javascript charts with one line of Ruby. No more fighting with
4
4
 
5
5
  [See it in action](http://ankane.github.io/chartkick/)
6
6
 
7
- Works with Rails, Padrino and most browsers (including IE 6)
7
+ Works with Rails, Sinatra and most browsers (including IE 6)
8
8
 
9
9
  :two_hearts: A perfect companion to [groupdate](http://ankane.github.io/groupdate/)
10
10
 
@@ -124,6 +124,15 @@ If you prefer Highcharts, use:
124
124
 
125
125
  You must include `chartkick.js` manually. [Download it here](https://raw.github.com/ankane/chartkick/master/app/assets/javascripts/chartkick.js)
126
126
 
127
+ ### For Sinatra
128
+
129
+ You must include `chartkick.js` manually. [Download it here](https://raw.github.com/ankane/chartkick/master/app/assets/javascripts/chartkick.js)
130
+
131
+ ```html
132
+ <script src="//www.google.com/jsapi"></script>
133
+ <script src="chartkick.js"></script>
134
+ ```
135
+
127
136
  ### For Padrino
128
137
 
129
138
  You must include `chartkick.js` manually. [Download it here](https://raw.github.com/ankane/chartkick/master/app/assets/javascripts/chartkick.js)
data/lib/chartkick.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  require "chartkick/version"
2
2
  require "chartkick/helper"
3
3
  require "chartkick/rails" if defined?(Rails)
4
- require "chartkick/padrino" if defined?(Padrino)
4
+ require "chartkick/sinatra" if defined?(Sinatra)
@@ -23,14 +23,16 @@ module Chartkick
23
23
  element_id = options.delete(:id) || "chart-#{@chartkick_chart_id += 1}"
24
24
  height = options.delete(:height) || "300px"
25
25
 
26
- # don't quote font-family names due to rails escaping
27
- div_tag = content_tag :div, :id => element_id, :style => "height: #{height}; text-align: center; color: #999; line-height: #{height}; font-size: 14px; font-family: Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif;" do
28
- concat "Loading..."
29
- end
30
- script_tag = content_tag :script do
31
- concat "new Chartkick.#{klass}(#{element_id.to_json}, #{data_source.to_json}, #{options.to_json});".html_safe
32
- end
33
- div_tag + script_tag if div_tag # nil for padrino
26
+ html = <<HTML
27
+ <div id="#{ERB::Util.html_escape(element_id)}" style="height: #{ERB::Util.html_escape(height)}; text-align: center; color: #999; line-height: #{ERB::Util.html_escape(height)}; font-size: 14px; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif;">
28
+ Loading...
29
+ </div>
30
+ <script type="text/javascript">
31
+ new Chartkick.#{klass}(#{element_id.to_json}, #{data_source.to_json}, #{options.to_json});
32
+ </script>
33
+ HTML
34
+
35
+ html.respond_to?(:html_safe) ? html.html_safe : html
34
36
  end
35
37
 
36
38
  end
@@ -1,3 +1,3 @@
1
- class Padrino::Application
1
+ class Sinatra::Base
2
2
  helpers Chartkick::Helper
3
3
  end
@@ -1,3 +1,3 @@
1
1
  module Chartkick
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chartkick
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-04 00:00:00.000000000 Z
11
+ date: 2013-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -56,8 +56,8 @@ files:
56
56
  - lib/chartkick.rb
57
57
  - lib/chartkick/engine.rb
58
58
  - lib/chartkick/helper.rb
59
- - lib/chartkick/padrino.rb
60
59
  - lib/chartkick/rails.rb
60
+ - lib/chartkick/sinatra.rb
61
61
  - lib/chartkick/version.rb
62
62
  homepage: ''
63
63
  licenses: