Class: Origen::CodeGenerators::Feature

Inherits:
Base
  • Object
show all
Includes:
BlockCommon
Defined in:
lib/origen/code_generators/feature.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BlockCommon

#class_name, #create_files, #extract_model_name, #validate_args_common

Methods inherited from Base

inherited, name, namespace

Methods included from Actions

#add_acronyms, #add_autoload, #add_config, #add_source, #camelcase, #comment_config, #config, #environment, #gem, #gem_group, #generate, #git, #initialize, #lib, #rakefile, #readme, #underscored_app_namespace

Methods included from Actions::Helpers

#add_type_to_namespaces, #class_name_to_blocks_dir, #class_name_to_lib_file, #internal_depth, #resource_path, #resource_path_to_blocks_dir, #resource_path_to_class, #resource_path_to_lib_file, #unless_has_method, #unless_valid_underscored_identifier, #validate_resource_path

Class Method Details



6
7
8
# File 'lib/origen/code_generators/feature.rb', line 6

def self.banner
  'origen new feature NAME'
end

Instance Method Details

#setupObject



39
40
41
42
43
44
45
46
47
# File 'lib/origen/code_generators/feature.rb', line 39

def setup
  @generate_model = false
  @generate_pins = true
  @generate_timesets = true
  @generate_parameters = true
  extract_model_name
  create_files
  add_acronyms
end

#validate_argsObject



29
30
31
32
33
34
35
36
37
# File 'lib/origen/code_generators/feature.rb', line 29

def validate_args
  if args.size > 1 || args.size == 0
    msg = args.size > 1 ? 'Only one' : 'One'
    msg << " argument is expected by the feature generator, e.g. 'origen new feature my_feature', 'origen new feature features/my_feature"
    puts msg
    exit 1
  end
  validate_args_common
end