lib/robotkit/cli.rb in robotkit-0.1.9 vs lib/robotkit/cli.rb in robotkit-0.2.0
- old
+ new
@@ -3,10 +3,11 @@
require "fileutils"
require "erb"
module Robotkit
PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
+ IGNORE_FILES = %w(. .. .DS_Store)
class CLI < Thor
desc "create :output_dir", "Create Android library project."
option :package, required: true
option :library_module
option :sample_module
@@ -26,10 +27,10 @@
library_module = params[:library_module] || "library"
sample_module = params[:sample_module] || "sample"
# copy from fixtues dir to output dir
FileUtils.mkdir(output_dir)
- Dir.foreach(fixtures_dir).reject{|it| it.start_with?(".") && it == ".gitignore"}.each do |item|
+ Dir.foreach(fixtures_dir).reject{|it| IGNORE_FILES.include?(it)}.each do |item|
FileUtils.rm("#{output_dir}/#{item}", {force: true})
FileUtils.cp_r("#{fixtures_dir}/#{item}", "#{output_dir}/#{item}", {preserve: true, dereference_root: true})
end
# change sample module dir