Class: RakeDotNet::Harvester

Inherits:
Object
  • Object
show all
Defined in:
lib/rake_dotnet.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHarvester

Returns a new instance of Harvester.



632
633
634
# File 'lib/rake_dotnet.rb', line 632

def initialize
	@files = Hash.new
end

Instance Attribute Details

#filesObject

Returns the value of attribute files.



630
631
632
# File 'lib/rake_dotnet.rb', line 630

def files
  @files
end

#targetObject

Returns the value of attribute target.



630
631
632
# File 'lib/rake_dotnet.rb', line 630

def target
  @target
end

Instance Method Details

#add(glob) ⇒ Object



636
637
638
639
640
641
642
# File 'lib/rake_dotnet.rb', line 636

def add(glob)
	toAdd = Dir.glob(glob)
	toAdd.each do |a|
		pn = Pathname.new(a)
		@files[pn.basename.to_s] = pn
	end
end

#harvest(target) ⇒ Object



644
645
646
647
648
649
# File 'lib/rake_dotnet.rb', line 644

def harvest(target)
	mkdir_p(target) unless File.exist?(target)
	@files.sort.each do |k, v|
		cp(v, target)
	end
end

#listObject



651
652
653
654
655
# File 'lib/rake_dotnet.rb', line 651

def list
	@files.sort.each do |k, v|
		puts k + ' -> ' + v
	end
end