Class: Origen::CodeGenerators::Semver
- Defined in:
- lib/origen/code_generators/semver.rb
Instance Method Summary collapse
Methods inherited from Base
banner, 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
Instance Method Details
#create_version_file ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/origen/code_generators/semver.rb', line 8 def create_version_file if config[:change] @version = config[:change] else @version = Origen.app.version # Ensure > 0.0.0 due to Bundler issues resolving 0.0.0.preX versions until @version.semantic? && @version.greater_than_or_equal_to?(VersionString.new('0.0.1')) ver = ask 'What version do you want to start from (this must be > 0.0.0) ? [0.1.0]' if !ver || ver.empty? @version = VersionString.new('0.1.0') else @version = VersionString.new(ver) end end end template 'templates/code_generators/version.rb', File.join(Origen.root, 'config', 'version.rb'), force: true end |