a_la_chart 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -2
- data/README.rdoc +2 -2
- data/Rakefile +1 -1
- data/lib/a_la_chart.rb +1 -1
- data/lib/a_la_chart/a_la_chart.rb +0 -3
- data/lib/a_la_chart/config.rb +14 -18
- data/lib/a_la_chart/version.rb +1 -1
- metadata +5 -5
data/History.txt
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
+
=== 0.1.9 2010-10-19
|
2
|
+
* 1 bug fix:
|
3
|
+
* IE wouldn't properly grab an html.haml file due to responds_to ordering
|
4
|
+
|
1
5
|
=== 0.1.8 2010-8-30
|
2
6
|
* 1 enhancement
|
3
7
|
* now works with html_safe (for rails_xss and for Rails 3)
|
4
8
|
|
5
|
-
=== 0.1.7 ????-?-??
|
6
|
-
|
7
9
|
=== 0.1.6 2010-2-22
|
8
10
|
|
9
11
|
* 1 enhancement:
|
data/README.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= a_la_chart
|
2
2
|
|
3
|
-
* http://github.com/
|
3
|
+
* http://github.com/mobi/a_la_chart
|
4
4
|
|
5
5
|
== DESCRIPTION:
|
6
6
|
|
@@ -32,7 +32,7 @@ Set up the gem in your environment.rb
|
|
32
32
|
|
33
33
|
OR - to install this directly as a Rails plugin (not recommended, but available):
|
34
34
|
|
35
|
-
script/plugin install git://github.com/
|
35
|
+
script/plugin install git://github.com/mobi/a_la_chart.git
|
36
36
|
|
37
37
|
Once you have installed 'a la Chart', you can start creating charts immediately. Since Google Charts can function without any further install (it just hits a Google URL to generate an image inline), you can technically use 'a la Chart' (ALC) without any further install - but that's also kind of boring. If you need to use another supported charting framework, such as Fusion Charts or gRaphaël, you must install them locally, as per their normal install instructions. This generally means placing the required files (javascript, flash) in your project's /public directory, and linking to them via html header tags in your relevant /app/views/layouts files.
|
38
38
|
|
data/Rakefile
CHANGED
@@ -13,7 +13,7 @@ begin
|
|
13
13
|
s.rubyforge_project = "a_la_chart"
|
14
14
|
s.summary = "a La Chart manages various types of charting implementations - from grabbing the data, to declaring how those values are mapped to the desired type of chart (pie, line, bar, etc)."
|
15
15
|
s.email = "eric.redmond@gmail.com"
|
16
|
-
s.homepage = "http://github.com/
|
16
|
+
s.homepage = "http://github.com/mobi/a_la_chart"
|
17
17
|
s.description = "A framework for managing various types of charting implementations."
|
18
18
|
s.authors = ['Eric Redmond']
|
19
19
|
s.files = FileList["[A-Z]*", "init.rb", "{lib}/**/*", "configs/**/*"]
|
data/lib/a_la_chart.rb
CHANGED
@@ -96,9 +96,6 @@ module ALaChart
|
|
96
96
|
def a_la_chart
|
97
97
|
include ALaChart::InstanceMethods
|
98
98
|
|
99
|
-
# TODO: We should ensure this is for inherited_resources
|
100
|
-
self.respond_to(:chartxml, :chartjs, :chartjson) if defined?(self.respond_to)
|
101
|
-
|
102
99
|
self.before_filter(:provide_chart_data, :only => [:index, :show])
|
103
100
|
|
104
101
|
# TODO: Namespace this stuff??
|
data/lib/a_la_chart/config.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
module ALaChart
|
2
2
|
module Config
|
3
|
-
|
4
3
|
# Internally, this config is represented as:
|
5
4
|
# config = {
|
6
5
|
# :fusion => {
|
@@ -25,31 +24,22 @@ module ALaChart
|
|
25
24
|
def self.config
|
26
25
|
unless defined?(@@data)
|
27
26
|
require 'yaml'
|
28
|
-
|
29
|
-
def self.
|
30
|
-
|
31
|
-
|
32
|
-
unless k.is_a?(Symbol)
|
33
|
-
yaml_data[k.to_sym] ||= yaml_data.delete(k)
|
34
|
-
end
|
35
|
-
if v.is_a?(Array)
|
36
|
-
v.each {|e| self.symbolize_keys!(e) }
|
37
|
-
else
|
38
|
-
self.symbolize_keys!(v)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
27
|
+
|
28
|
+
def self.recursive_symbolize_keys!(hash)
|
29
|
+
hash.symbolize_keys!
|
30
|
+
hash.values.select{|v| v.is_a?(Hash)}.each{|h| recursive_symbolize_keys!(h)}
|
42
31
|
end
|
43
32
|
|
44
33
|
@@data = {}
|
45
|
-
|
46
|
-
|
34
|
+
|
35
|
+
Dir.foreach(File.expand_path('../../../configs', __FILE__)) do |dir|
|
36
|
+
config_path = File.expand_path("../../../configs/#{dir}/config.yml", __FILE__)
|
47
37
|
if File.exists?(config_path)
|
48
38
|
make = dir.to_sym
|
49
39
|
yaml_data = YAML.load_file(config_path)
|
50
40
|
# Deep clone the yaml data
|
51
41
|
@@data[make] = Marshal::load(Marshal.dump(yaml_data))
|
52
|
-
self.
|
42
|
+
self.recursive_symbolize_keys!(@@data[make])
|
53
43
|
end
|
54
44
|
end
|
55
45
|
end
|
@@ -59,6 +49,12 @@ module ALaChart
|
|
59
49
|
def self.[](make)
|
60
50
|
self.config[make.to_sym]
|
61
51
|
end
|
52
|
+
|
53
|
+
def self.[]=(key, value)
|
54
|
+
self.config unless defined?(@@data) # init the config
|
55
|
+
@@data[key.to_sym] = value
|
56
|
+
end
|
57
|
+
|
62
58
|
|
63
59
|
def self.keys
|
64
60
|
self.config.keys
|
data/lib/a_la_chart/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: a_la_chart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 9
|
10
|
+
version: 0.1.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Eric Redmond
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-10-19 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -100,7 +100,7 @@ files:
|
|
100
100
|
- test/test_a_la_chart.rb
|
101
101
|
- test/test_helper.rb
|
102
102
|
has_rdoc: true
|
103
|
-
homepage: http://github.com/
|
103
|
+
homepage: http://github.com/mobi/a_la_chart
|
104
104
|
licenses: []
|
105
105
|
|
106
106
|
post_install_message:
|