Sha256: 61dcec782adcb8b3a7cf6ad550cd5cc0867a4fa04cee11ce3f6f1c80b6c91995
Contents?: true
Size: 1.64 KB
Versions: 1
Compression:
Stored size: 1.64 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 README.md LICENSE) 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 if ARGV[0] == 'install' FileUtils.cp_r local_path + '/Gemfile.dev', users_path + "/Gemfile", :verbose => true end 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!" elsif 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.' else puts "Uknown command : #{ARGV[0]}, see ec --help for available commands." end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
easycomments-1.0.2 | bin/ec |