Top Level Namespace

Defined Under Namespace

Modules: JqPlotRails

Instance Method Summary collapse

Instance Method Details

#jqplot_install_items(item) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/jqplot_rails/tasks.rb', line 47

def jqplot_install_items(item)
  if(File.directory?(File.join(File.dirname(__FILE__), '..', '..', 'files', item)))
    FileUtils.mkdir_p(File.join(Rails.root, 'public', 'jqplot_rails', item))
    FileUtils.cp_r(
      File.join(File.dirname(__FILE__), '..', '..', 'files', item, File::SEPARATOR, '.'), 
      File.join(Rails.root, 'public', 'jqplot_rails', item)
    )
    puts "#{item.titleize} files installed."
  else
    puts "Nothing to install for: #{item}"
  end
end