Class: TemplateBuilder::App::FileAnalyzer::FileFramework

Inherits:
Object
  • Object
show all
Defined in:
lib/template_builder/app/file_analyzer.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ FileFramework

Returns a new instance of FileFramework.



60
61
62
63
# File 'lib/template_builder/app/file_analyzer.rb', line 60

def initialize(args)
 @name = args 
 load_conf_file
end

Instance Method Details

#all_frameworksObject



65
66
67
# File 'lib/template_builder/app/file_analyzer.rb', line 65

def all_frameworks
  @config_file.each_key.to_a
end

#load_conf_fileObject



69
70
71
# File 'lib/template_builder/app/file_analyzer.rb', line 69

def load_conf_file
  @config_file = TemplateBuilder::App::FileAnalyzer.load_conf_file @name
end

#load_framework(name) ⇒ Object



73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/template_builder/app/file_analyzer.rb', line 73

def load_framework(name)
  opts = {:name => name, :gems =>[]}
  @config_file[name].each do |key, value|
    if ["command","action"].include? key
      opts[key.to_sym] = value
    else
      gem = {:name => key}
      value.each {|key,value| gem[key.to_sym] = value}
      opts[:gems] << gem
    end
  end 
  TemplateBuilder::App::Helper.framework_factory opts
end