Sha256: adeb969f4b9d16f1cdcbf45d1983b563a7c6ee66a5b834569b798bbf5fef97a4

Contents?: true

Size: 567 Bytes

Versions: 19

Compression:

Stored size: 567 Bytes

Contents

class ForgeCLI::CustomFileCopier
  attr_accessor :app
  def self.copy_files!(app)
    new(app).copy_files!
  end

  def initialize(app)
    @app = app
  end

  def copy_files!
    files.each do |file|
      rel_path = file.gsub(File.join(ENV["HOME"], '.forge') + "/", '')
      ForgeCLI::Output.write('create', rel_path)
      FileUtils.cp_r(file, @app)
    end
  end

  def files
    @files ||= Dir.glob(File.join(ENV["HOME"], '.forge', '{*,.*}')).
                   reject { |f| rejects.include?(File.basename(f)) }
  end

  def rejects
    %w{. .. .git}
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
forge-cli-0.1.10 lib/forge-cli/custom_file_copier.rb
forge-cli-0.1.9 lib/forge-cli/custom_file_copier.rb
forge-cli-0.1.8 lib/forge-cli/custom_file_copier.rb
forge-cli-0.1.7 lib/forge-cli/custom_file_copier.rb
forge-cli-0.1.6 lib/forge-cli/custom_file_copier.rb
forge-cli-0.1.5 lib/forge-cli/custom_file_copier.rb
forge-cli-0.1.4 lib/forge-cli/custom_file_copier.rb
forge-cli-0.1.3 lib/forge-cli/custom_file_copier.rb
forge-cli-0.1.2 lib/forge-cli/custom_file_copier.rb
forge-cli-0.1.1 lib/forge-cli/custom_file_copier.rb
forge-cli-0.1.0 lib/forge-cli/custom_file_copier.rb
forge-cli-0.0.18 lib/forge-cli/custom_file_copier.rb
forge-cli-0.0.17 lib/forge-cli/custom_file_copier.rb
forge-cli-0.0.16 lib/forge-cli/custom_file_copier.rb
forge-cli-0.0.15 lib/forge-cli/custom_file_copier.rb
forge-cli-0.0.14 lib/forge-cli/custom_file_copier.rb
forge-cli-0.0.13 lib/forge-cli/custom_file_copier.rb
forge-cli-0.0.12 lib/forge-cli/custom_file_copier.rb
forge-cli-0.0.11 lib/forge-cli/custom_file_copier.rb