Class: RakeDotNet::Harvester
- Inherits:
-
Object
- Object
- RakeDotNet::Harvester
- Defined in:
- lib/rake_dotnet.rb
Instance Attribute Summary collapse
-
#files ⇒ Object
Returns the value of attribute files.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
- #add(glob) ⇒ Object
- #harvest(target) ⇒ Object
-
#initialize ⇒ Harvester
constructor
A new instance of Harvester.
- #list ⇒ Object
Constructor Details
#initialize ⇒ Harvester
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
#files ⇒ Object
Returns the value of attribute files.
630 631 632 |
# File 'lib/rake_dotnet.rb', line 630 def files @files end |
#target ⇒ Object
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 |
#list ⇒ Object
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 |