chartkick 1.0.1 → 1.1.0

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: b5427cbb9ac6410183b5b75d934a86401f44edcf
4
- data.tar.gz: ba02320221736a07ac93952fddfb9f2009de9116
3
+ metadata.gz: 887154ecd859185c3907f75ebb240aa9ee516704
4
+ data.tar.gz: 5bded63b803870a2b8a305aaddc0205aa8ec429d
5
5
  SHA512:
6
- metadata.gz: 2b6fc819285107bf34dd80c1bde51a893be46ebf32bf4caed959c9e341ade192e9158fdb9d7946124349152e9e933f2b708fd803373bcd49a8db5f3214fd14ad
7
- data.tar.gz: f6b741b21283906af8017217cb92e41a7abff4da91fe267d4d29ed467265516ae0808b00bfab23b658be8a6f6d0b535ff56eef129a7c1e597cbe8f8122a4375f
6
+ metadata.gz: e953c7d8cbeac11247fd16b62dc20913af5d692abfc622c91682d3b656d02233768c092b4fe0b1378d71826847b18114d2907d307e111f967238cdb918f5ad47
7
+ data.tar.gz: 15116b19bf888405dfeea20d08d39c436a9aeda8d6ffb6a37670c113c3e48d688db7b5d68ae9150594562e89469cfbe26992b7f53b354c8d83f30fa070182645
@@ -1,6 +1,10 @@
1
+ ## 1.1.0
2
+
3
+ - Added support for Padrino and Rails 2.3+
4
+
1
5
  ## 1.0.1
2
6
 
3
- Updated chartkick.js to v1.0.1
7
+ - Updated chartkick.js to v1.0.1
4
8
 
5
9
  ## 1.0.0
6
10
 
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 3.1+ and most browsers (including IE 6)
7
+ Works with Rails, Padrino and most browsers (including IE 6)
8
8
 
9
9
  :two_hearts: A perfect companion to [groupdate](http://ankane.github.io/groupdate/)
10
10
 
@@ -102,9 +102,7 @@ Add this line to your application's Gemfile:
102
102
  gem "chartkick"
103
103
  ```
104
104
 
105
- And add the javascript files to your views. `chartkick.js` runs as a Rails engine - no need to install it.
106
-
107
- **Note:** These files must be included **before** the helper methods.
105
+ And add the javascript files to your views. These files must be included **before** the helper methods.
108
106
 
109
107
  For Google Charts, use:
110
108
 
@@ -118,9 +116,27 @@ If you prefer Highcharts, use:
118
116
  <%= javascript_include_tag "path/to/highcharts.js", "chartkick" %>
119
117
  ```
120
118
 
119
+ ### For Rails 3.1+
120
+
121
+ `chartkick.js` runs as a Rails engine - no need to install it.
122
+
123
+ ### For Rails 2.3 and 3.0
124
+
125
+ You must include `chartkick.js` manually. [Download it here](https://raw.github.com/ankane/chartkick/master/app/assets/javascripts/chartkick.js)
126
+
127
+ ### For Padrino
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
+ In addition, you must specify `http` or `https` if you use Google Charts, since Padrino tries to append `.js` to protocol relative urls.
132
+
133
+ ```erb
134
+ <%= javascript_include_tag "https://www.google.com/jsapi", "chartkick" %>
135
+ ```
136
+
121
137
  ## No Ruby? No Problem
122
138
 
123
- Check out [chartkick.js](https://github.com/ankane/chartkick.js).
139
+ Check out [chartkick.js](https://github.com/ankane/chartkick.js)
124
140
 
125
141
  ## Credits
126
142
 
@@ -18,8 +18,6 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "railties", ">= 3.1"
22
-
23
21
  spec.add_development_dependency "bundler", "~> 1.3"
24
22
  spec.add_development_dependency "rake"
25
23
  end
@@ -1,3 +1,4 @@
1
1
  require "chartkick/version"
2
- require "chartkick/engine"
3
2
  require "chartkick/helper"
3
+ require "chartkick/rails" if defined?(Rails)
4
+ require "chartkick/padrino" if defined?(Padrino)
@@ -1,3 +1,5 @@
1
+ require "json"
2
+
1
3
  module Chartkick
2
4
  module Helper
3
5
 
@@ -25,10 +27,10 @@ module Chartkick
25
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
26
28
  concat "Loading..."
27
29
  end
28
- script_tag = javascript_tag do
30
+ script_tag = content_tag :script do
29
31
  concat "new Chartkick.#{klass}(#{element_id.to_json}, #{data_source.to_json}, #{options.to_json});".html_safe
30
32
  end
31
- div_tag + script_tag
33
+ div_tag + script_tag if div_tag # nil for padrino
32
34
  end
33
35
 
34
36
  end
@@ -0,0 +1,3 @@
1
+ class Padrino::Application
2
+ helpers Chartkick::Helper
3
+ end
@@ -0,0 +1,5 @@
1
+ if Rails.version >= "3.1"
2
+ require "chartkick/engine"
3
+ else
4
+ ActionView::Base.send :include, Chartkick::Helper
5
+ end
@@ -1,3 +1,3 @@
1
1
  module Chartkick
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chartkick
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
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-05-23 00:00:00.000000000 Z
11
+ date: 2013-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: railties
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - '>='
18
- - !ruby/object:Gem::Version
19
- version: '3.1'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - '>='
25
- - !ruby/object:Gem::Version
26
- version: '3.1'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: bundler
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -70,6 +56,8 @@ files:
70
56
  - lib/chartkick.rb
71
57
  - lib/chartkick/engine.rb
72
58
  - lib/chartkick/helper.rb
59
+ - lib/chartkick/padrino.rb
60
+ - lib/chartkick/rails.rb
73
61
  - lib/chartkick/version.rb
74
62
  homepage: ''
75
63
  licenses: