Class: Raykit::Conan::BuildInfo

Inherits:
Hash
  • Object
show all
Defined in:
lib/raykit/conan/buildinfo.rb

Overview

Functionality to manage a git commit

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ BuildInfo

Returns a new instance of BuildInfo.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/raykit/conan/buildinfo.rb', line 5

def initialize(filename)
    current_section=''
    current_list = Array.new()
    File.readlines(filename).each do |line|
        #puts line

        if(line.index('[') == 0)
            if(current_section.length > 0)
                self.store(current_section,current_list)
                current_list=Array.new()
            end
            current_section=line.strip()
        else
            item = line.strip()
            if(item.length > 0)
                current_list << item
            end
        end
        #

    end
end

Instance Method Details

#copy_pdbs(dir) ⇒ Object



49
50
51
52
53
54
55
56
57
# File 'lib/raykit/conan/buildinfo.rb', line 49

def copy_pdbs(dir)
    self.pdbs.each{|pdb|
        target="#{dir}/#{File.basename(pdb)}"
        if(!File.exists?(target))
            puts "  copying #{pdb} to #{target}"
            FileUtils.cp(pdb,"#{dir}/#{target}")
        end
    }
end

#pdbsObject



34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/raykit/conan/buildinfo.rb', line 34

def pdbs
    #puts "============================pdbs===================================="

    items = Array.new()
    self.section('[builddirs]').each{|dir|
        #puts dir

        Dir.glob("#{dir}/**/*.pdb").sort.each{|pdb|
            puts pdb
            items << pdb
        }
        #Dir.glob("#{lib_dir}/raykit/**/*.rb").sort.each { |file| require file }

    }
    #puts "============================pdbs===================================="

    items
end

#section(name) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/raykit/conan/buildinfo.rb', line 26

def section(name) 
    items = Array.new()
    if(self.has_key?(name))
        return self[name]
    end
    items
end