Class: PhantomGraph::Setting

Inherits:
Base
  • Object
show all
Defined in:
lib/phantom_graph/setting.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

attributes

Constructor Details

#initializeSetting

Returns a new instance of Setting.



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/phantom_graph/setting.rb', line 20

def initialize
  @default_options = { 
    logger:                  false, 
    auto_process:            true, 
    phantom_js_path:         phantomjs, 
    highcharts_convert_path: current_file("highcharts-convert.js"), 
    highcharts_theme_path:   current_file("gray.js"),
    highstock_path:          current_file("highstock.js"),
    highcharts_path:         current_file("highcharts.js"),
    jquery_path:             current_file("jquery.js")
  }
end

Instance Attribute Details

#phantomjsObject



33
34
35
# File 'lib/phantom_graph/setting.rb', line 33

def phantomjs
  @phantomjs ||= (defined?(Bundler) ? `bundle exec which phantomjs` : `which phantomjs`).chomp
end

Instance Method Details

#current_file(filename) ⇒ Object



37
38
39
# File 'lib/phantom_graph/setting.rb', line 37

def current_file(filename)
  File.expand_path(File.dirname(__FILE__)) + "/js/#{filename}"
end