Sha256: 1c40850e18efad6d0ad6cc470dd32dd4b2d4bd26cb9bd1437f1223fbf4a84f1b
Contents?: true
Size: 1.41 KB
Versions: 1
Compression:
Stored size: 1.41 KB
Contents
#!/usr/bin/env ruby #encoding: utf-8 require 'fileutils' local_path = File.expand_path("../../", __FILE__) users_path = Dir.pwd files = %w(ec.rb dashboard.rb config.ru _config.yml Rakefile Gemfile) def copy_files(local_path, users_path, files, dev=false) files.each do |filename| FileUtils.cp_r local_path + '/' + filename, users_path, :verbose => true end FileUtils.cp_r local_path + "/lib", users_path, :verbose => true FileUtils.cp_r local_path + "/public", users_path, :verbose => true FileUtils.cp_r local_path + "/views", users_path, :verbose => true if dev FileUtils.cp_r local_path + "/spec", users_path, :verbose => true FileUtils.cp_r local_path + '/.rspec', users_path, :verbose => true end end if ARGV[0] == 'install' if ARGV[1] == '--dev' copy_files(local_path, users_path, files, true) else copy_files(local_path, users_path, files) end puts "done!" elsif ARGV[0] == 'update' files.delete("_config.yml") files.delete("Gemfile") if ARGV[1] == '--dev' copy_files(local_path, users_path, files, true) else copy_files(local_path, users_path, files) end puts "done!" end if ARGV[0] == '--help' || ARGV[0] == '-h' || ARGV[0].nil? puts 'ec install, copies all the required files in the current directory.' puts 'ec update, same as install but skips _config.yml and Gemfile.' puts 'pass the --dev flag to "ec install" or "ec update" to also copy the test suite.' end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
easycomments-1.0.1 | bin/ec |