Sha256: d71e272e5f1801b6979fbfff9c3920b1acc3e577faaa1eeba361192168dd83c4

Contents?: true

Size: 1.01 KB

Versions: 14

Compression:

Stored size: 1.01 KB

Contents

#!/usr/bin/env ruby
$:.unshift(File.dirname(__FILE__) + '/../lib') unless $:.include?(File.dirname(__FILE__) + '/../lib')
require 'fileutils'

def create_folder path
  if !File.exists?(path)
    FileUtils.mkdir_p(path)
    print_msg "Created", path
  else
    print_msg "Do Nothing", path
  end
end

def create_file path
  if !File.exists?(path)
    name = File.basename(path)
    FileUtils.cp File.join(File.dirname(__FILE__), '..', 'template', name), path
    print_msg "Created", path
  else
    print_msg "Do Nothing", path
  end
end

def print_msg action, msg
  puts "%-10s: %s" % [action, msg]
end



case ARGV
when ['init']
  create_folder(File.join(Dir.pwd, 'helpers'))
  create_folder(File.join(Dir.pwd, 'log'))
  create_folder(File.join(Dir.pwd, 'config'))
  create_folder(File.join(Dir.pwd, 'scripts'))
  create_file(File.join(Dir.pwd, 'config', 'initializer.rb'))
  create_file(File.join(Dir.pwd, 'config', 'mongoid.yml'))
  create_file(File.join(Dir.pwd, 'Rakefile'))
  create_file(File.join(Dir.pwd, '.irbrc'))
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
speedos-0.0.14 bin/speedos
speedos-0.0.13 bin/speedos
speedos-0.0.12 bin/speedos
speedos-0.0.11 bin/speedos
speedos-0.0.10 bin/speedos
speedos-0.0.9 bin/speedos
speedos-0.0.8 bin/speedos
speedos-0.0.7 bin/speedos
speedos-0.0.6 bin/speedos
speedos-0.0.5 bin/speedos
speedos-0.0.4 bin/speedos
speedos-0.0.3 bin/speedos
speedos-0.0.2 bin/speedos
speedos-0.0.1 bin/speedos