dmix / weekly_builder

A Rails view helper for creating weekly calendars (horizontal scrolling), inspired by TableBuilder.

weekly_builder / install.rb
100755 16 lines (14 sloc) 0.414 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'fileutils'
 
plugin_dir = File.dirname(__FILE__)
 
%w(images stylesheets).each do |asset_dir|
  Dir.chdir(File.join(plugin_dir, 'lib', asset_dir))
  Dir['*'].each do |asset|
    file_path = File.join(RAILS_ROOT, 'public', asset_dir, asset)
    if File.exists?(file_path)
      puts "#{file_path} already exists"
    else
      FileUtils.cp(asset, file_path)
      puts "#{file_path} added"
    end
  end
end