Class: Ronin::RunList
- Inherits:
-
Object
- Object
- Ronin::RunList
- Includes:
- Enumerable
- Defined in:
- lib/ronin/run_list.rb
Instance Method Summary collapse
-
#initialize ⇒ RunList
constructor
A new instance of RunList.
- #items ⇒ Object
- #modules ⇒ Object
Constructor Details
#initialize ⇒ RunList
Returns a new instance of RunList.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/ronin/run_list.rb', line 23 def initialize @run_list = {} if Ronin::Config['run_list_type'] = :yaml @modules_raw = YAML.load_file(Ronin::Config['run_list_file'])['modules'] end @modules_raw.each do |m| if m.include?(";") @repo = m.split(";")[0].sub(/(\/)+$/,'') @branch = m.split(";")[1] else @repo = m @branch = 'master' end @name = @repo.split("/").last @run_list[@name] = { :name => @name, :repo => @repo, :branch => @branch } end @run_list end |
Instance Method Details
#items ⇒ Object
52 53 54 55 56 |
# File 'lib/ronin/run_list.rb', line 52 def items @items = [] @run_list.each { |k,v| @items << { :name => v[:name], :repo => v[:repo], :branch => v[:branch] } } @items end |
#modules ⇒ Object
46 47 48 49 50 |
# File 'lib/ronin/run_list.rb', line 46 def modules @mods = [] @run_list.each { |k,v| @mods << k } @mods end |