Class: LazyHighCharts::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/lazy_high_charts/install/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#install_highcharts(opts = nil) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/generators/lazy_high_charts/install/install_generator.rb', line 5

def install_highcharts(opts = nil)
  say_status("installing", "Highcharts javascript (github STOCK branch)", :green)
  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