lib/croc.rb
# Creates ~/.croc and installs assets from public directory.
Creates ~/.croc and installs assets from public directory.
Creates ~ / . croc and installs assets from public directory .
def install_assets
  croc_dir = File.join(user_home_dir, ".croc")
  unless File.exists?(croc_dir)
    Dir.mkdir(croc_dir)
    Dir.mkdir(File.join(croc_dir, "rdoc"))
  end
  public_dir = File.join(File.dirname(__FILE__), "..", "public")
  Dir.new(public_dir).each do |f|
    next if f == "." || f == ".."
    File.copy(File.join(public_dir, f), File.join(croc_dir, f))
  end
end
def install_assets croc_dir = File . join ( user_home_dir , ".croc" ) unless File . exists? ( croc_dir ) Dir . mkdir ( croc_dir ) Dir . mkdir ( File . join ( croc_dir , "rdoc" ) ) end public_dir = File . join ( File . dirname ( __FILE__ ) , ".." , "public" ) Dir . new ( public_dir ) . each do | f | next if f == "." || f == ".." File . copy ( File . join ( public_dir , f ) , File . join ( croc_dir , f ) ) end end
Creates ~/.croc and installs assets from public directory.
Creates ~ / . croc and installs assets from public directory .