Module: OrigenAppGenerators
- Extended by:
- Origen::Utility::InputCapture
- Defined in:
- lib/origen_app_generators.rb,
lib/origen_app_generators/new.rb,
lib/origen_app_generators/base.rb,
lib/origen_app_generators/plugin.rb,
lib/origen_app_generators/application.rb,
lib/origen_app_generators/empty_plugin.rb,
lib/origen_app_generators/sub_block_parser.rb,
lib/origen_app_generators/empty_application.rb,
lib/origen_app_generators/test_engineering/test_block.rb,
lib/origen_app_generators/test_engineering/stand_alone_application.rb
Defined Under Namespace
Modules: TestEngineering Classes: Application, Base, EmptyApplication, EmptyPlugin, New, Plugin, SubBlockParser
Constant Summary collapse
- TEST_INPUTS =
[ # Empty app ['0', '0', :default, :default, []], # Empty plugin ['0', '1', :default, :default, 'A test block', 'yes', []], # Stand alone test engineering app ['1', '0', :default, :default, 'Falcon, Eagle', 'Falcon[ram, atd(2), comm[ram(2), osc](3)], Eagle[ram(2), atd(4)]', ['origen g example']], # Test module ['1', '1', :default, :default, 'Test module for all flash IPs', 'FLASH_512K, FLASH_1024K', 'flash', ['origen g example']] ]
- AVAILABLE =
If adding any new generators manually always add them at the top, but generally speaking don’t, use ‘rake new’ to create a new generator instead
{ 'Test Engineering' => [ OrigenAppGenerators::TestEngineering::TestBlock, OrigenAppGenerators::TestEngineering::StandAloneApplication ] }
Class Method Summary collapse
Class Method Details
.invoke(path) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/origen_app_generators.rb', line 35 def self.invoke(path) puts puts 'CHOOSE AN ENGINEERING DOMAIN' puts puts "Domain-specific application templates are available for the following areas (enter '0' to build an empty generic one)" puts i = 0 accept = [0] puts '0 - Empty / Not listed' AVAILABLE.reverse_each do |domain, _generators| i += 1 accept << i puts "#{i} - #{domain}" end puts selection = get_text(single: true, default: '0', accept: accept).to_i if selection == 0 puts puts "WHAT TYPE OF APPLICATION DO YOU WANT TO BUILD? (if you don't know go with 'application')" puts puts '0 - Application' puts '1 - Plugin' puts accept = [0, 1] selection = get_text(single: true, accept: accept, default: 0).to_i case selection when 0 OrigenAppGenerators::EmptyApplication.start [path] when 1 OrigenAppGenerators::EmptyPlugin.start [path] end else domain = AVAILABLE.to_a domain = domain[domain.size - selection] puts puts "CHOOSE FROM THE FOLLOWING #{domain[0].upcase} APPLICATION TEMPLATES" puts accept = [] i = 0 domain[1].reverse_each do |generator| accept << i puts "#{i} - #{generator.desc}" i += 1 end puts selection = get_text(single: true, accept: accept).to_i domain[1][domain[1].size - 1 - selection].start [path] end end |