forked from michelson/lazy_high_charts
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
109 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
require 'bundler' | ||
Bundler::GemHelper.install_tasks | ||
# encoding: utf-8 | ||
require 'rubygems' | ||
require 'rake/dsl_definition' | ||
require 'rake' | ||
require 'rspec/core/rake_task' | ||
require 'bundler' | ||
|
||
desc 'Default: run specs.' | ||
task :default => :spec | ||
|
||
desc 'Run the specs' | ||
if defined?(RSpec) | ||
desc 'Test the Lazy_high_charts gem.' | ||
RSpec::Core::RakeTask.new('spec') do |t| | ||
t.pattern = FileList['spec/**/*_spec.rb'] | ||
end | ||
desc 'Test the Lazy_high_charts gem.' | ||
RSpec::Core::RakeTask.new('spec') do |t| | ||
t.pattern = FileList['spec/**/*_spec.rb'] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 7 additions & 4 deletions
11
lib/generators/lazy_high_charts/install/install_generator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
module LazyHighCharts | ||
class InstallGenerator < Rails::Generators::Base | ||
desc "This generator install highcharts javascripts" | ||
@@version = "2.1.1" | ||
|
||
def install_highcharts(opts = nil) | ||
say_status("installing", "Highcharts javascript (github STOCK branch)", :green) | ||
get "https://raw.github.com/highslide-software/highcharts.com/stock/js/highcharts.src.js","public/javascripts/highcharts.js" | ||
rescue OpenURI::HTTPError | ||
if ::Rails::VERSION::MAJOR == 3 && ::Rails::VERSION::MINOR >= 1 | ||
get "http://highcharts.com/js/highstock.js","app/assets/javascripts/highcharts.js" | ||
else | ||
get "https://raw.github.com/highslide-software/highcharts.com/stock/js/highcharts.src.js","public/javascripts/highcharts.js" | ||
end | ||
rescue OpenURI::HTTPError | ||
say_status("warning", "could not find Highcharts javascript file", :yellow) | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
# encoding: utf-8 | ||
|
||
require 'lazy_high_charts' | ||
require 'lazy_high_charts/layout_helper.rb' | ||
|
||
require 'rails' | ||
|
||
module LazyHighCharts | ||
class Railtie < Rails::Railtie | ||
initializer 'lazy_high_charts.initialize', :after => :after_initialize do | ||
ActionView::Base.send :include, LazyHighCharts::LayoutHelper | ||
ActionView::Base.send(:include, LazyHighCharts::LayoutHelper) | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module LazyHighCharts | ||
VERSION = "1.0.8" | ||
VERSION = "1.1.5" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# encoding: utf-8 | ||
require File.expand_path(File.join(File.dirname(__FILE__), "..", "init")) | ||
require File.expand_path(File.join(File.dirname(__FILE__), "..", "init")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.