Skip to content
Browse files

compatible rails 2.x gem

  • Loading branch information...
1 parent 5ae2722 commit 6855928acc0b83f511c2633041e636ffd94afc5a @xiaods xiaods committed Mar 20, 2011
Showing with 28 additions and 16 deletions.
  1. +1 −1 CHANGELOG.md
  2. +5 −0 init.rb
  3. +1 −14 lib/lazy_high_charts.rb
  4. +0 −1 lib/lazy_high_charts/layout_helper.rb
  5. +19 −0 lib/lazy_high_charts/railtie.rb
  6. +2 −0 rails/init.rb
View
2 CHANGELOG.md
@@ -1,6 +1,6 @@
Mar 20,2011
* dump to 1.1.0
-* Rename options[:x_axis] and options[:y_axis] to options[:xAxis] and options[:xYxis], and options[:plot_options] to options[:plotOptions] to make it consistent with highcharts.
+* Rename options[:x_axis] and options[:y_axis] to options[:xAxis] and options[:yAxis], and options[:plot_options] to options[:plotOptions] to make it consistent with highcharts.
Mar 19,2011
* refactor my gem code,dumped to 1.0.9
View
5 init.rb
@@ -0,0 +1,5 @@
+# encoding: utf-8
+require 'lazy_high_charts'
+require 'lazy_high_charts/layout_helper'
+
+ActionView::Base.send :include, LazyHighCharts::LayoutHelper
View
15 lib/lazy_high_charts.rb
@@ -1,20 +1,7 @@
require File.join(File.dirname(__FILE__), *%w[lazy_high_charts high_chart])
require File.join(File.dirname(__FILE__), *%w[lazy_high_charts layout_helper])
+require File.join(File.dirname(__FILE__), *%w[lazy_high_charts railtie]) if defined?(::Rails::Railtie)
module LazyHighCharts
- module Rails
- class Railtie < ::Rails::Railtie
- config.before_configuration do
- config.action_view.javascript_expansions[:high_charts] = %w(highcharts)
- end
-
- initializer 'lazy_high_charts.initialize' do
- ActiveSupport.on_load(:action_view) do
- include LazyHighCharts::LayoutHelper
- end
- end
- end
- end
-
end
View
1 lib/lazy_high_charts/layout_helper.rb
@@ -1,5 +1,4 @@
# coding: utf-8
-
require 'rails' unless defined? ::Rails
module LazyHighCharts
View
19 lib/lazy_high_charts/railtie.rb
@@ -0,0 +1,19 @@
+require 'lazy_high_charts'
+require 'lazy_high_charts/layout_helper'
+require 'rails'
+
+module LazyHighCharts
+
+ class Railtie < ::Rails::Railtie
+ config.before_configuration do
+ config.action_view.javascript_expansions[:high_charts] = %w(highcharts)
+ end
+
+ initializer 'lazy_high_charts.initialize' do
+ ActiveSupport.on_load(:action_view) do
+ include LazyHighCharts::LayoutHelper
+ end
+ end
+ end
+
+end
View
2 rails/init.rb
@@ -0,0 +1,2 @@
+# encoding: utf-8
+require File.expand_path(File.join(File.dirname(__FILE__), "..", "init"))

0 comments on commit 6855928

Please sign in to comment.
Something went wrong with that request. Please try again.